body {
  font-family: "Playpen Sans Arabic", cursive;
  overflow-x: hidden;
  background-color: #f8fafc;
}

/* Dark mode body */
.dark body {
    background-color: #020617;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #008CCF;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #006b9e;
}

/* --- Advanced Animations --- */

/* Performance optimization */
.will-change-transform {
  will-change: transform;
}

/* 1. Floating Blobs Background */
@keyframes blob {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* 2. Typewriter Cursor */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-start infinite;
  color: #008CCF; 
}

@keyframes blink {
  50% { opacity: 0; }
}

/* 3. Floating Elements */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
.animate-float-y {
  animation: float-y 4s ease-in-out infinite;
  will-change: transform;
}

/* 4. Shimmer Effect */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.animate-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* --- Styles --- */

/* Navbar */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .nav-scrolled {
  background: rgba(2, 6, 23, 0.85); /* Darker Slate */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Navbar Text Colors in Scrolled State */
.nav-scrolled .nav-link, 
.nav-scrolled .logo-text,
.nav-scrolled #mobile-menu-btn,
.nav-scrolled #theme-toggle-desktop,
.nav-scrolled #theme-toggle-mobile,
.nav-scrolled #login-btn {
  color: #1e293b !important; /* Slate 800 */
}

/* Fix Login Button Border in Light Mode Scrolled */
.nav-scrolled #login-btn {
    border-color: #cbd5e1 !important; /* Slate 300 */
}
.nav-scrolled #login-btn:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

.dark .nav-scrolled .nav-link, 
.dark .nav-scrolled .logo-text,
.dark .nav-scrolled #mobile-menu-btn,
.dark .nav-scrolled #theme-toggle-desktop,
.dark .nav-scrolled #theme-toggle-mobile,
.dark .nav-scrolled #login-btn {
  color: #f8fafc !important; /* Slate 50 */
}

.dark .nav-scrolled #login-btn {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark .nav-scrolled #login-btn:hover {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Active Nav Link */
.active-nav-link {
  color: #008CCF !important;
  font-weight: 800;
  position: relative;
}

.nav-scrolled .active-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 100%;
    height: 3px;
    background: #008CCF;
    border-radius: 99px;
}


/* Modern Cards */
.modern-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.dark .modern-card {
    background: rgba(30, 41, 59, 0.4); /* More transparent dark */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.modern-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 40px -5px rgba(0, 140, 207, 0.15);
  border-color: #008CCF;
}

.dark .modern-card:hover {
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 20px 40px -5px rgba(0, 140, 207, 0.2);
    border-color: #008CCF;
}

/* Chat Bubble Testimonial */
.chat-bubble {
  position: relative;
  background: #ffffff;
  border-radius: 20px 20px 2px 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

.dark .chat-bubble {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.chat-bubble::before {
    content: "";
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.dark .chat-bubble::before {
    background: #1e293b;
    border-color: #334155;
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
  will-change: transform, opacity;
}

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

.reveal-delay-100 { transition-delay: 0.1s; }
.reveal-delay-200 { transition-delay: 0.2s; }
.reveal-delay-300 { transition-delay: 0.3s; }

/* Form Elements Dark Mode */
.dark input::placeholder,
.dark textarea::placeholder {
  color: #94a3b8;
}

.dark input,
.dark textarea {
    background-color: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}
.dark input:focus,
.dark textarea:focus {
    border-color: #008CCF;
    background-color: rgba(30, 41, 59, 0.8);
}

/* Force nav-scrolled class on all views except home */
body:not([data-current-view="home"]) #main-nav {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body:not([data-current-view="home"]) #main-nav .nav-link,
body:not([data-current-view="home"]) #main-nav .logo-text,
body:not([data-current-view="home"]) #mobile-menu-btn,
body:not([data-current-view="home"]) #theme-toggle-desktop,
body:not([data-current-view="home"]) #theme-toggle-mobile {
    color: #1e293b !important;
}

/* Dark mode adjustments for non-home views */
.dark body:not([data-current-view="home"]) #main-nav {
    background: rgba(2, 6, 23, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2) !important;
}

.dark body:not([data-current-view="home"]) #main-nav .nav-link,
.dark body:not([data-current-view="home"]) #main-nav .logo-text,
.dark body:not([data-current-view="home"]) #mobile-menu-btn,
.dark body:not([data-current-view="home"]) #theme-toggle-desktop,
.dark body:not([data-current-view="home"]) #theme-toggle-mobile {
    color: #f8fafc !important;
}

/* Active nav link styling for non-home views */
body:not([data-current-view="home"]) .active-nav-link::after {
    content: '' !important;
    position: absolute !important;
    bottom: -4px !important;
    right: 0 !important;
    width: 100% !important;
    height: 3px !important;
    background: #008CCF !important;
    border-radius: 99px !important;
}

/* Login button styling for non-home views */
body:not([data-current-view="home"]) #login-btn {
    border-color: #cbd5e1 !important;
}

body:not([data-current-view="home"]) #login-btn:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

.dark body:not([data-current-view="home"]) #login-btn {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark body:not([data-current-view="home"]) #login-btn:hover {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Desktop menu background for non-home views */
body:not([data-current-view="home"]) #desktop-menu {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.dark body:not([data-current-view="home"]) #desktop-menu {
    background: rgba(30, 41, 59, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dropdown styling for non-home views */
body:not([data-current-view="home"]) #desktop-menu .dropdown-content {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

.dark body:not([data-current-view="home"]) #desktop-menu .dropdown-content {
    background: #1e293b !important;
    border-color: #334155 !important;
}

