/* Custom CSS Variables & Design System */
:root {
  --brand-50: #f5f3ff;
  --brand-100: #ede9fe;
  --brand-500: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-900: #1e1b4b;
  --accent-500: #10b981;
  --accent-600: #059669;
  --neutral-900: #0f172a;
  
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
}

/* Base Adjustments */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* Selection State Highlight styling */
::selection {
  background-color: var(--brand-500) !important;
  color: #ffffff !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--slate-50);
}
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 10px;
  border: 2px solid var(--slate-50);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* Navigation & Backdrop-blur fixes */
header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

header.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  border-color: var(--slate-200);
}

/* Animations & Keyframes */
@keyframes ping-glow {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.animate-ping {
  animation: ping-glow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sticky Mobile Drawer Transitions */
#mobile-menu {
  transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out;
  transform-origin: top;
}

/* Interactive Card Hovers (Unified Styling) */
#features .group {
  transition: var(--transition-smooth);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

#features .group:hover {
  transform: translateY(-6px);
  border-color: var(--brand-100);
  box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.06), 0 10px 10px -5px rgba(79, 70, 229, 0.04);
}

#features .group svg {
  transition: var(--transition-smooth);
}

#features .group:hover svg {
  transform: rotate(3deg) scale(1.05);
}

/* Smart Dashboard Styling & Controls styling */
#dashboard .bg-white {
  transition: var(--transition-smooth);
}

#dashboard .bg-white:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  border-color: var(--slate-300);
}

#dashboard button {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

#dashboard button::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--brand-500);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

#dashboard button:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Interactive Dashboard Toast */
#simulation-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 24rem;
  width: calc(100% - 4rem);
  z-index: 50;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.3), 0 10px 10px -5px rgba(15, 23, 42, 0.2);
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 640px) {
  #simulation-toast {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* Beautiful Interactive Pricing Cards */
#pricing .bg-slate-50, #pricing .bg-slate-900 {
  transition: var(--transition-smooth);
}

#pricing .bg-slate-50:hover {
  transform: translateY(-4px);
  border-color: var(--slate-300);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

#pricing .bg-slate-900:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 35px -5px rgba(79, 70, 229, 0.25), 0 15px 15px -5px rgba(79, 70, 229, 0.15);
}

/* Advanced Form Styling & Transitions */
#contact input, #contact select, #contact textarea {
  transition: var(--transition-smooth);
  border: 1.5px solid var(--slate-200);
}

#contact input:focus, #contact select:focus, #contact textarea:focus {
  border-color: var(--brand-500);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
  transform: translateY(-1px);
}

/* Fancy Gradient overlays & Glow elements for visual appeal */
#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  width: 45%;
  height: 45%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 1;
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 10%;
  width: 35%;
  height: 35%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 1;
  pointer-events: none;
}

/* Master Footer Overrides & Enhanced Readability */
footer {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

footer a, footer button {
  position: relative;
  transition: var(--transition-smooth);
}

footer a:hover, footer button:hover {
  color: #ffffff !important;
}

/* Dynamic Cookie Consent Banner Animation rules */
#cookie-banner {
  box-shadow: 0 -10px 25px -5px rgba(15, 23, 42, 0.08), 0 -8px 10px -6px rgba(15, 23, 42, 0.05);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

/* Accessibility Focus States for Navigation and CTAs */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
}

/* Custom Vector Line Illustration Animation on Dashboard Mockup */
#hero path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.5s;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Live Topology Mesh Animation rules */
#architecture-diagram line {
  stroke-dasharray: 8;
  animation: flowGridLine 35s linear infinite;
}

@keyframes flowGridLine {
  to {
    stroke-dashoffset: -500;
  }
}

#architecture-diagram circle {
  transition: var(--transition-smooth);
}

#architecture-diagram circle:hover {
  fill-opacity: 0.25;
  stroke-width: 3;
}