/* ============================================
   AIT ENGLISH - ОСНОВНОЙ ФАЙЛ СТИЛЕЙ
   ============================================ */

/* ---------- СБРОС СТИЛЕЙ ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- ПЕРЕМЕННЫЕ ---------- */
:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --success: #27ae60;
    --success-dark: #219a52;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --warning: #f39c12;
    --light: #f5f5f5;
    --white: #ffffff;
    --dark: #333333;
    --gray: #666666;
    --border: #dddddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- БАЗОВЫЕ СТИЛИ ---------- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ---------- АНИМАЦИИ ---------- */
@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInCards {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

main {
    animation: fadeInPage 0.4s ease-out;
    flex: 1;
}

/* ---------- HEADER ---------- */
header {
    background-color: var(--secondary);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    color: var(--primary);
}

/* ---------- БУРГЕР-МЕНЮ ---------- */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: var(--transition);
}

.burger-menu.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ---------- НАВИГАЦИЯ ---------- */
.nav-menu {
    transition: var(--transition);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.nav-list a:hover {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- ИНДИКАТОР СЕРИИ (STREAK) ---------- */
.streak-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(243, 156, 18, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: var(--warning);
    margin-right: 10px;
}

.streak-count {
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

/* ---------- УВЕДОМЛЕНИЯ ---------- */
.notifications-widget {
    position: relative;
    display: inline-block;
}

.notifications-bell {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    padding: 5px;
    color: white;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.notifications-bell:hover {
    transform: scale(1.05);
}

.notifications-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
}

.notifications-dropdown.show {
    display: block;
    animation: popup-fade-in 0.2s ease;
}

.notifications-header {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--dark);
}

.notifications-header button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.notifications-header button:hover {
    text-decoration: underline;
}

.notifications-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e1f0fa;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 13px;
    color: var(--secondary);
}

.notification-message {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 3px;
}

.notification-time {
    font-size: 10px;
    color: #999;
}

/* ---------- ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ---------- */
.theme-switcher {
    display: inline-block;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: white;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* ---------- FOOTER ---------- */
footer {
    background-color: var(--secondary);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

footer p {
    margin: 5px 0;
    font-size: 13px;
    opacity: 0.8;
}

footer .small {
    font-size: 12px;
    opacity: 0.6;
}

/* ---------- КНОПКИ ---------- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: var(--success-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: var(--danger-dark);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ---------- ФОРМЫ ---------- */
.auth-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    animation: fadeInCards 0.4s ease;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    color: var(--gray);
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
}

/* ---------- АЛЕРТЫ ---------- */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: fadeInCards 0.3s ease;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ---------- HERO СЕКЦИЯ ---------- */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 20px;
    margin: 2rem 0;
    animation: fadeInCards 0.5s ease;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- КАРТОЧКИ КУРСОВ ---------- */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.course-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid #e9ecef;
    animation: fadeInCards 0.4s ease;
    animation-fill-mode: both;
}

.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-card:nth-child(2) { animation-delay: 0.1s; }
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-card:nth-child(4) { animation-delay: 0.2s; }
.course-card:nth-child(5) { animation-delay: 0.25s; }
.course-card:nth-child(6) { animation-delay: 0.3s; }

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.course-card:hover::before {
    transform: scaleX(1);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.course-badge {
    position: absolute;
    top: 15px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition);
}

.course-card:hover .course-badge {
    transform: scale(1.05);
}

.course-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: var(--secondary);
    padding-right: 50px;
}

.course-card p {
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Прогресс курса */
.course-progress {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: var(--transition);
}

.course-card:hover .course-progress {
    background: #e8f4fd;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--secondary);
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-stats {
    font-size: 11px;
    color: #888;
    text-align: right;
    margin-top: 6px;
}

/* ---------- СПИСОК УРОКОВ ---------- */
.lessons-list {
    margin: 20px 0;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: fadeInCards 0.3s ease;
}

.lesson-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-hover);
}

.lesson-number {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.lesson-item.completed .lesson-number {
    background: var(--success);
}

.lesson-info {
    flex: 1;
}

.lesson-info h3 {
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lesson-status-icon {
    font-size: 18px;
    transition: var(--transition);
}

.lesson-item:hover .lesson-status-icon {
    transform: scale(1.1);
}

.lesson-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.lesson-status-text {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.lesson-status-text.completed {
    background: #d4edda;
    color: #155724;
}

.lesson-status-text.pending {
    background: #fff3cd;
    color: #856404;
}

/* ---------- СТАТИСТИКА ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    font-size: 40px;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-info h3 {
    margin: 0;
    font-size: 13px;
    color: var(--gray);
}

.stat-info p {
    margin: 5px 0 0;
    font-size: 28px;
    font-weight: bold;
    color: var(--secondary);
}

/* ---------- ГРАФИКИ ---------- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.chart-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary);
}

.chart-period {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.period-btn {
    padding: 5px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.period-btn:hover {
    background: var(--primary);
    color: white;
}

.period-btn.active {
    background: var(--primary);
    color: white;
}

/* ---------- ТАБЛИЦЫ ---------- */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* ---------- ПАГИНАЦИЯ ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---------- СТРАНИЦА ПРОФИЛЯ ---------- */
.profile-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
}

.profile-info {
    flex: 1;
}

.profile-info h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

.profile-badges {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.role-admin { background: var(--danger); color: white; }
.role-teacher { background: var(--warning); color: white; }
.role-student { background: var(--primary); color: white; }

/* ---------- ДОСТИЖЕНИЯ ---------- */
.achievements-section {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.achievement-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: var(--transition);
}

.achievement-card:hover {
    transform: translateY(-5px);
    background: #e8f4fd;
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 13px;
    font-weight: bold;
}

.achievement-date {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
}

/* ---------- ВРЕМЕННЫЕ СТИЛИ ДЛЯ ПРЕДПРОСМОТРА ---------- */
.preview-banner {
    background: var(--warning);
    color: white;
    text-align: center;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    font-weight: bold;
}

/* ============================================
   ТЁМНАЯ ТЕМА
   ============================================ */

body.dark-theme {
    background: #121212;
    color: #e0e0e0;
}

body.dark-theme .header {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
}

body.dark-theme .logo {
    color: var(--primary);
}

body.dark-theme .nav-menu {
    background: #1e1e1e;
}

body.dark-theme .hero {
    background: linear-gradient(135deg, #1e3a5f, #1a1a2e);
}

body.dark-theme .course-card,
body.dark-theme .stat-card,
body.dark-theme .chart-card,
body.dark-theme .achievements-section,
body.dark-theme .result-card,
body.dark-theme .detailed-results,
body.dark-theme .profile-header {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-theme .course-card h3,
body.dark-theme .stat-info p,
body.dark-theme .profile-info h1 {
    color: #e0e0e0;
}

body.dark-theme .course-card p {
    color: #aaa;
}

body.dark-theme .course-progress {
    background: #2d2d2d;
}

body.dark-theme .table th {
    background: #2d2d2d;
    color: #e0e0e0;
    border-bottom-color: #444;
}

body.dark-theme .table td {
    border-bottom-color: #333;
}

body.dark-theme .table tbody tr:hover {
    background: #2d2d2d;
}

body.dark-theme .page-link {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .page-link:hover {
    background: var(--primary);
    border-color: var(--primary);
}

body.dark-theme .auth-form {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-theme .form-control {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-theme .form-control:focus {
    border-color: var(--primary);
}

body.dark-theme .alert-success {
    background: #1e3a2a;
    color: #a3e4b3;
    border-color: #2ecc71;
}

body.dark-theme .alert-error {
    background: #3d1e1e;
    color: #f5b7b1;
    border-color: #e74c3c;
}

body.dark-theme .notifications-dropdown {
    background: #1e1e1e;
    border-color: #444;
}

body.dark-theme .notifications-header {
    border-bottom-color: #444;
}

body.dark-theme .notifications-header h3 {
    color: #e0e0e0;
}

body.dark-theme .notification-item {
    border-bottom-color: #333;
}

body.dark-theme .notification-item:hover {
    background: #2d2d2d;
}

body.dark-theme .notification-item.unread {
    background: #1e3a5f;
}

body.dark-theme .streak-indicator {
    background: rgba(243, 156, 18, 0.3);
}

body.dark-theme .footer-links a {
    color: #e0e0e0;
}

body.dark-theme .badge.role-admin,
body.dark-theme .badge.role-teacher,
body.dark-theme .badge.role-student {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .lesson-item {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-theme .lesson-status-text.completed {
    background: #1e3a2a;
    color: #a3e4b3;
}

body.dark-theme .lesson-status-text.pending {
    background: #3d2e1e;
    color: #ffc107;
}

body.dark-theme .period-btn {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .period-btn:hover,
body.dark-theme .period-btn.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 992px) {
    .burger-menu {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 60px);
        background: var(--secondary);
        padding: 20px;
        transition: left 0.3s ease;
        z-index: 99;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .nav-list li {
        width: 100%;
    }
    
    .nav-list a {
        display: block;
        padding: 10px 0;
        width: 100%;
    }
    
    .header-right {
        margin-left: auto;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .lesson-item {
        flex-direction: column;
        text-align: center;
    }
    
    .lesson-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .table th, .table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .notifications-dropdown {
        width: 280px;
        right: -50px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .nav-menu {
        width: 85%;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .streak-indicator {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============================================
   УТИЛИТЫ
   ============================================ */

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 60px;
    background: #f8f9fa;
    border-radius: 16px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}

/* ============================================
   ФОРСИРОВАННЫЕ СТИЛИ ДЛЯ ПОПАПА СЛОВАРЯ
   ============================================ */

.word-popup {
    position: fixed !important;
    z-index: 999999 !important;
    width: 320px !important;
    max-width: 90vw !important;
    min-width: 260px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3) !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    visibility: visible !important;
    display: none;
}

.word-popup .popup-header {
    background: #f8f9fa !important;
    padding: 12px 15px !important;
    border-bottom: 1px solid #eee !important;
    border-radius: 12px 12px 0 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.word-popup .popup-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.word-popup #popup-word {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

.word-popup .pronounce-btn {
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
}

.word-popup .pronounce-btn:hover {
    background: #e9ecef !important;
}

.word-popup .popup-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    color: #999 !important;
    line-height: 1 !important;
    padding: 0 4px !important;
}

.word-popup .popup-close:hover {
    color: #333 !important;
}

.word-popup #popup-meanings {
    padding: 15px !important;
    max-height: 350px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
}

.word-popup .meaning-card {
    background: #f8f9fa !important;
    border-radius: 8px !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    border-left: 3px solid #3498db !important;
}

.word-popup .translation {
    font-size: 16px !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    color: #2c3e50 !important;
}

.word-popup .part-of-speech {
    font-size: 12px !important;
    color: #666 !important;
    margin-bottom: 4px !important;
    text-transform: lowercase !important;
}

.word-popup .transcription {
    font-size: 13px !important;
    color: #888 !important;
    font-family: monospace !important;
}

.word-popup .audio-btn {
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    margin-top: 5px !important;
}

.word-popup .audio-btn:hover {
    background: #e9ecef !important;
}

.word-popup .popup-footer {
    background: #f8f9fa !important;
    padding: 12px 15px !important;
    border-top: 1px solid #eee !important;
    border-radius: 0 0 12px 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.word-popup .add-to-vocab-btn {
    background: #3498db !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

.word-popup .add-to-vocab-btn:hover {
    background: #2980b9 !important;
}

.word-popup .source-info {
    font-size: 11px !important;
    color: #999 !important;
}

/* Тёмная тема для попапа */
body.dark-theme .word-popup {
    background: #1e1e1e !important;
    background-color: #1e1e1e !important;
    border-color: #444 !important;
}

body.dark-theme .word-popup .popup-header,
body.dark-theme .word-popup .popup-footer {
    background: #2d2d2d !important;
    border-color: #444 !important;
}

body.dark-theme .word-popup #popup-meanings {
    background: #1e1e1e !important;
}

body.dark-theme .word-popup .meaning-card {
    background: #2d2d2d !important;
    border-left-color: #3498db !important;
}

body.dark-theme .word-popup .translation {
    color: #e0e0e0 !important;
}

body.dark-theme .word-popup .part-of-speech {
    color: #aaa !important;
}

body.dark-theme .word-popup .popup-close {
    color: #aaa !important;
}

body.dark-theme .word-popup .popup-close:hover {
    color: #fff !important;
}

body.dark-theme .word-popup .audio-btn:hover {
    background: #3d3d3d !important;
}

/* Кнопка "Проверить уровень" */
.btn-info {
    background: #17a2b8;
    color: white;
}
.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}
body.dark-theme .btn-info {
    background: #0d6efd;
}
body.dark-theme .btn-info:hover {
    background: #0b5ed7;
}