/* 
   Courses Header Component Styles - Стили заголовка страницы курсов
   
   НАЗНАЧЕНИЕ:
   - Стили ТОЛЬКО для заголовка страницы курсов (.courses-header-block)
   - Идентичны header.css, но с ЗЕЛЕНОЙ цветовой схемой
   
   НЕ СОДЕРЖИТ:
   - Стили других компонентов страницы курсов
   - Стили отдельных курсов (.course-item)
*/

/* ========== КАРТОЧКА ЗАГОЛОВКА КУРСОВ ========== */
.courses-header-block {
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
}
.courses-header-block.info-open {
    margin-bottom: 8px; /* как в замерах, когда показывается инфо-панель */
}

.dark-theme .courses-header-block {
    background: rgba(30, 30, 46, 0.85);
}

.courses-header-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, #2dd4bf, #14b8a6, #0f766e);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.dark-theme .courses-header-block::before {
    opacity: 0.7;
}

/* Градиентная рамка */
.courses-header-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, #2dd4bf, #14b8a6, #0f766e);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.dark-theme .courses-header-block::before {
    opacity: 0.7;
}

/* ========== КОНТЕНТ ЗАГОЛОВКА ========== */
.courses-header-content {
    /* Относительное позиционирование для правильного наложения слоев */
    position: relative;
    
    /* Z-index выше чем у псевдоэлемента ::before */
    z-index: 2;
}

/* Стили для заголовка H1 (название страницы курсов) */
.courses-header-block .courses-header-content .courses-title {
    /* Уменьшенный размер шрифта для лучшей читаемости */
    font-size: 1.8em;
    
    /* Очень жирный шрифт */
    font-weight: 800;
    
    /* Межстрочный интервал для многострочного заголовка */
    line-height: 1.1;
    
    /* Убираем стандартные отступы, добавляем только снизу */
    margin: 0 0 6px 0;
    
    /* Сжимаем буквы для более плотного текста */
    letter-spacing: -0.5px;
    
    /* БИРЮЗОВЫЙ однотонный цвет для текста (без градиента) */
    color: #14b8a6;
}

/* Стили для подзаголовка */
.courses-header-block .courses-subtitle {
    /* Средний размер шрифта */
    font-size: 0.95em;
    
    /* Серый цвет для вторичного текста */
    color: #64748b;
    
    /* Средняя жирность шрифта */
    font-weight: 500;
    
    /* Убираем все отступы */
    margin: 0;
}

/* Светлый серый цвет для подзаголовка в темной теме */
.dark-theme .courses-header-block .courses-subtitle {
    color: #a0a0c0;
}

/* БИРЮЗОВЫЙ цвет для заголовка в темной теме (без градиента) */
.dark-theme .courses-header-block .courses-header-content .courses-title {
    color: #2dd4bf;
}

/* ========== КНОПКА ИНФОРМАЦИИ ========== */
.info-button {
    /* Абсолютное позиционирование в правом верхнем углу */
    position: absolute;
    top: 7px;    /* 16px от верхнего края */
    right: 7px;  /* 16px от правого края */
    
    /* Полупрозрачный БИРЮЗОВЫЙ фон - идентично theme-toggle */
    background: rgba(20, 184, 166, 0.1);
    
    /* Убираем ВСЕ границы и обводки */
    border: none;
    outline: none;
    
    /* БИРЮЗОВЫЙ цвет иконки */
    color: #14b8a6;
    
    /* Убираем внутренние отступы */
    padding: 0;
    
    /* Круглая форма кнопки */
    border-radius: 50%;
    
    /* Курсор-указатель при наведении */
    cursor: pointer;
    
    /* Размер иконки внутри кнопки */
    font-size: 1.2em;
    
    /* Плавные переходы для всех анимируемых свойств */
    transition: all 0.3s ease;
    
    /* Высокий z-index чтобы кнопка была поверх других элементов */
    z-index: 10;
    
    /* Фиксированные размеры кнопки */
    width: 25px;
    height: 25px;
    
    /* Flexbox для центрирования иконки */
    display: flex;
    align-items: center;      /* Центрирование по вертикали */
    justify-content: center;  /* Центрирование по горизонтали */
    
    /* Размытие фона за кнопкой - идентично theme-toggle */
    backdrop-filter: blur(10px);
    
    /* Жирный шрифт для иконки "i" */
    font-weight: 700;
}

/* Эффекты при наведении мыши на кнопку */
.info-button:hover {
    background: rgba(20, 184, 166, 0.1);
    transform: none;
    box-shadow: none;
}

/* Эффект при нажатии на кнопку */
.info-button:active {
    /* Уменьшение кнопки для эффекта "нажатия" */
    transform: scale(0.95);
    /* Убираем обводку при нажатии */
    outline: none;
    border: none;
}

/* Убираем обводку при фокусе */
.info-button:focus {
    outline: none;
    border: none;
}

/* Стили кнопки в темной теме - идентично theme-toggle */
.dark-theme .info-button {
    /* Белый полупрозрачный фон */
    background: rgba(255, 255, 255, 0.1);
    
    /* Приглушенный бирюзовый для иконки */
    color: #34d399;
}

/* Эффекты при наведении в темной теме */
.dark-theme .info-button:hover {
    /* Более яркий белый фон */
    background: rgba(255, 255, 255, 0.2);
    
    /* Смягченный бирюзовый цвет */
    color: #5eead4;
}

/* Дополнительная специфичность для темной темы */
body.dark-theme .info-button {
    /* Белый полупрозрачный фон */
    background: rgba(255, 255, 255, 0.1);
    
    /* Приглушенный бирюзовый для иконки */
    color: #34d399;
}

body.dark-theme .info-button:hover {
    /* Более яркий белый фон */
    background: rgba(255, 255, 255, 0.2);
    
    /* Смягченный бирюзовый цвет */
    color: #5eead4;
}

/* ========== ЭФФЕКТЫ ПРИ НАВЕДЕНИИ НА ВЕСЬ ЗАГОЛОВОК ========== */
.courses-header-block:hover {
    transform: translateY(0);
}

.dark-theme .courses-header-block:hover {
    transform: translateY(0);
}

/* ========== ФИЛЬТР-ТАБЫ (Доступные / К покупке) ========== */
.courses-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.courses-filter-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 16px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    color: #64748b;
    outline: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Градиентная рамка для неактивной кнопки */
.courses-filter-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.25), rgba(20, 184, 166, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Активная кнопка - заливка бирюзовым градиентом, белый текст */
.courses-filter-tab.active {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
}

.courses-filter-tab.active::before {
    display: none;
}

.courses-filter-tab:active {
    transform: scale(0.97);
}

/* Тёмная тема */
.dark-theme .courses-filter-tab {
    background: rgba(30, 30, 46, 0.75);
    color: #a0a0c0;
    box-shadow: none;
}

.dark-theme .courses-filter-tab::before {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.3), rgba(20, 184, 166, 0.15));
}

.dark-theme .courses-filter-tab.active {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.25);
}

/* Адаптивность фильтр-табов */
@media (max-width: 480px) {
    .courses-filter-tabs {
        gap: 6px;
        margin-bottom: 12px;
    }

    .courses-filter-tab {
        padding: 8px 10px;
        font-size: 0.85em;
        border-radius: 14px;
    }

    .courses-filter-tab::before {
        border-radius: 14px;
    }
}

@media (max-width: 320px) {
    .courses-filter-tabs {
        gap: 5px;
        margin-bottom: 10px;
    }

    .courses-filter-tab {
        padding: 7px 8px;
        font-size: 0.8em;
        border-radius: 12px;
    }

    .courses-filter-tab::before {
        border-radius: 12px;
    }
}

/* ========== РАЗВОРАЧИВАЕМАЯ ПАНЕЛЬ ИНФОРМАЦИИ (как в Мои замеры) ========== */
.courses-info-panel {
    margin-top: 12px;
    padding: 16px;
    background: rgba(20, 184, 166, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 173, 0.18);
    animation: slideDown 0.3s ease;
}

.dark-theme .courses-info-panel {
    background: rgba(45, 212, 191, 0.18);
    border-color: rgba(45, 212, 191, 0.3);
}

.courses-info-panel.hidden {
    display: none;
}

.courses-info-content p {
    font-size: 0.9em;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.courses-info-content p:last-child {
    margin-bottom: 0;
}

.dark-theme .courses-info-content p {
    color: #cbd5e1;
}

.courses-info-close-hint {
    font-size: 0.8em !important;
    color: #94a3b8 !important;
    font-style: italic;
    margin-top: 8px !important;
}

.dark-theme .courses-info-close-hint {
    color: #64748b !important;
}

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

/* ========== АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ========== */

/* Стили для экранов шириной до 480px (большинство смартфонов) */
@media (max-width: 480px) {
    /* Уменьшаем внутренние отступы карточки заголовка */
    .courses-header-block {
        padding: 20px; /* Было 24px, стало 20px */
        margin-bottom: 16px; /* Было 20px, стало 16px */
    }
    
    /* Уменьшаем размер заголовка */
    .courses-header-block .courses-header-content .courses-title {
        font-size: 1.5em; /* Было 1.8em, стало 1.5em */
    }
    
    /* Уменьшаем размер подзаголовка */
    .courses-header-block .courses-subtitle {
        font-size: 0.9em; /* Было 0.95em, стало 0.9em */
    }
    
    /* Делаем кнопку информации меньше */
    .info-button {
        width: 23px;      /* Было 40px, стало 36px */
        height: 23px;     /* Было 40px, стало 36px */
        font-size: 1.1em; /* Было 1.2em, стало 1.1em */
        top: 8px;        /* Было 16px, стало 12px */
        right: 8px;      /* Было 16px, стало 12px */
    }
}

/* Стили для очень маленьких экранов до 320px (старые/маленькие смартфоны) */
@media (max-width: 320px) {
    /* Еще больше уменьшаем внутренние отступы и скругление */
    .courses-header-block {
        padding: 18px;        /* Было 24px, стало 18px */
        border-radius: 20px;  /* Было 24px, стало 20px */
        margin-bottom: 12px;  /* Было 20px, стало 12px */
    }
    
    /* Еще больше уменьшаем заголовок */
    .courses-header-block .courses-header-content .courses-title {
        font-size: 1.3em; /* Было 1.8em, стало 1.3em */
    }
    
    /* Еще больше уменьшаем подзаголовок */
    .courses-header-block .courses-subtitle {
        font-size: 0.85em; /* Было 0.95em, стало 0.85em */
    }
    
    /* Делаем кнопку еще меньше для маленьких экранов */
    .info-button {
        width: 20px;     /* Было 40px, стало 32px */
        height: 20px;    /* Было 40px, стало 32px */
        font-size: 1em;  /* Было 1.2em, стало 1em */
        top: 7px;       /* Было 16px, стало 10px */
        right: 7px;     /* Было 16px, стало 10px */
    }
}
