@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --primary-color: #3b82f6;
    /* Educational Blue */
    --secondary-color: #1e3a8a;
    /* Dark Blue */
    --accent-color: #f59e0b;
    /* Amber/Orange */
    --dark-bg: #0f172a;
    /* Dark Slate */
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(59, 130, 246, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.9);
}

* {
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
}

html {
    background-color: #f8fafc;
    /* Slate 50 */
    scroll-behavior: smooth;
}

html.dark {
    background-color: #000000;
}

body {
    background-color: transparent;
    color: #374151;
    /* Dark Gray */
    overflow-x: hidden;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.dark .glass-card {
    background: rgba(10, 10, 10, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(59, 130, 246, 0.15);
}

.dark .glass-card:hover {
    box-shadow: 0 15px 50px rgba(255, 255, 255, 0.05);
}

/* Vanta Background - Visible in both modes */
#vanta-bg {
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

html.dark #vanta-bg {
    opacity: 0.4;
}



/* Hero Section */
.hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.dark .hero-bg {
    background: #000000;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    color: #1F2937;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.dark .hero-title {
    color: #FFFFFF;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #4B5563;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.dark .hero-subtitle {
    color: #E5E7EB;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--secondary-color);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Floating Elements Animation */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.05);
    backdrop-filter: blur(5px);
    animation: float 20s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
}

/* Navbar */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dark .navbar.scrolled {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled .nav-link {
    color: #1F2937;
}

.navbar.scrolled .logo-text {
    color: var(--primary-color);
}

/* Footer - Theme aware */
footer {
    transition: background-color 0.3s, color 0.3s;
}

/* Dark mode footer text */
html.dark footer p,
html.dark footer span,
html.dark footer a,
html.dark footer h4,
html.dark footer li {
    color: #ffffff !important;
}

/* Dark Mode Utilities for Glass Effect */
.dark .glass-effect {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Dark Mode Body Background */
.dark body,
body.dark {
    background-color: #000000;
    color: #ffffff;
}

/* Primary Gradients (Custom Class) */
.bg-gradient-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
}

.text-gradient-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: #ffffff;
    /* Pure White Light Mode */
}

.dark #bg-canvas {
    background-color: #000000;
    /* Pure Black Dark Mode */
}

/* Video Player Feedback Animations */
@keyframes feedback-fade {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
        text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.feedback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    background: rgba(0, 0, 0, 0.4);
    padding: 1.5rem;
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.feedback-animate {
    animation: feedback-fade 0.5s ease-out forwards;
}

/* Fullscreen Video Fixes */
#videoContainer:fullscreen,
#videoContainer:-webkit-full-screen,
#videoContainer:-moz-full-screen,
#videoContainer:-ms-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    background-color: #000 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
}

#videoContainer:fullscreen video,
#videoContainer:-webkit-full-screen video,
#videoContainer:-moz-full-screen video,
#videoContainer:-ms-fullscreen video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

#videoContainer:fullscreen #inlineControls,
#videoContainer:-webkit-full-screen #inlineControls,
#videoContainer:-moz-full-screen #inlineControls,
#videoContainer:-ms-fullscreen #inlineControls {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999999 !important;
    width: 100% !important;
    pointer-events: auto !important;
}

/* Hide title bar when in fullscreen mode */
#videoTitleBar.fullscreen-hidden {
    display: none !important;
}

/* Video Player JS Controls */
#inlineControls {
    transition: opacity 0.3s ease-in-out;
}

.video-controls-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.video-controls-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.cursor-hidden {
    cursor: none !important;
}

/* Ensure all buttons in controls are clickable */
#inlineControls button,
#inlineControls div[id="timeDisplay"],
#inlineControls div[id="inlineProgressContainer"] {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 50;
}

/* Ensure video element allows click-through to controls */
#inlineVideoPlayer {
    pointer-events: auto;
}

/* Ensure controls container is above video */
#inlineControls {
    z-index: 40 !important;
    pointer-events: auto !important;
}