/* ============================================
   PRIMEXIS — ULTIMATE UI (FULL)
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #1a1a2e;
    --bg-card-hover: #24243a;
    --bg-navbar: rgba(10, 10, 15, 0.92);
    --text-primary: #f0f0f5;
    --text-secondary: #9090b0;
    --text-muted: #6a6a8a;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(108, 92, 231, 0.3);
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 8px 40px rgba(108, 92, 231, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1280px;
}

body.light-theme {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f5;
    --bg-navbar: rgba(255, 255, 255, 0.92);
    --text-primary: #0a0a0f;
    --text-secondary: #4a4a6a;
    --text-muted: #8a8aaa;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 8px 40px rgba(108, 92, 231, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 70px;
    transition: var(--transition);
}
.navbar.scrolled {
    box-shadow: var(--shadow);
    height: 60px;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.brand .logo-icon {
    font-size: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 4px 0;
}
.nav-links a:hover {
    color: var(--text-primary);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
    border-radius: 2px;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}
.nav-links a.active {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.theme-toggle {
    font-size: 18px !important;
    padding: 4px 8px !important;
}
.theme-toggle::after {
    display: none !important;
}

/* --- HERO --- */
.hero-section {
    padding: 120px 20px 60px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.5;
}

.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 4px 16px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid var(--border-hover);
}

.hero-content h1 {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.08;
    margin-bottom: 16px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-secondary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border: 1px solid var(--border);
    cursor: pointer;
}
.btn-secondary:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}
.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}
.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-graphic {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.graphic-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed var(--accent);
    animation: spin 20s linear infinite;
}
.graphic-circle2 {
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: var(--accent-glow);
    animation: pulse 3s ease-in-out infinite;
}
.graphic-icon {
    position: relative;
    z-index: 2;
    font-size: 80px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* --- SECTION --- */
.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 32px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.section-title p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}

.section-badge {
    display: inline-block;
    padding: 2px 12px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.filters select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.filters select:hover {
    border-color: var(--accent);
}

/* --- BATCH GRID --- */
.batches-section {
    padding: 20px 0 60px;
}

.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.batch-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}
.batch-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: var(--transition);
}
.batch-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}
.batch-card:hover::before {
    opacity: 1;
}

.batch-card .badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.badge-free {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
}
.badge-paid {
    background: rgba(255, 159, 67, 0.15);
    color: #ff9f43;
}

.batch-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}
.batch-card .meta {
    font-size: 14px;
    color: var(--text-secondary);
}
.batch-card .meta span {
    margin-right: 16px;
}
.batch-card .footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.batch-card .footer .lectures {
    color: var(--accent);
    font-weight: 600;
}

/* --- LOADING --- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-container p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- PLAYER --- */
.player-main {
    padding: 90px 20px 40px;
}

.player-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.video-wrapper {
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
}
.video-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- PLAYER OVERLAY --- */
.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
    gap: 16px;
    transition: var(--transition);
}
.player-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.player-overlay .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(108, 92, 231, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.player-overlay p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* --- QUALITY SELECTOR --- */
.quality-selector {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: var(--transition);
}
.video-wrapper:hover .quality-selector {
    opacity: 1;
}
.quality-selector .q-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}
.quality-selector .q-btn:hover {
    color: #fff;
}
.quality-selector .q-btn.active {
    background: var(--accent);
    color: #fff;
}

/* --- VIDEO CONTROLS --- */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 11;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.video-wrapper:hover .video-controls,
.video-controls:focus-within {
    opacity: 1;
}
.video-wrapper:hover .quality-selector {
    opacity: 1;
}

.ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.time-display {
    color: #fff;
    font-size: 13px;
    font-family: monospace;
    min-width: 80px;
}
.seek-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.seek-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
}

.volume-bar {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.volume-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

/* --- SPEED MENU --- */
.speed-menu {
    position: absolute;
    bottom: 70px;
    right: 12px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: var(--radius-sm);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 15;
    backdrop-filter: blur(12px);
    min-width: 80px;
}
.speed-menu.open {
    display: flex;
}
.speed-menu button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}
.speed-menu button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.speed-menu button.active {
    background: var(--accent);
    color: #fff;
}

/* --- LECTURE INFO --- */
.lecture-info {
    margin: 20px 0 16px;
}
.lecture-info h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}
.lecture-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* --- TABS --- */
.player-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.tab-panel {
    display: none;
    min-height: 120px;
}
.tab-panel.active {
    display: block;
}

/* --- SLIDES --- */
.slides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.slide-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.slide-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.slide-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.slide-card .slide-info {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}
.slide-card .slide-info .time {
    color: var(--accent);
    font-weight: 600;
}

/* --- ATTACHMENTS --- */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.attachment-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
    transition: var(--transition);
    flex-wrap: wrap;
    gap: 10px;
}
.attachment-item:hover {
    border-color: var(--accent);
}
.attachment-item .name {
    font-weight: 500;
}
.attachment-item .actions {
    display: flex;
    gap: 10px;
}
.attachment-item .actions a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
    padding: 4px 12px;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.04);
}
.attachment-item .actions a:hover {
    color: var(--text-primary);
    background: var(--accent);
}

/* --- SEARCH --- */
.search-section {
    padding: 100px 20px 60px;
}
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.search-box input {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}
.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-box button {
    padding: 16px 32px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.search-box button:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.search-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}
.search-filters select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.search-filters select:hover {
    border-color: var(--accent);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- FOOTER --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    margin-top: 20px;
}
.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.footer-copy {
    color: var(--text-muted);
    font-size: 13px;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-stats {
        justify-content: center;
    }
    .hero-graphic {
        width: 200px;
        height: 200px;
    }
    .graphic-icon {
        font-size: 60px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-navbar);
        backdrop-filter: blur(20px);
        padding: 20px;
        border-bottom: 1px solid var(--border);
        gap: 16px;
    }
    .nav-links.open {
        display: flex;
    }
    .navbar.scrolled .nav-links {
        top: 60px;
    }

    .hero-content h1 {
        font-size: 32px;
    }
    .hero-section {
        padding: 80px 16px 40px;
    }
    .hero-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .batch-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    .filters {
        flex-direction: column;
    }

    .player-container {
        padding: 12px;
    }
    .lecture-info h2 {
        font-size: 18px;
    }
    .video-controls {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
    }
    .volume-bar {
        width: 40px;
    }
    .time-display {
        font-size: 11px;
        min-width: 60px;
    }
    .ctrl-btn {
        font-size: 15px;
        min-width: 28px;
        min-height: 28px;
    }
    .slides-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .quality-selector {
        top: 8px;
        right: 8px;
        padding: 4px 6px;
    }
    .quality-selector .q-btn {
        font-size: 10px;
        padding: 2px 6px;
    }

    .search-box {
        flex-direction: column;
    }
    .search-filters {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 26px;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
    }
    .stat-number {
        font-size: 24px;
    }
}
