/* * Live World 4.0 - стили конкурсов 
 * Файл: assets/css/konkurs.css
 * Версия: 4.113 16.01.2026 10:00
 * Изменения: Styles for Corner Add Buttons & Disabled Report Button
 */

#preloader { animation: fadeOut 0.5s ease-in-out 1s forwards; pointer-events: none; }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

body { 
    font-family: var(--font-main), 'Inter', sans-serif; 
    background-color: var(--bg-main, #111827); 
    color: var(--text-primary, #F3F4F6); 
    overflow-y: auto !important; 
}

/* Table Structure */
.contest-table-container { 
    overflow-x: auto; 
    position: relative; 
    max-height: calc(100vh - 80px); 
    padding-bottom: 0; 
}
.contest-table { border-collapse: separate; border-spacing: 0; min-width: 100%; table-layout: fixed; }
.contest-table th, .contest-table td { border: 1px solid var(--border-color, #374151); padding: 4px; text-align: center; vertical-align: middle; position: relative; }

/* Sticky Elements */
.sticky-corner { position: sticky; top: 0; left: 0; z-index: 60; background-color: #1F2937; min-width: 300px; width: 300px; height: 160px; }
.sticky-top { position: sticky; top: 0; z-index: 50; background-color: #1F2937; height: 160px; vertical-align: bottom; width: 100px; min-width: 100px; max-width: 100px; }
.sticky-left { 
    position: sticky; 
    left: 0; 
    z-index: 40; 
    background-color: #1F2937; 
    text-align: left !important; 
    padding-left: 0.5rem !important; 
    font-weight: 500; 
    width: 300px; 
    min-width: 300px; 
    max-width: 300px; 
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-top.z-active { z-index: 70 !important; }

/* --- DIAGONAL CORNER CELL --- */
.diagonal-split {
    position: relative;
    width: 100%;
    height: 100%;
    background: #1F2937;
    overflow: hidden;
}
.diagonal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom left, transparent calc(50% - 1px), #4B5563, transparent calc(50% + 1px));
    pointer-events: none;
}
.corner-text-top {
    position: absolute;
    top: 35px; right: 15px;
    font-weight: bold; color: #9CA3AF; font-size: 0.8rem; text-align: right;
}
.corner-text-bottom {
    position: absolute;
    bottom: 35px; left: 15px;
    font-weight: bold; color: #9CA3AF; font-size: 0.8rem; text-align: left;
}

/* [NEW] Corner Add Buttons */
.corner-add-btn {
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    background-color: #4F46E5;
    color: white;
    font-size: 14px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s, background-color 0.2s;
    z-index: 10;
}
.corner-add-btn:hover { background-color: #4338CA; transform: scale(1.1); }
.corner-add-btn.btn-crit { top: 62px; right: 10px; }
.corner-add-btn.btn-part { bottom: 62px; left: 10px; }

/* Active Filters List */
.active-filters-list { text-align: left; padding: 8px; height: 100%; overflow-y: auto; font-size: 0.75rem; color: #D1D5DB; }
.active-filters-title { font-weight: bold; color: #60A5FA; margin-bottom: 4px; border-bottom: 1px solid #374151; padding-bottom: 2px; }
.filter-tag { display: block; margin-bottom: 3px; line-height: 1.3; }
.filter-tag strong { color: #F3F4F6; }

/* --- HEADERS --- */
.sortable-header { 
    transition: background-color 0.2s; 
    padding: 0 !important; 
    position: relative;
    overflow: visible !important; 
}
.header-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    justify-content: flex-start; 
    position: relative;
    cursor: pointer; 
}
.header-wrapper:hover { background-color: #374151; }

.header-top-bar {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 2px 4px;
    height: 28px;
    width: 100%;
    background: rgba(31, 41, 55, 0.9);
    flex-shrink: 0; 
}

.header-icon-btn {
    cursor: pointer;
    color: #6B7280;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
}
.header-icon-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.header-icon-btn.active { color: #FBBF24; }
.header-icon-btn.filter-active { color: #3B82F6; }
.header-icon-btn.delete:hover { color: #EF4444; }

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: 30px; 
    left: 0; 
    background-color: #1F2937;
    border: 1px solid #4B5563;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    min-width: 160px;
    display: none;
    text-align: left;
    z-index: 100; 
}
.filter-dropdown.show { display: block; }
.filter-option { padding: 8px 12px; font-size: 0.8rem; color: #D1D5DB; cursor: pointer; border-bottom: 1px solid #374151; white-space: nowrap; }
.filter-option:hover { background-color: #374151; color: white; }
.filter-option.selected { background-color: #1E3A8A; color: #93C5FD; font-weight: bold; border-left: 3px solid #3B82F6; }
.filter-reset { color: #F87171; font-weight: bold; text-align: center; }

/* Vertical Text */
.vertical-header-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    width: 100%;
    height: 120px; 
    max-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto; 
    margin-bottom: 4px; 
    white-space: normal; 
    word-break: break-word; 
    line-height: 1.2;
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.vertical-header-text span { cursor: help; padding: 4px; border-radius: 4px; }
.vertical-header-text span:hover { background: rgba(255,255,255,0.1); color: white; }

/* Verificator Inputs */
.verificator-textarea { 
    background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: #F3F4F6; width: 100%; font-size: 0.75rem; 
    padding: 2px; resize: none; text-align: center; border-radius: 4px; margin-top: auto; margin-bottom: 4px; line-height: 1.1; 
    height: 60px; 
}
.verificator-name-input { background: transparent; border: none; color: white; width: 100%; font-size: 0.8rem; font-weight: bold; padding-left: 4px; }
.verificator-name-input:focus { outline: none; background: rgba(0,0,0,0.2); }

/* Cells Data */
.cell-data { min-width: 100px; height: 50px; font-family: 'Roboto Mono', monospace; font-weight: bold; }

/* Описание в ячейке (для режима View: Description) */
.cell-desc-inner {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem; 
    font-family: var(--font-main), 'Inter', sans-serif; 
    padding: 0 4px;
}

/* Тип А (Стандартный фон) */
.cell-type-a { background-color: rgba(30, 40, 55, 0.5); color: #E5E7EB; }

.cell-input-a { width: 100%; height: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: #F3F4F6; text-align: center; font-weight: bold; font-family: 'Roboto Mono', monospace; font-size: 0.9rem; border-radius: 4px; }
.cell-input-a:focus { background: rgba(0,0,0,0.5); outline: 1px solid #6366F1; }

/* Тип Б (По умолчанию / Нет моей оценки) */
.cell-type-b { 
    background-color: rgba(30, 40, 55, 0.5); 
    cursor: pointer; 
    border: 1px solid #4B5563; 
    transition: all 0.2s; 
}
.cell-type-b:hover { border-color: #FBBF24; background-color: rgba(55, 65, 81, 0.7); }

/* Тип Б (Есть моя оценка) */
.cell-type-b.has-my-vote {
    background-color: #111827 !important; 
    border-color: #4B5563; 
}
.cell-type-b.has-my-vote:hover {
    border-color: #FBBF24;
}

.hidden-row { display: none !important; }
.col-selected { background-color: rgba(99, 102, 241, 0.15) !important; border-left: 2px solid #6366F1 !important; border-right: 2px solid #6366F1 !important; }

/* Подсветка активного голосования */
.voting-active {
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.2); 
    border-color: rgba(16, 185, 129, 0.4);
}

/* Context Menu */
#context-menu { 
    position: fixed; 
    z-index: 9999; 
    width: 200px; 
    background: #1F2937; 
    border: 1px solid #4B5563; 
    border-radius: 6px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5); 
    display: none; 
}
#context-menu button { width: 100%; padding: 8px 12px; text-align: left; color: #D1D5DB; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
#context-menu button:hover { background-color: #374151; color: white; }

/* Modals & UI */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 100; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }

.modal-window { 
    background: #1F2937; 
    border: 1px solid #4B5563; 
    padding: 2rem; 
    border-radius: 1rem; 
    max-width: 500px; 
    width: 90%; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); 
    position: relative; 
}

/* Компактная модалка */
.modal-window.compact-modal {
    padding: 1.5rem !important; 
    max-width: 450px;
}

.modal-close-btn { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; color: #6B7280; cursor: pointer; background: none; border: none; }

/* Rating Buttons */
.rating-btn { 
    height: 3rem; width: 100%; border-radius: 0.5rem; background-color: #374151; font-weight: bold; font-size: 1.25rem; color: #D1D5DB; border: 1px solid #4B5563; transition: all 0.1s ease-in-out; 
}
.rating-btn:hover { background-color: #4B5563; }
.rating-btn.active { transform: scale(1.05); border-color: white; color: white; box-shadow: 0 0 10px rgba(255,255,255,0.3); }

/* --- TIMER LOOK --- */
#timer-container { 
    font-family: 'Roboto Mono', monospace; 
    background: linear-gradient(to bottom, #374151, #1F2937); 
    padding: 6px 16px; 
    border-radius: 6px; border: 1px solid #4B5563; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    display: flex; align-items: center;
    max-height: 80px; 
    overflow-y: auto;
}

#timer-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

.timer-row-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
}

.timer-row-time {
    font-size: 1rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.timer-digit { 
    font-size: 1.3rem; 
    font-weight: 800; 
    color: #FBBF24; 
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4); 
}

/* Info Modal Long Content Support */
#info-desc {
    max-height: 60vh; /* Ограничиваем высоту 60% экрана */
    overflow-y: auto; /* Включаем вертикальный скролл */
    font-size: 0.85rem; /* Немного уменьшаем шрифт (13.6px) */
    line-height: 1.5;
    padding-right: 6px; /* Место под скролл */
    color: #D1D5DB; 
    margin-right: -4px; /* Визуальная компенсация отступа */
}

#info-desc::-webkit-scrollbar { width: 4px; }
#info-desc::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
#info-desc::-webkit-scrollbar-thumb { background: #4B5563; border-radius: 2px; }
#info-desc::-webkit-scrollbar-thumb:hover { background: #60A5FA; }

/* PRINT STYLES for Report */
@media print {
    .report-hidden-on-print, 
    #context-menu, 
    .modal-backdrop:not(#report-modal) { 
        display: none !important; 
    }
    
    #report-modal {
        position: absolute;
        inset: 0;
        background: white;
        z-index: 9999;
        display: block !important;
    }
    
    #report-modal .modal-window {
        width: 100%;
        max-width: none;
        height: auto;
        border: none;
        box-shadow: none;
        background: white;
        padding: 0;
        overflow: visible;
    }

    #report-body {
        overflow: visible !important;
        height: auto !important;
        padding: 0 !important;
    }

    .break-inside-avoid {
        break-inside: avoid;
    }

    body {
        background: white;
        color: black;
        overflow: visible !important;
    }
}