:root {
  /* Primary Palette - Indigo/Violet Premium */
  --primary: #6366f1;
  --primary-rgb: 99, 102, 241;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  
  /* Accent Palette */
  --accent: #f43f5e;
  --accent-rgb: 244, 63, 94;
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
  
  /* Neutrals */
  --background: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  
  /* System */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  
  /* Spacing & Shapes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-premium: 0 25px 50px -12px rgba(99, 102, 241, 0.15);
  
  /* Modern Transitions */
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Global Lift Animation & Link Highlights */
a, .btn, .card, .feature-card, .nav-link, .stat-item, .user-profile {
  transition: var(--transition-spring);
}

a:hover {
  color: var(--primary);
  text-decoration: none;
}

.lift-on-hover:hover, 
.btn:hover, 
.card:hover:not(.no-hover), 
.nav-link:hover,
.user-profile:hover {
  transform: translateY(-8px) scale(1.01);
  filter: brightness(1.05);
  box-shadow: var(--shadow-premium);
}

.nav-link:hover {
  color: var(--primary) !important;
}

/* Futuristic Background Shapes */
.bg-shape {
  position: absolute;
  z-index: -1;
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.15;
  pointer-events: none;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -150px;
  right: -150px;
  animation: float-shape 20s infinite alternate linear;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  bottom: -100px;
  left: -100px;
  animation: float-shape 15s infinite alternate-reverse linear;
}

@keyframes float-shape {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(100px, 150px) rotate(60deg); }
}

/* Glowing Elements */
.glow-primary { box-shadow: 0 0 30px rgba(99, 102, 241, 0.3); }
.glow-accent { box-shadow: 0 0 30px rgba(244, 63, 94, 0.3); }

.top-announcement {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.fixed-top {
  top: 0;
}

.guest-body .navbar.fixed-top {
  top: 40px; /* Offset for announcement bar */
}

@media (max-width: 768px) {
  .guest-body .navbar.fixed-top {
    top: 0;
  }
}

/* Floating Animation */
.floating { animation: floating 4s ease-in-out infinite; }
@keyframes floating {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Pulse Animation */
.pulse-glow { animation: pulse-glow 2s infinite; }
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(var(--primary-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0); }
}

[data-theme="dark"] {
  --background: #0b0f1a;
  --surface: #161e31;
  --surface-alt: #1e293b;
  --grad-surface: linear-gradient(180deg, rgba(22, 30, 49, 0.8) 0%, rgba(22, 30, 49, 0.4) 100%);
  --text-main: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Base Styles */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout Utilities */
.section-padding {
  padding: 100px 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 60px 0;
  }
}

/* Hero Section */
.hero-wrapper {
  position: relative;
  padding: 140px 0 100px;
  overflow: hidden;
}

.hero-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

/* Features & Services Grid */
.feature-card {
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: var(--transition-spring);
  height: 100%;
  position: relative;
  z-index: 1;
}

.feature-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-premium);
  border-color: var(--primary);
}

.feature-icon-box {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon-box {
  background: var(--primary);
  color: white;
  transform: rotate(-5deg) scale(1.1);
}

/* Stats Section */
.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-muted);
  font-weight: 600;
  text-uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* Glassmorphism Refined */
.glass {
  background: var(--grad-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .glass {
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--grad-primary);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
  background: var(--grad-primary);
  filter: brightness(1.1);
}

/* Sidebar */
.sidebar {
  width: 280px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 32px 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

/* Auth Navigation */
.main-header {
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 100;
  padding: 20px 0;
  margin-bottom: 40px;
}

/* Guest Navigation */
.navbar {
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

/* FAQ Accordion */
.custom-accordion .accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md) !important;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
}

.custom-accordion .accordion-button {
  padding: 24px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--surface);
  box-shadow: none;
}

.custom-accordion .accordion-button:not(.collapsed) {
  background: var(--primary-light);
  color: var(--primary);
}

/* Responsive Fixes & Mobile Optimization */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    transition: var(--transition-spring);
    visibility: hidden;
  }
  .sidebar.show {
    transform: translateX(0);
    visibility: visible;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 20px !important;
  }
  .main-header {
    padding: 15px 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  display: flex;
  justify-content: space-around;
  padding: 12px 20px;
  z-index: 9999;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transition: var(--transition-spring);
}

[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(22, 30, 49, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  transition: var(--transition);
}

.mobile-nav-item i {
  font-size: 1.2rem;
  transition: var(--transition-spring);
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item.active i {
  transform: translateY(-5px);
  color: var(--primary);
}

.mobile-nav-item:active i {
  transform: scale(0.8);
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* Fix for guest content spacing */
@media (max-width: 991px) {
  .guest-footer {
    padding-bottom: 100px !important;
  }
  .auth-body .main-content {
    padding-bottom: 100px !important;
  }
}

/* Touch Device Optimization (Android/iOS) */
@media (hover: none) {
  .lift-on-hover:active, 
  .btn:active, 
  .card:active:not(.no-hover), 
  .nav-link:active,
  .user-profile:active {
    transform: translateY(-5px) scale(0.98);
    filter: brightness(0.95);
  }
}

/* Safe Area Insets for iOS */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .guest-footer {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
  }
}

/* Fix for small screens */
@media (max-width: 576px) {
  .hero-title {
    font-size: 2.25rem;
    line-height: 1.1;
  }
  .hero-wrapper {
    padding: 100px 0 60px;
  }
  .btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
  }
  .stat-value {
    font-size: 1.75rem;
  }
  .feature-card {
    padding: 30px 20px;
  }
}

/* Form refinement for mobile */
input, select, textarea {
  font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
}
