/* ============================================ */
/* EDUCATION HUB SPECIFIC STYLES */

/* ============================================ */
/* BASE STYLES */
/* ============================================ */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
    transition: zoom 0.4s ease-in-out;
}

/* Magical Background */
.magical-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    z-index: -1;
}

.magical-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(124, 58, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 20, 147, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Glass Effect */
.glass-effect {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Magic Button */
.magic-btn {
    background: linear-gradient(135deg, #7c3aff 0%, #ff1493 50%, #00c8ff 100%);
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.magic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(124, 58, 255, 0.5);
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================ */
/* UNIQUE BUTTON VARIANTS */
/* ============================================ */
.btn-aurora {
    background: linear-gradient(135deg, #7c3aff 0%, #ec4899 50%, #22d3ee 100%);
    box-shadow: 0 12px 24px rgba(124,58,255,0.35), inset 0 0 12px rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.15);
}
.btn-aurora:hover {
    filter: saturate(1.2);
    box-shadow: 0 18px 36px rgba(124,58,255,0.5), 0 0 24px rgba(236,72,153,0.35);
}

.btn-neon {
    background: radial-gradient(circle at 30% 30%, #22d3ee 0%, #0ea5e9 60%, #7c3aff 100%);
    text-shadow: 0 0 12px rgba(255,255,255,0.6);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.6), 0 0 40px rgba(124, 58, 255, 0.35);
}
.btn-neon:hover {
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.9), 0 0 60px rgba(124, 58, 255, 0.6);
}

.btn-3d {
    background: linear-gradient(180deg, #7c3aff 0%, #5b21b6 100%);
    box-shadow: 0 10px 0 #3b0764, 0 16px 32px rgba(124,58,255,0.4);
    transform: translateY(0);
}
.btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 0 #3b0764, 0 20px 40px rgba(124,58,255,0.5);
}
.btn-3d:active {
    transform: translateY(2px);
    box-shadow: 0 8px 0 #3b0764, 0 10px 20px rgba(124,58,255,0.35);
}

.btn-glass {
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    color: #fff;
}
.btn-glass:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
}

.btn-outline-gradient {
    background: transparent;
    color: #fff;
    border: 2px solid transparent;
    padding: 0.625rem 1rem;
}
.btn-outline-gradient {
    position: relative;
}
.btn-outline-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #7c3aff, #ec4899, #22d3ee);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}
.btn-outline-gradient:hover {
    box-shadow: 0 8px 20px rgba(124,58,255,0.35);
}

.btn-wire {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.35);
}
.btn-wire:hover {
    border-style: solid;
}

.btn-tilt {
    transform-style: preserve-3d;
    will-change: transform;
}
.btn-tilt:hover {
    transform: perspective(700px) rotateX(3deg) rotateY(-3deg);
}

/* ============================================ */
/* RIPPLE EFFECT */
/* ============================================ */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background: rgba(255,255,255,0.4);
    animation: ripple-animate 600ms ease-out;
}

@keyframes ripple-animate {
    from { width: 0; height: 0; opacity: 0.7; }
    to { width: 300px; height: 300px; opacity: 0; }
}

/* ============================================ */
/* SCROLL REVEAL UTILITIES */
/* ============================================ */
.reveal-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms ease, transform 500ms ease;
}
.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation */
.nav-link-enhanced {
    position: relative;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.nav-link-enhanced::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fbbf24;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link-enhanced:hover::after {
    width: 80%;
}

/* ============================================ */
/* TEXT SIZE CONTROLS */
/* ============================================ */
/* ============================================ */

/* Text Size Control Variables */
:root {
    --base-size: 16px;
    --scale-factor: 1;
}

/* Smooth zoom transition */
body {
    transition: zoom 0.4s ease-in-out;
}

/* Text Size Scaling - Using zoom property (affects everything) */
body.text-size-70 {
    zoom: 0.7;
    --scale-factor: 0.7;
}

body.text-size-80 {
    zoom: 0.8;
    --scale-factor: 0.8;
}

body.text-size-100 {
    zoom: 1;
    --scale-factor: 1;
}

body.text-size-120 {
    zoom: 1.2;
    --scale-factor: 1.2;
}

body.text-size-150 {
    zoom: 1.5;
    --scale-factor: 1.5;
}

/* Active Text Size Button */
.active-text-size {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
    transform: scale(1.1) !important;
    border: 2px solid #10b981 !important;
}

/* ============================================ */
/* CLASS CARD STYLES */
/* ============================================ */
.class-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.7) 100%);
    backdrop-filter: blur(20px);
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.class-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #7c3aff, #ff1493, #00c8ff);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.class-card:hover::before {
    left: 100%;
}

.class-card:hover::after {
    opacity: 1;
}

.class-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: rgba(124, 58, 255, 0.6);
    box-shadow: 0 15px 40px rgba(124, 58, 255, 0.4), 0 0 20px rgba(124, 58, 255, 0.2);
}

.class-card.active {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.6), 0 0 20px rgba(251, 191, 36, 0.3) !important;
    transform: scale(1.08) !important;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
}

.class-card.active .float {
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ============================================ */
/* FEATURE CARD STYLES */
/* ============================================ */
.feature-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 255, 0.1) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
}

.feature-card:hover::before {
    transform: scale(1);
}

.feature-card:hover {
    transform: scale(1.08) translateY(-12px) rotate(1deg);
    box-shadow: 0 25px 50px rgba(124, 58, 255, 0.5), 0 0 30px rgba(255, 20, 147, 0.3);
    border-color: rgba(124, 58, 255, 0.5);
}

.feature-card:hover .pulse-magic {
    transform: scale(1.3) rotate(10deg);
}

.feature-card button {
    margin-top: auto;
    transition: all 0.3s ease;
}

.feature-card:hover button {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(124, 58, 255, 0.6);
}

/* ============================================ */
/* READING MODE STYLES */
/* ============================================ */
body.reading-mode {
    background: #f5f5f5;
}

body.reading-mode .magical-bg {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
}

body.reading-mode .glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-color: rgba(200, 200, 200, 0.3);
    color: #333;
}

body.reading-mode h1,
body.reading-mode h2,
body.reading-mode h3,
body.reading-mode p {
    color: #333 !important;
}

body.reading-mode .text-white {
    color: #333 !important;
}

body.reading-mode .text-white.opacity-90 {
    color: #555 !important;
}

body.reading-mode .text-white.opacity-80 {
    color: #666 !important;
}

/* ============================================ */
/* STATS SECTION */
/* ============================================ */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,200,0,0.1), transparent);
    pointer-events: none;
}

.stat-number {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================ */
/* ANIMATIONS FOR EDUCATION HUB */
/* ============================================ */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(124, 58, 255, 0.4);
    }
    50% {
        text-shadow: 0 0 20px rgba(124, 58, 255, 0.7);
    }
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.fade-in-scale {
    animation: fadeInScale 0.5s ease-out;
}

.glow-text {
    animation: pulse-glow 5s ease-in-out infinite;
}

/* ============================================ */
/* STAGGER ITEMS */
/* ============================================ */
.stagger-item {
    animation: slideInUp 0.6s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }
.stagger-item:nth-child(9) { animation-delay: 0.9s; }

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */
.pulse-magic {
    animation: pulse-glow 2s ease-in-out infinite;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
}

.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ============================================ */
/* RESPONSIVE ADJUSTMENTS */
/* ============================================ */
@media (max-width: 768px) {
    .class-card {
        padding: 0.75rem !important;
    }
    
    .feature-card {
        gap: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    body.text-size-70 {
        zoom: 0.65;
    }
    
    body.text-size-80 {
        zoom: 0.75;
    }
    
    body.text-size-150 {
        zoom: 1.3;
    }
    
    body.text-size-120 {
        zoom: 1.1;
    }
}

/* ============================================ */
/* FOCUS & ACCESSIBILITY */
/* ============================================ */
button:focus,
a:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.magic-btn {
    transition: all 0.3s ease;
}

.magic-btn:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 255, 0.5);
}

/* ============================================ */
/* 3D ILLUSTRATION & LIGHTING EFFECTS */
/* ============================================ */
.depth-3d {
    transform-style: preserve-3d;
    perspective: 900px;
}

.card-3d {
    transform: translateZ(0);
    will-change: transform;
}
.card-3d:hover {
    transform: rotateX(3deg) rotateY(-3deg) translateZ(6px);
}

.light-sweep {
    position: relative;
    overflow: hidden;
}
.light-sweep::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transform: skewX(-20deg);
    animation: sweep 4.5s ease-in-out infinite;
}

@keyframes sweep {
    0% { left: -150%; }
    50% { left: 120%; }
    100% { left: 120%; }
}

/* Decorative floating blobs for hero */
.hero-decor {
    position: absolute;
    border-radius: 9999px;
    filter: blur(24px);
    opacity: 0.35;
    animation: float 10s ease-in-out infinite;
}
.hero-decor.blob1 { width: 160px; height: 160px; background: #7c3aff; top: 10%; left: 8%; }
.hero-decor.blob2 { width: 120px; height: 120px; background: #ec4899; top: 20%; right: 12%; animation-delay: 1.5s; }
.hero-decor.blob3 { width: 140px; height: 140px; background: #22d3ee; bottom: 12%; left: 18%; animation-delay: 3s; }

/* ============================================ */
/* DARK MODE ADJUSTMENTS */
/* ============================================ */
@media (prefers-color-scheme: dark) {
    body {
        background: #0a0e27;
    }
}

@media (prefers-color-scheme: light) {
    body {
        background: #f5f5f5;
    }
    
    .glass-effect {
        background: rgba(255, 255, 255, 0.7);
        border-color: rgba(200, 200, 200, 0.5);
        color: #333;
    }
}

/* ============================================ */
/* ENHANCED ANIMATIONS */
/* ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    animation: shimmer 6s infinite linear;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    background-size: 1000px 100%;
}

/* Text Size Button Improvements */
.text-size-btn {
    position: relative;
    overflow: hidden;
}

.text-size-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.text-size-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Improved Pulse Effect - Slower */
@keyframes enhanced-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.85;
    }
}

.pulse-magic {
    animation: enhanced-pulse 4s ease-in-out infinite;
}

/* ============================================ */
/* ADVANCED HOME ANIMATION UTILITIES */
/* ============================================ */
/* Aurora gradient background */
.aurora-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(1200px circle at 10% 10%, rgba(124,58,255,0.15), transparent 40%),
                radial-gradient(1000px circle at 90% 20%, rgba(236,72,153,0.12), transparent 45%),
                radial-gradient(900px circle at 50% 80%, rgba(34,211,238,0.12), transparent 50%);
    filter: blur(40px);
    animation: auroraShift 18s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auroraShift {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-12px) scale(1.02); opacity: 0.9; }
}

/* Tilt wave for hero headline */
.tilt-wave {
    display: inline-block;
    transform-origin: center;
    animation: tiltWave 6s ease-in-out infinite;
}

@keyframes tiltWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1.3deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-1.3deg); }
}

/* Particle canvas container */
.particles-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

canvas.particles {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.6;
}

/* Enhanced reveal classes */
.reveal-slow { transition-duration: 800ms; }
.reveal-fast { transition-duration: 300ms; }

/* Button glow ring */
.glow-ring {
    position: relative;
}
.glow-ring::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(124,58,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 300ms ease;
}
.glow-ring:hover::after { opacity: 1; }

/* Hero CTA ripple helper */
.ripple-dark {
    background: rgba(255,255,255,0.25);
}
