/* ==========================================================================
   Levitate Yourself - Custom Stylesheet & Motion Design
   Theme: Royal Navy & Vibrant Emerald (with Gold Accents)
   ========================================================================== */

/* Root Design Tokens */
:root {
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;
  --brand-navy: #0b1329;
  --brand-navy-dark: #070d1e;
  --brand-accent: #f59e0b;
  --brand-accent-hover: #d97706;
}

/* Base Smooth Scrolling & Viewport Lock */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Premium Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #0b1329;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #10b981, #059669);
  border-radius: 9999px;
  border: 2px solid #0b1329;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #34d399, #10b981);
}

/* Responsive Touch Input Fix */
input, select, textarea {
  font-size: 16px !important;
}
@media (min-width: 640px) {
  input, select, textarea {
    font-size: 0.875rem !important;
  }
}

/* ==========================================================================
   Ambient Background Blur Orbs (Positioned safely away from text)
   ========================================================================== */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  -webkit-filter: blur(80px);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.45;
  transition: transform 1s ease-out, opacity 1s ease;
  will-change: transform, opacity;
}

.ambient-glow-brand {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.38) 0%, rgba(5, 150, 105, 0.08) 65%, transparent 100%);
}

.ambient-glow-accent {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, rgba(245, 158, 11, 0.05) 65%, transparent 100%);
}

.ambient-glow-indigo {
  background: radial-gradient(circle, rgba(13, 148, 136, 0.35) 0%, rgba(13, 148, 136, 0.05) 65%, transparent 100%);
}

.ambient-glow-cyan {
  background: radial-gradient(circle, rgba(20, 184, 166, 0.32) 0%, rgba(20, 184, 166, 0.05) 65%, transparent 100%);
}

.ambient-glow-navy {
  background: radial-gradient(circle, rgba(11, 19, 41, 0.45) 0%, rgba(11, 19, 41, 0.08) 65%, transparent 100%);
}

/* ==========================================================================
   Decorative Education & Computer Floating Background Obstacles
   (Softly blurred & placed strictly in background margins/periphery)
   ========================================================================== */
.bg-decor-icon {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  color: rgba(5, 150, 105, 0.12);
  filter: drop-shadow(0 0 15px rgba(5, 150, 105, 0.08));
  transition: transform 0.5s ease, opacity 0.5s ease;
  will-change: transform;
}

.bg-decor-icon-accent {
  color: rgba(245, 158, 11, 0.14);
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.08));
}

.bg-decor-icon-light {
  color: rgba(255, 255, 255, 0.07);
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.05));
}

/* Strict Content Isolation Layer - Text is 100% Crisp & Unobstructed */
.content-layer {
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   Smooth Keyframe Animations
   ========================================================================== */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-16px) rotate(3deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(16px) rotate(-3deg);
  }
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  33% {
    transform: translateY(-8px) translateX(6px);
  }
  66% {
    transform: translateY(6px) translateX(-4px);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.65;
  }
}

@keyframes morphBlob {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 35% 65% 60% 40% / 45% 55% 45% 55%;
  }
}

@keyframes shimmerGleam {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

@keyframes ringRadar {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Utility Animation Classes */
.animate-float-slow {
  animation: floatSlow 7s ease-in-out infinite;
}

.animate-float-reverse {
  animation: floatReverse 8s ease-in-out infinite;
}

.animate-float-gentle {
  animation: floatGentle 6s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 6s ease-in-out infinite;
}

.animate-morph {
  animation: morphBlob 12s ease-in-out infinite;
}

.animate-radar {
  animation: ringRadar 2.5s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* ==========================================================================
   Card & Button Micro-Interactions
   ========================================================================== */
.interactive-card {
  position: relative;
  z-index: 10;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease,
              background-color 0.3s ease;
  will-change: transform, box-shadow;
}

.interactive-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px rgba(5, 150, 105, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: rgba(16, 185, 129, 0.45);
}

.interactive-card-dark {
  position: relative;
  z-index: 10;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease;
  will-change: transform, box-shadow;
}

.interactive-card-dark:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -10px rgba(16, 185, 129, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
}

/* Shimmer Button Effect */
.btn-shimmer {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: 0.75s;
  pointer-events: none;
}

.btn-shimmer:hover::after {
  left: 200%;
}

.btn-shimmer:hover {
  transform: translateY(-2px);
}

/* Glassmorphism Header */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Delay Helpers */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* ==========================================================================
   Floating Action Buttons & Quick Widgets
   ========================================================================== */
.floating-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.float-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer;
}

.float-btn:hover {
  transform: scale(1.1) translateY(-2px);
}

#backToTop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   Smooth Animated Hamburger & Mobile Drawer
   ========================================================================== */
.hamburger-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.hamburger-btn:hover {
  background: rgba(236, 253, 245, 1);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.15);
}

.hamburger-btn:active {
  transform: scale(0.92);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: #0b1329;
  border-radius: 9999px;
  transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6), 
              opacity 0.25s ease, 
              background-color 0.3s ease,
              width 0.3s ease;
  transform-origin: center;
}

/* Hover effect on lines when not open */
.hamburger-btn:not(.active):hover .hamburger-line {
  background-color: #059669;
}

.hamburger-btn:not(.active):hover .hamburger-line:nth-child(2) {
  width: 16px;
}

/* Active State: Morphs into Spring "X" */
.hamburger-btn.active {
  background: rgba(254, 242, 242, 0.9);
  border-color: rgba(239, 68, 68, 0.2);
}

.hamburger-btn.active .hamburger-line {
  background-color: #059669;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 22px;
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 22px;
}

/* Smooth Mobile Drawer Container */
#mobileMenu {
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  pointer-events: none;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.35s ease;
}

#mobileMenu.active {
  max-height: 520px;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Staggered link animations inside mobile menu */
.mobile-nav-link {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease, background-color 0.2s ease;
}

#mobileMenu.active .mobile-nav-link {
  opacity: 1;
  transform: translateX(0);
}

#mobileMenu.active .mobile-nav-link:nth-child(1) { transition-delay: 60ms; }
#mobileMenu.active .mobile-nav-link:nth-child(2) { transition-delay: 100ms; }
#mobileMenu.active .mobile-nav-link:nth-child(3) { transition-delay: 140ms; }
#mobileMenu.active .mobile-nav-link:nth-child(4) { transition-delay: 180ms; }
#mobileMenu.active .mobile-nav-link:nth-child(5) { transition-delay: 220ms; }
#mobileMenu.active .mobile-nav-link:nth-child(6) { transition-delay: 260ms; }
#mobileMenu.active .mobile-nav-link:nth-child(7) { transition-delay: 300ms; }

/* Backdrop dim overlay for mobile navigation */
#mobileBackdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#mobileBackdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Fullscreen 2.5s Smooth Welcome Animation Splash Screen
   ========================================================================== */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, #0f1c3f 0%, #070d1e 65%, #030712 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.85s;
  will-change: opacity, transform;
}

.welcome-screen.fade-out {
  opacity: 0;
  transform: scale(1.06);
  visibility: hidden;
  pointer-events: none;
}

.welcome-img-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: welcomePop 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 640px) {
  .welcome-img-wrapper {
    width: 170px;
    height: 170px;
  }
}

.welcome-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(16, 185, 129, 0.35));
  animation: welcomeFloat 3s ease-in-out infinite alternate;
}

.welcome-ring-pulse {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.35);
  animation: welcomePulseRing 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
}

.welcome-tag {
  animation: welcomeTextFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.welcome-title {
  animation: welcomeTextFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.welcome-subtitle {
  animation: welcomeTextFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
}

.welcome-creator-badge {
  animation: welcomeTextFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.72s both;
}

/* Loading Progress Bar Indicator */
.welcome-loader-track {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  animation: welcomeTextFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.welcome-loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #34d399);
  border-radius: 9999px;
  animation: welcomeProgress 3.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Keyframes for Welcome Animation */
@keyframes welcomePop {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(30px);
  }
  60% {
    opacity: 1;
    transform: scale(1.08) translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes welcomeFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes welcomePulseRing {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 0;
  }
  100% {
    transform: scale(0.85);
    opacity: 0;
  }
}

@keyframes welcomeTextFade {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcomeProgress {
  0% {
    width: 0%;
  }
  50% {
    width: 65%;
  }
  100% {
    width: 100%;
  }
}

/* ==========================================================================
   Course Details Popup Modal Transitions
   ========================================================================== */
#courseModal {
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

#courseModal.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

#courseModal.active #courseModalBox {
  transform: scale(1) translateY(0) !important;
}

#courseModalBox {
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ==========================================================================
   ENROLLMENT MODAL (ALL-IN-ONE & SPECIFIC MODES)
   ========================================================================== */
#enrollModal {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

#enrollModal.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

#enrollModal.active #enrollModalBox {
  transform: scale(1) translateY(0) !important;
}

#enrollModalBox {
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ==========================================================================
   Device Specific & Responsiveness Fixes
   ========================================================================== */
@media (max-width: 640px) {
  .hero-title-sync {
    font-size: 2.25rem !important;
    line-height: 2.75rem !important;
  }
  
  .floating-widget {
    bottom: 16px;
    right: 16px;
  }
}

@media (min-width: 1440px) {
  .max-w-7xl {
    max-width: 84rem;
  }
}

/* ==========================================================================
   Page Transition Blur Effect (Gallery & Blog Click)
   ========================================================================== */
.page-transition-blur-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(7, 13, 30, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  will-change: opacity, backdrop-filter;
}

.page-transition-blur-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.page-transition-box {
  transform: scale(0.9) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.page-transition-blur-overlay.active .page-transition-box {
  transform: scale(1) translateY(0);
}
