/* ========================================
   FILTERS - СТИЛИ ФИЛЬТРОВ
   ======================================== */

.filters-section {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

/* ========================================
   QUICK FILTERS (CHIPS)
   ======================================== */

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.chip-filter {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 11px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.chip-filter:hover {
    border-color: #242840;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.chip-filter.active {
    background: #242840;
    border-color: #242840;
    color: white;
    box-shadow: var(--shadow-sm);
}

.chip-filter span {
    display: inline-block;
}

/* ========================================
   ADVANCED FILTERS
   ======================================== */

.advanced-filters {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group label .icon {
    font-size: 18px;
}

.filter-select {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.filter-select:hover {
    border-color: #242840;
}

.filter-select:focus {
    outline: none;
    border-color: #242840;
    box-shadow: 0 0 0 3px rgba(239, 99, 48, 0.1);
}

.filter-select option {
    padding: 10px;
}

/* Стили для option-разделителей — чёрный жирный текст */
.filter-select option:disabled {
    color: #000 !important;
    font-weight: 700 !important;
}

/* ========================================
   CHECKBOX GROUP (ДНИ НЕДЕЛИ)
   ======================================== */

.checkbox-group {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
}

.checkbox-label:hover {
    border-color: #242840;
    background: var(--bg-hover);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: white;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background: #242840;
    border-color: #242840;
    color: white;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .checkbox-group {
        gap: 4px;
    }
    
    .checkbox-label {
        padding: 8px 4px;
        font-size: 12px;
    }
}

/* ========================================
   LEVEL INFO LINK (ИНФОРМАЦИЯ ОБ УРОВНЯХ)
   ======================================== */

.level-info-link {
    display: inline;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #242840;
    text-decoration: none;
    border-bottom: 1px dotted #242840;
    transition: all var(--transition-normal);
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.level-info-link:hover {
    color: #ef6330;
    border-bottom-color: #ef6330;
    text-decoration: none;
}

/* ========================================
   LEVELS INFO MODAL — TABLES, B&W (2026-09-08)
   ======================================== */

.levels-modal-dialog {
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
}

.levels-modal-content {
    background: #fff !important;
    color: #111 !important;
    border-radius: 12px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

#levelsInfoModal h2 {
    color: #111 !important;
    padding: 22px 24px 10px 24px;
    margin: 0;
}

.levels-desc {
    padding: 0 24px 24px 24px;
}

/* --- Вкладки Дети / Взрослые --- */
.levels-tabs {
    display: flex;
    gap: 0;
    margin: 4px 0 18px 0;
    border-bottom: 2px solid #111;
}

.levels-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    background: #fff;
    color: #555;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.levels-tab:hover {
    color: #111;
}

.levels-tab.active {
    color: #111;
    border-bottom-color: #111;
}

.levels-panel {
    display: none;
}

.levels-panel.active {
    display: block;
}

/* --- Таблица уровней --- */
.levels-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #111;
    font-size: 14px;
}

.levels-table thead th {
    background: #111;
    color: #fff;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 12px 14px;
    border: none;
}

.levels-table .col-level {
    width: 175px;
}

.levels-table tbody td {
    padding: 14px;
    border: none;
    border-top: 1px solid #ccc;
    vertical-align: top;
    color: #111;
    line-height: 1.5;
    background: #fff;
}

.levels-table tbody tr:nth-child(even) td {
    background: #f4f4f4;
}

/* --- Названия уровней (черно-белые бейджи) --- */
.level-badge {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #111;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    background: #fff;
    color: #111;
}

.level-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

/* --- Мобильная версия: таблица → карточки --- */
@media (max-width: 767px) {
    .levels-desc {
        padding: 0 16px 20px 16px;
    }

    .levels-table,
    .levels-table thead,
    .levels-table tbody,
    .levels-table tr,
    .levels-table td {
        display: block;
        width: 100%;
    }

    .levels-table thead {
        display: none;
    }

    .levels-table tbody tr,
    .levels-table tbody tr:nth-child(even) td {
        background: #fff !important;
        border: 1px solid #111;
        border-radius: 0;
        margin-bottom: 12px;
        padding: 4px 0;
    }

    .levels-table tbody td {
        border-top: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 6px 12px;
    }

    .levels-table tbody tr td:last-child {
        border-bottom: none;
    }

    .levels-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: #888;
        margin-bottom: 3px;
    }

    .levels-table .col-level {
        width: 100%;
    }

    .level-note {
        display: inline;
        margin-left: 8px;
    }
}

/* ========================================
   SEARCH
   ======================================== */

.search-wrapper {
    position: relative;
    grid-column: 1 / -1;
}
@media (min-width: 769px) {
    .search-wrapper {
        grid-column: auto;
    }
}

.search-input {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--text-dark);
    background: white;
    transition: all var(--transition-normal);
}

.search-input:hover {
    border-color: var(--primary-light);
}

.search-input:focus {
    outline: none;
    border-color: #242840;
    box-shadow: 0 0 0 3px rgba(239, 99, 48, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

/* ========================================
   FILTER ACTIONS
   ======================================== */

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.btn-reset {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 11px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-reset:hover {
    border-color: #242840;
    color: var(--primary);
    background: var(--bg-hover);
}

.active-filters-count {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--text-medium);
}

.active-filters-count .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #242840;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    padding: 0 8px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .filters-section {
        position: relative;
        top: auto;
    }
    
    .quick-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .quick-filters::-webkit-scrollbar {
        display: none;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-reset {
        width: 100%;
    }
    
    .active-filters-count {
        justify-content: center;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-group {
    animation: fadeIn 0.3s ease backwards;
}

.filter-group:nth-child(1) { animation-delay: 0.05s; }
.filter-group:nth-child(2) { animation-delay: 0.1s; }
.filter-group:nth-child(3) { animation-delay: 0.15s; }
.filter-group:nth-child(4) { animation-delay: 0.2s; }
/* --- Фильтр по диапазону дат — отдельная строка (2026-09-08) --- */
.date-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 4px;
}

.date-filter-row label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #242840;
    white-space: nowrap;
}

.date-filter-row .date-range {
    flex: 0 1 auto;
}

/* --- Фильтр по диапазону дат (2026-09-08) --- */
.date-range {
    display: flex;
    gap: 8px;
}

.date-range input[type="date"] {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #242840;
    background: #fff;
}

.date-range input[type="date"]:focus {
    outline: none;
    border-color: #242840;
}
