* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

/* Навигационная кнопка */
.nav-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    font-size: 24px;
}

.nav-toggle:hover {
    background: #357abd;
}

/* Боковое меню */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.hidden {
    left: -300px;
}

.sidebar-header {
    padding: 20px 20px 20px 60px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    font-size: 18px;
    color: #4a90e2;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.course-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.course-item:hover {
    background: #f8f9fa;
}

.course-item.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.course-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.course-item-text {
    flex: 1;
    min-width: 0;
    color: #333;
}

.course-item.locked::after {
    content: '🔒';
    margin-left: auto;
}

/* Основной контент */
.main-content {
    margin-left: 300px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    padding: 20px;
    padding-top: 80px;
}

.sidebar.active ~ .main-content {
    margin-left: 300px;
}

/* Шапка */
.header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 999;
    display: flex;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-auth {
    padding: 8px 16px;
    border: 1px solid #4a90e2;
    background: white;
    color: #4a90e2;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-auth:hover {
    background: #4a90e2;
    color: white;
}

/* Стиль для кнопки "УРОК ОНЛАЙН" */
.btn-auth[href="lesson-online.html"],
a.btn-auth[href*="lesson-online"] {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745;
}

.btn-auth[href="lesson-online.html"]:hover,
a.btn-auth[href*="lesson-online"]:hover {
    background: #218838 !important;
    color: white !important;
    border-color: #218838;
}

/* Страница курсов */
.courses-page {
    max-width: 1200px;
    margin: 0 auto;
}

.courses-page h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

/* Центральный блок Пробный урок */
.trial-lesson-central {
    max-width: 900px;
    margin: 40px auto;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 16px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 3px solid #4caf50;
    position: relative;
    overflow: hidden;
}

.trial-lesson-central::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.trial-lesson-central h2 {
    font-size: 36px;
    color: #1b5e20;
    margin-bottom: 20px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.trial-description {
    font-size: 18px;
    color: #2e7d32;
    margin-bottom: 30px;
    line-height: 1.8;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.next-lesson-hint {
    margin-top: 25px;
    font-size: 16px;
    color: #1b5e20;
    font-weight: 700;
    opacity: 1;
    position: relative;
    z-index: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 2px solid #4caf50;
    display: inline-block;
}

.lesson-item .next-lesson-hint {
    margin-top: 12px;
    font-size: 15px;
    color: #2e7d32;
    font-weight: 600;
    opacity: 1;
    padding: 8px 15px;
    background: #e8f5e9;
    border-radius: 6px;
    border-left: 3px solid #4caf50;
}

.lesson-item.free .next-lesson-hint {
    color: #1b5e20;
    background: #e8f5e9;
}

.trial-link-btn {
    display: inline-block;
    padding: 16px 40px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

.trial-link-btn:hover {
    background: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

@media (max-width: 768px) {
    .trial-lesson-central {
        padding: 30px 20px;
        margin: 30px auto;
    }
    
    .trial-lesson-central h2 {
        font-size: 28px;
    }
    
    .trial-description {
        font-size: 16px;
    }
    
    .trial-link-btn {
        padding: 14px 30px;
        font-size: 16px;
    }
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Список уроков под пробным уроком */
.lessons-list {
    max-width: 900px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lesson-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #ddd;
    transition: all 0.2s;
}

.lesson-item.free {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    border-left-color: #4caf50;
}

.lesson-item.locked {
    opacity: 0.7;
    background: #f9f9f9;
}

.lesson-item:not(.locked):hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lesson-item-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.lesson-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.lesson-item.free .lesson-title {
    color: #1b5e20;
}

.lock-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.lesson-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.lesson-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    align-self: flex-start;
}

.lesson-status.free {
    background: #c8e6c9;
    color: #2e7d32;
}

.lesson-status.locked {
    background: #e0e0e0;
    color: #757575;
}

@media (max-width: 768px) {
    .lessons-list {
        margin: 30px 10px;
    }
    
    .lesson-item {
        padding: 15px;
    }
    
    .lesson-title {
        font-size: 16px;
    }
}

.course-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.course-card:hover:not(.locked) {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.course-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.course-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
}

.course-number {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.course-title,
.course-title-link {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    display: block;
    text-decoration: none;
    transition: color 0.2s;
}

.course-title-link {
    cursor: pointer;
}

.course-title-link:hover {
    color: #4a90e2;
    text-decoration: underline;
}

.course-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.course-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.course-status.free {
    background: #e8f5e9;
    color: #2e7d32;
}

.course-status.locked {
    background: #f5f5f5;
    color: #757575;
}

/* Видео блок (муляж) */
.video-placeholder {
    max-width: 800px;
    margin: 40px auto;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.3;
}

.video-play-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.2s;
}

.video-play-btn:hover {
    transform: scale(1.1);
}

.video-play-btn::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 28px solid #333;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    margin-left: 6px;
}

.video-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    z-index: 1;
    text-align: center;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: slideDown 0.3s;
}

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

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90e2;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #357abd;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        left: -280px;
        min-width: 280px;
    }
    
    .sidebar.active {
        left: 0;
        z-index: 1002;
    }
    
    .sidebar.active ~ .main-content {
        margin-left: 0;
    }
    
    .sidebar-header {
        padding: 15px 15px 15px 50px;
    }
    
    .sidebar-header h2 {
        font-size: 16px;
    }
    
    .course-item {
        padding: 12px 15px;
        font-size: 14px;
        white-space: normal;
        word-wrap: break-word;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .course-item-text {
        flex: 1;
        min-width: 0;
        color: #333;
        overflow: visible;
    }
    
    .course-item.locked::after {
        margin-left: 8px;
        flex-shrink: 0;
    }
    
    .main-content {
        padding: 20px 10px;
        padding-top: 100px;
        margin-left: 0;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-toggle {
        top: 70px;
        display: flex;
        z-index: 1003;
    }
    
    .header {
        padding: 10px;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn-auth {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .courses-page h1 {
        font-size: 24px;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .sidebar.active {
        left: 0;
        z-index: 1002;
    }
}
