@font-face {
    font-family: 'Anjoman';
    src: url('../fonts/woff2/AnjomanMaxFN-Regular.woff2') format('woff2'),
         url('../fonts/woff/AnjomanMaxFN-Regular.woff') format('woff'),
         url('../fonts/TTF/AnjomanMaxFN-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Anjoman';
    src: url('../fonts/woff2/AnjomanMaxFN-Bold.woff2') format('woff2'),
         url('../fonts/woff/AnjomanMaxFN-Bold.woff') format('woff'),
         url('../fonts/TTF/AnjomanMaxFN-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Anjoman';
    src: url('../fonts/woff2/AnjomanMaxFN-Light.woff2') format('woff2'),
         url('../fonts/woff/AnjomanMaxFN-Light.woff') format('woff'),
         url('../fonts/TTF/AnjomanMaxFN-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --accent-primary: #d6ad60;
    --accent-secondary: #8f6b00;
    --border-color: #e0e0e0;
    --gradient-primary: linear-gradient(315deg, #d6ad60 0%, #8f6b00 100%);
    --player-active-bg: rgba(214, 173, 96, 0.08);
    --player-hover-bg: rgba(0, 0, 0, 0.02);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #1a1d23;
    --bg-secondary: #23272f;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --border-color: #3f3f46;
    --player-active-bg: rgba(214, 173, 96, 0.12);
    --player-hover-bg: rgba(255, 255, 255, 0.02);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Anjoman', 'Tahoma', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.brand-badge {
    color: var(--accent-primary);
    padding: 0;
    font-size: 1.4rem;
    font-weight: bold;
    margin-right: 12px;
    letter-spacing: 0.5px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin-bottom: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 4px;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.hero {
    text-align: center;
    padding: 4rem 2rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #d6ad60, #8f6b00, #d6ad60, #8f6b00);
    text-shadow: 0px 0px 5px rgb(0 0 0 / 10%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

.academy-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 12px;
    min-width: 140px;
    box-shadow: var(--card-shadow);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.course-buttons-container {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 1rem;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    direction: rtl;
    width: 100%;
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: #ffffff !important; 
    border: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(214, 173, 96, 0.2);
    cursor: pointer;
    white-space: nowrap;
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(214, 173, 96, 0.4);
    filter: brightness(1.05);
}

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

@media (max-width: 768px) {
    .course-buttons-container {
        gap: 0.5rem;
        margin-top: 2rem;
    }
    .btn-gold {
        padding: 0.55rem 1rem;
        font-size: 0.8rem;
    }
}

.courses-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.course-section {
    margin-bottom: 5rem;
    scroll-margin-top: 100px;
}

.course-header {
    margin-bottom: 1.5rem;
    border-right: 4px solid var(--accent-primary);
    padding-right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.course-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
}

.course-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.player-container {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    height: 500px;
}

.video-viewport {
    flex: 1.8;
    position: relative;
    background: #000000;
    height: 100%;
}

.video-viewport iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.playlist-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.playlist-header {
    padding: 1.25rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-count-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.playlist-lessons-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.playlist-items {
    overflow-y: auto;
    flex: 1;
}

.playlist-items::-webkit-scrollbar {
    width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-align: right;
    gap: 0.75rem;
}

.playlist-item:hover {
    background: var(--player-hover-bg);
}

.playlist-item.active {
    background: var(--player-active-bg);
    border-right: 4px solid var(--accent-primary);
    padding-right: calc(1.25rem - 4px);
}

.lesson-number {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 24px;
}

.playlist-item.active .lesson-number {
    color: var(--accent-primary);
}

.lesson-info {
    flex: 1;
}

.lesson-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.playlist-item.active .lesson-title {
    font-weight: bold;
}

.lesson-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
    direction: ltr;
    display: inline-block;
}

.play-indicator {
    color: var(--accent-primary);
    font-size: 0.9rem;
    display: none;
    animation: pulse 1.5s infinite;
}

.playlist-item.active .play-indicator {
    display: block;
}

footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    direction: rtl;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.copyright b {
    color: var(--text-primary);
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem; 
    background: var(--gradient-primary);
    color: #1a1d23;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(214, 173, 96, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(214, 173, 96, 0.6);
}

@media (max-width: 992px) {
    .player-container {
        height: auto;
        flex-direction: column;
    }

    .video-viewport {
        width: 100%;
        aspect-ratio: 16 / 9;
        flex: none;
        height: auto;
    }

    .playlist-panel {
        width: 100%;
        height: 300px;
        flex: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    .nav-left {
        width: 100%;
        justify-content: center;
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero {
        padding: 3rem 1rem 1rem 1rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .courses-wrapper {
        padding: 1rem;
    }

    .course-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .course-title {
        font-size: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}