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

/* Professional Design System Variables */
:root {
    /* Premium Dark Theme (Default) */
    --bg-base: #05070c;
    --bg-surface: rgba(10, 14, 26, 0.65);
    --bg-card: rgba(16, 21, 38, 0.4);
    --bg-card-hover: rgba(22, 29, 53, 0.65);
    --bg-input: #0b0e1a;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(99, 102, 241, 0.4); /* Indigo */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --accent: #6366f1; /* Indigo */
    --accent-rgb: 99, 102, 241;
    --accent-secondary: #a855f7; /* Violet */
    --accent-secondary-rgb: 168, 85, 247;
    
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    --success: #10b981;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-card: rgba(241, 245, 249, 0.7);
    --bg-card-hover: #ffffff;
    --bg-input: #f1f5f9;
    --border-color: rgba(15, 23, 42, 0.05);
    --border-hover: rgba(99, 102, 241, 0.5);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.08);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Ambient Radial Background Glows */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.ambient-glow-1 {
    position: absolute;
    width: 800px;
    height: 800px;
    top: -300px;
    right: -100px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}
.ambient-glow-2 {
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(var(--accent-secondary-rgb), 0.04) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}

/* Container */
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation Header */
.header-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: padding 0.3s ease, border-color 0.3s ease;
}
.header-nav.scrolled {
    border-color: rgba(99, 102, 241, 0.1);
}
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}
.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.social-links {
    display: flex;
    gap: 0.5rem;
}
.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* Hover effects restricted to devices that support pointer hovers */
@media (hover: hover) {
    .btn-icon:hover {
        color: var(--accent);
        border-color: var(--accent);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.15);
    }
}
.btn-icon:active {
    transform: scale(0.95);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 5rem 0 3.5rem 0;
    text-align: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.hero-badge i {
    font-size: 0.65rem;
    color: var(--accent);
    animation: badgePulse 2.5s infinite ease-in-out;
    display: inline-block;
    will-change: transform, opacity, filter;
}
@keyframes badgePulse {
    0% {
        transform: scale(0.9);
        filter: drop-shadow(0 0 0px var(--accent));
        opacity: 0.7;
    }
    50% {
        transform: scale(1.25);
        filter: drop-shadow(0 0 8px var(--accent));
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        filter: drop-shadow(0 0 0px var(--accent));
        opacity: 0.7;
    }
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 6vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}
.hero-title span {
    background: linear-gradient(to right, var(--accent), var(--accent-secondary), var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradientFlow 6s linear infinite;
    will-change: background-position;
}
@keyframes textGradientFlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}
.hero-description {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

/* Stats Pill Cards */
.hero-stats {
    display: none;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 0 auto;
    max-width: 600px;
}
.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}
@media (hover: hover) {
    .stat-item:hover {
        border-color: rgba(var(--accent-rgb), 0.2);
        box-shadow: var(--shadow-glow);
    }
}
.stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-top: 0.1rem;
}

/* Search and Filters Toolbar */
.toolbar {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 768px) {
    .toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.search-wrapper {
    position: relative;
    width: 100%;
}
@media (min-width: 768px) {
    .search-wrapper {
        width: 320px;
    }
}
.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.1);
}
.categories {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
}
.categories::-webkit-scrollbar {
    display: none;
}
.category-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}
@media (hover: hover) {
    .category-btn:hover {
        border-color: var(--text-secondary);
        color: var(--text-primary);
    }
}
.category-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(var(--accent-rgb), 0.3);
}

/* Video Grid and Card Redesign */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}
.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
}
@media (hover: hover) {
    .video-card:hover {
        background: var(--bg-card-hover);
        transform: translateY(-4px);
        border-color: var(--border-hover);
        box-shadow: var(--shadow-md), var(--shadow-glow);
    }
}
.thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #030712;
    overflow: hidden;
}
.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
@media (hover: hover) {
    .video-card:hover .thumbnail-img {
        transform: scale(1.03);
    }
}
.duration-tag {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
}
@media (hover: hover) {
    .video-card:hover .play-overlay {
        opacity: 1;
    }
}
.play-btn-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: var(--transition-fast);
}
@media (hover: hover) {
    .video-card:hover .play-btn-circle {
        transform: scale(1);
    }
}
.video-info {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.video-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.video-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Watch Video & Admin Settings Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
[data-theme="light"] .modal-container {
    background: #ffffff;
}
.modal.active .modal-container {
    transform: scale(1);
}

/* Modals Mobile Bottom Sheet Behavior */
@media (max-width: 640px) {
    .modal {
        align-items: flex-end;
    }
    .modal-container {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
        border-bottom: none;
        max-height: 85vh;
    }
    .modal.active .modal-container {
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
}
.modal-close:active {
    transform: scale(0.95);
}

.video-player-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}
.video-player-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
.modal-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}
.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
    transition: var(--transition-fast);
}
@media (hover: hover) {
    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.35);
    }
}
.btn-primary:active {
    transform: scale(0.98);
}

/* Floating Action Settings Button */
.btn-settings {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
    cursor: pointer;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: var(--transition-smooth);
}
@media (hover: hover) {
    .btn-settings:hover {
        transform: rotate(45deg) scale(1.05);
    }
}

/* Form Styles */
.admin-scroll-box {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.form-group {
    margin-bottom: 1rem;
}
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
.curated-list-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}
.curated-list-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.curated-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.curated-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.curated-item-info {
    display: flex;
    flex-direction: column;
}
.curated-item-title {
    font-size: 0.85rem;
    font-weight: 500;
}
.curated-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.btn-danger-sm {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-fast);
}
.btn-danger-sm:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

/* Footer styling */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    text-align: center;
}
.footer-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.footer-socials {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 0;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}
.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(var(--accent-rgb), 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}
.empty-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
