/* 
   Courses Page Styles - Стили страницы курсов
   
   НАЗНАЧЕНИЕ:
   - Стили ТОЛЬКО для отдельных элементов курсов (.course-item)
   - Применяются динамически через courses-page.js
   - Цвета и градиенты берутся из courses-data.js
   
   НЕ СОДЕРЖИТ:
   - Стили заголовка страницы (они в courses-header.css)
   - Стили модального окна (они в courses-header.css)
   - Статические стили (они в global.css)
*/

/* Стили для заголовка страницы курсов удалены - используются courses-header.css */

/* 
   Courses Page Styles - Стили страницы курсов
   
   ИСПРАВЛЕНО: Проблема с просвечиванием градиентной рамки через полупрозрачный фон
*/

/* ========== СПИСОК КУРСОВ ========== */
.courses-page .courses-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.courses-page .course-item {
    border-radius: 20px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.courses-page .course-item::before,
.courses-page .course-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: 0;
}

.courses-page .course-item::before {
    padding: 1px;
    background: var(--course-border-gradient, linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(59, 130, 246, 0.2)));
    -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.65;
}

.courses-page .course-item::after {
    inset: 1px;
    border-radius: 19px;
    background: var(--course-background-color, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.courses-page .course-item > *:not(.course-badge) {
    position: relative;
    z-index: 1;
}

/* Бейдж поверх всех */
.courses-page .course-item .course-badge {
    z-index: 10;
}

.dark-theme .courses-page .course-item-title {
    color: #ffffff;
}

.dark-theme .courses-page .course-item-subtitle {
    color: #b3b3cc;
}

.dark-theme .courses-page .course-item-arrow {
    color: #60a5fa;
}

.dark-theme .courses-page .course-item::before {
    opacity: 0.85;
}

.courses-page .course-item:hover {
    transform: translateY(-4px);
}

/* ========== ИКОНКА КУРСА ========== */
.courses-page .course-item-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3; /* Выше всех остальных элементов */
    color: white;
}

.courses-page .course-item:hover .course-item-icon {
    transform: scale(1.1);
}

/* Отключаем анимацию scale для иконок с картинками (file_id/URL) */
/* Картинки могут размываться при увеличении, эмодзи - нет */
.courses-page .course-item:hover .course-item-icon:has(img) {
    transform: scale(1);
}

/* ========== КОНТЕНТ КУРСА ========== */
.courses-page .course-item-content {
    flex: 1;
    position: relative;
    z-index: 3; /* Выше градиентной рамки */
}

.courses-page .course-item-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 3px;
    color: #1e293b;
    transition: color 0.3s ease;
}

.courses-page .course-item-subtitle {
    color: #64748b;
    font-size: 0.85em;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* ========== ПРОГРЕСС БАР КУРСА ========== */
.course-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.course-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(128, 128, 128, 0.15);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.dark-theme .course-progress-track {
    background: rgba(255, 255, 255, 0.1);
}

.course-progress-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
    min-width: 0;
}

.course-progress-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.course-progress-text {
    font-size: 0.7em;
    font-weight: 600;
    color: #94a3b8;
    min-width: 28px;
    text-align: right;
}

.dark-theme .course-progress-text {
    color: #64748b;
}

/* Крестик сброса прогресса (CSS-рисованный, одинаковый на всех платформах) */
.course-progress-reset {
    background: none;
    border: none;
    cursor: pointer;
    width: 14px;
    height: 14px;
    padding: 10px;
    margin: -10px -10px -10px -4px;
    position: relative;
    z-index: 5;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.course-progress-reset::before,
.course-progress-reset::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1.5px;
    background: #94a3b8;
    border-radius: 1px;
}

.course-progress-reset::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.course-progress-reset::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.course-progress-reset:active,
.course-progress-reset:hover {
    opacity: 1;
}

.course-progress-reset:active::before,
.course-progress-reset:active::after,
.course-progress-reset:hover::before,
.course-progress-reset:hover::after {
    background: #ef4444;
}

.dark-theme .course-progress-reset::before,
.dark-theme .course-progress-reset::after {
    background: #64748b;
}

.dark-theme .course-progress-reset:active::before,
.dark-theme .course-progress-reset:active::after,
.dark-theme .course-progress-reset:hover::before,
.dark-theme .course-progress-reset:hover::after {
    background: #f87171;
}

/* ========== МОДАЛКА СБРОСА ПРОГРЕССА ========== */
.reset-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.reset-confirm-modal {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.25s ease;
}

.dark-theme .reset-confirm-modal {
    background: #1e1e2e;
}

.reset-confirm-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1e293b;
}

.dark-theme .reset-confirm-title {
    color: #e2e8f0;
}

.reset-confirm-text {
    font-size: 0.9em;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}

.dark-theme .reset-confirm-text {
    color: #94a3b8;
}

.reset-confirm-buttons {
    display: flex;
    gap: 10px;
}

.reset-confirm-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.reset-confirm-btn:active {
    opacity: 0.7;
}

.reset-confirm-cancel {
    background: #f1f5f9;
    color: #475569;
}

.dark-theme .reset-confirm-cancel {
    background: #2a2a3e;
    color: #94a3b8;
}

.reset-confirm-destructive {
    background: #ef4444;
    color: #fff;
}

/* ========== СТРЕЛКА НАВИГАЦИИ ========== */
.courses-page .course-item-arrow {
    font-size: 1.3em;
    transition: all 0.2s ease;
    position: relative;
    z-index: 3; /* Выше градиентной рамки */
    color: #3b82f6;
}

.courses-page .course-item:hover .course-item-arrow {
    transform: translateX(5px);
}

/* ========== АНИМАЦИЯ ПОЯВЛЕНИЯ ========== */
.courses-page .course-item {
    animation: slideInFromBottom 0.3s ease forwards;
}

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

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 480px) {
    .courses-page .course-item {
        padding: 18px;
        gap: 15px;
    }
    
    .courses-page .course-item-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
        border-radius: 14px;
    }
    
    .courses-page .course-item-title {
        font-size: 1em;
    }
    
    .courses-page .course-item-subtitle {
        font-size: 0.8em;
    }
}

@media (max-width: 320px) {
    .courses-page .course-item {
        padding: 16px;
        gap: 12px;
        border-radius: 16px;
    }
    
    .courses-page .course-item-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
        border-radius: 12px;
    }
    
    .courses-page .course-item-title {
        font-size: 0.95em;
    }
    
    .courses-page .course-item-subtitle {
        font-size: 0.75em;
    }
    
    .courses-page .course-item-arrow {
        font-size: 1.1em;
    }
}

/* ========== ПУСТОЙ БЛОК КУРСОВ ========== */
.empty-courses-block {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.6;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.08);
}

.dark-theme .empty-courses-block {
    background: rgba(30, 30, 46, 0.85);
    color: #b3b3cc;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.15);
}

.empty-courses-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 .empty-courses-block::before {
    opacity: 0.7;
}

.empty-courses-block-icon {
    font-size: 2em;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.empty-courses-block-title {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #1e293b;
    position: relative;
    z-index: 1;
}

.dark-theme .empty-courses-block-title {
    color: #ffffff;
}

.empty-courses-block-subtitle {
    margin: 0;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

/* ========== БЕЙДЖ КУРСА ========== */
.course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 600;
    z-index: 5;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .course-badge { font-size: 0.7em; padding: 3.3px 6.6px; top: 10px; right: 10px; }
}

@media (max-width: 480px) {
    .course-badge { font-size: 0.65em; padding: 2.6px 5.3px; top: 8px; right: 8px; border-radius: 6px; }
}

@media (max-width: 320px) {
    .course-badge { font-size: 0.6em; padding: 2px 4px; top: 6px; right: 6px; }
}
