@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700;800&display=swap');

:root {
    --gradient-1: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    --gradient-2: linear-gradient(135deg, #c5a059 0%, #8e6d31 100%);
    --gradient-3: linear-gradient(135deg, #2c2c2c 0%, #111111 100%);
    --gradient-accent: linear-gradient(135deg, #d4af37 0%, #f9e29d 100%);
    
    --primary: #c5a059;
    --primary-light: #e2c285;
    --secondary: #8e6d31;
    --accent: #d4af37;
    
    --bg-main: #050505;
    --bg-secondary: #0f0f0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #555555;
    
    --success: #889e81;
    --error: #a35d5d;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 40px rgba(197, 160, 89, 0.3);
    
    --border-radius: 24px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(197, 160, 89, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(197, 160, 89, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(197, 160, 89, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -300px;
    right: -300px;
    pointer-events: none;
    z-index: 0;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 50px) scale(1.1); }
}

::selection {
    background: var(--primary);
    color: white;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-left: 1px solid rgba(197, 160, 89, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
}

/* ============ LOGIN PAGE ============ */

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: var(--border-radius);
    padding: 50px;
    width: 100%;
    max-width: 480px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
        0 0 60px rgba(197, 160, 89, 0.15);
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -1px;
    filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.3));
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(197, 160, 89, 0.5)); }
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.6s ease;
}

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

.auth-form h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 20px rgba(197, 160, 89, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--gradient-2);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition);
    box-shadow: 
        0 8px 30px rgba(197, 160, 89, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 40px rgba(197, 160, 89, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.15);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.form-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
}

.error-message,
.success-message {
    display: none;
    padding: 14px;
    border-radius: 14px;
    margin-top: 20px;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message {
    background: rgba(163, 93, 93, 0.2);
    color: #ff8a8a;
    border: 1px solid var(--error);
    box-shadow: 0 4px 20px rgba(163, 93, 93, 0.3);
}

.success-message {
    background: rgba(136, 158, 129, 0.2);
    color: #b8e994;
    border: 1px solid var(--success);
    box-shadow: 0 4px 20px rgba(136, 158, 129, 0.3);
}

/* ============ DASHBOARD ============ */

.dashboard {
    background: var(--bg-main);
}

.header {
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo {
    font-size: 1.8rem;
    margin-bottom: 0;
    animation: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu span {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout,
.btn-back {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(163, 93, 93, 0.3);
    border-color: var(--error);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(163, 93, 93, 0.4);
}

.btn-back:hover {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(197, 160, 89, 0.3);
}

/* ============ COURSES PAGE ============ */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 30px;
    position: relative;
    z-index: 1;
}

.welcome-section {
    margin-bottom: 50px;
    animation: slideUp 0.8s ease-out;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.3));
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 300px));
    gap: 30px;
    justify-content: flex-start;
}

.course-card {
    background: transparent;
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid rgba(197, 160, 89, 0.3);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(197, 160, 89, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    animation: slideUp 0.8s ease-out backwards;
    width: 300px;
    height: 533px;
    display: flex;
    flex-direction: column;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    z-index: 10;
}

.course-card:hover::before {
    transform: scaleX(1);
}

.course-card:hover {
    transform: translateY(-12px);
    border-color: #c5a059;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(197, 160, 89, 0.4),
        inset 0 1px 0 0 rgba(197, 160, 89, 0.3);
}

.course-card:nth-child(1) { animation-delay: 0.1s; }
.course-card:nth-child(2) { animation-delay: 0.2s; }
.course-card:nth-child(3) { animation-delay: 0.3s; }
.course-card:nth-child(4) { animation-delay: 0.4s; }
.course-card:nth-child(5) { animation-delay: 0.5s; }
.course-card:nth-child(6) { animation-delay: 0.6s; }

.course-thumbnail {
    flex: 1;
    width: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.course-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.course-thumbnail::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
    pointer-events: none;
}

.course-thumbnail i {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.6;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.6));
}

.course-card:hover .course-thumbnail i {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.8;
}

.course-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: center;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
}

.course-info h3 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
    transition: var(--transition);
    margin: 0;
}

.course-card:hover .course-info h3 {
    transform: scale(1.05);
    color: var(--primary-light);
    text-shadow: 0 4px 30px rgba(197, 160, 89, 0.6);
}

.course-info p {
    display: none !important;
}

.course-meta {
    display: none !important;
}

.btn-course {
    display: none !important;
}

/* ============ LESSONS PAGE ============ */

.lessons-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - 81px);
}

.lessons-sidebar {
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(30px) saturate(180%);
    border-right: 1px solid rgba(197, 160, 89, 0.1);
    overflow-y: auto;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    padding: 30px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(197, 160, 89, 0.3));
}

.lessons-list {
    padding: 20px;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.lesson-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--gradient-accent);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.lesson-item:hover::before {
    transform: scaleY(1);
}

.lesson-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px);
    border-color: rgba(197, 160, 89, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lesson-item.active {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--primary);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(197, 160, 89, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.lesson-item.active::before {
    transform: scaleY(1);
}

.lesson-number {
    width: 48px;
    height: 48px;
    background: rgba(197, 160, 89, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.lesson-item:hover .lesson-number {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.4);
}

.lesson-item.active .lesson-number {
    background: var(--gradient-2);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 25px rgba(197, 160, 89, 0.6);
}

.lesson-details h4 {
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.lesson-item:hover .lesson-details h4 {
    color: var(--primary-light);
}

.lesson-details span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.video-container {
    padding: 40px;
    background: var(--bg-main);
    overflow-y: auto;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(197, 160, 89, 0.2);
    margin-bottom: 30px;
    border: 1px solid rgba(197, 160, 89, 0.2);
    position: relative;
}

.video-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    padding: 2px;
    background: var(--gradient-accent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    pointer-events: none;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    animation: fadeIn 0.8s ease;
}

.video-info h3 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(197, 160, 89, 0.2);
}

.video-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

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

@media (max-width: 1024px) {
    .lessons-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .lessons-sidebar {
        height: 400px;
        border-right: none;
        border-bottom: 1px solid rgba(197, 160, 89, 0.1);
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 40px 30px;
    }

    .header-content {
        padding: 0 20px;
    }

    .user-menu span {
        display: none;
    }

    .btn-logout,
    .btn-back {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 280px));
    }

    .course-card {
        width: 280px;
        height: 497px;
    }

    .course-info h3 {
        font-size: 1.5rem;
    }

    .video-container {
        padding: 20px;
    }

    .video-info h3 {
        font-size: 1.8rem;
    }

    .lessons-sidebar {
        height: 300px;
    }

    .sidebar-header {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 35px 25px;
    }

    .logo {
        font-size: 2.2rem !important;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .course-card {
        width: 100%;
        max-width: 300px;
        height: auto;
        aspect-ratio: 9 / 16;
        margin: 0 auto;
    }
}