@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --background: 0 0% 5%;
  --foreground: 0 0% 96%;
  --card: 0 0% 8%;
  --card-foreground: 0 0% 96%;
  --popover: 0 0% 7%;
  --popover-foreground: 0 0% 96%;
  --primary: 354 85% 54%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 355 95% 65%;
  --secondary: 350 82% 48%;
  --secondary-foreground: 0 0% 100%;
  --muted: 0 0% 13%;
  --muted-foreground: 0 0% 65%;
  --accent: 354 90% 60%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 18%;
  --input: 0 0% 14%;
  --ring: 354 85% 54%;
  --radius: 1rem;
  --gradient-primary: linear-gradient(135deg, hsl(354 88% 54%), hsl(340 85% 42%));
  --gradient-accent: linear-gradient(135deg, hsl(354 90% 62%), hsl(10 90% 55%));
  --gradient-hero: linear-gradient(135deg, hsl(354 85% 50% / 0.35), hsl(0 0% 10% / 0.4), hsl(340 80% 40% / 0.35));
  --gradient-text: linear-gradient(135deg, hsl(354 100% 72%), hsl(0 0% 100%), hsl(354 85% 62%));
  --shadow-glow: 0 0 60px hsl(354 85% 54% / 0.4);
  --shadow-glow-cyan: 0 0 60px hsl(354 90% 60% / 0.35);
  --shadow-elegant: 0 20px 60px -20px hsl(354 85% 45% / 0.5);
  --shadow-card: 0 8px 32px hsl(0 0% 0% / 0.7);
}

* {
  border-color: hsl(var(--border) / 0.6);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background-image:
    radial-gradient(ellipse at top left, hsl(354 85% 25% / 0.22), transparent 50%),
    radial-gradient(ellipse at bottom right, hsl(340 80% 20% / 0.2), transparent 50%),
    radial-gradient(ellipse at center, hsl(0 0% 8% / 0.3), transparent 60%);
  background-attachment: fixed;
}

.hero-aurora-bg {
  position: absolute;
  inset: 0;
  z-index: -15;
  background-image:
    radial-gradient(circle at top left, hsl(354 85% 25% / 0.22), transparent 50%),
    radial-gradient(circle at bottom right, hsl(340 80% 20% / 0.20), transparent 50%),
    radial-gradient(circle at center, hsl(0 0% 8% / 0.15), transparent 60%);
  background-size: 200% 200%;
  animation: bg-aurora 25s ease-in-out infinite alternate;
}
html[data-theme="light"] .hero-aurora-bg {
  background-image:
    radial-gradient(circle at top left, hsl(354 85% 85% / 0.5), transparent 50%),
    radial-gradient(circle at bottom right, hsl(340 80% 85% / 0.5), transparent 50%),
    radial-gradient(circle at center, hsl(0 0% 95% / 0.5), transparent 60%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: gradient-shift 6s ease infinite;
}

.glass {
  background: hsl(0 0% 8% / 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsl(0 0% 20% / 0.5);
}

.grid-pattern {
  background-image:
    linear-gradient(hsl(0 0% 20% / 0.4) 1px, transparent 1px),
    linear-gradient(90deg, hsl(0 0% 20% / 0.4) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  animation: grid-scroll 15s linear infinite;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.animate-orb {
  animation: orb 20s ease-in-out infinite;
}

.animate-fade-in-up {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-in-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.anime-enhanced .animate-fade-in-up {
  animation: none;
}

[data-navbar].scrolled {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

[data-navbar].scrolled [data-navbar-inner] {
  box-shadow: var(--shadow-card);
  background: hsl(240 25% 10% / 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsl(240 25% 25% / 0.4);
  padding: 0.75rem 1.25rem;
  transition: padding 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-navbar-inner] a,
[data-navbar-inner] button {
  transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

[data-navbar-inner] a:hover,
[data-navbar-inner] button:hover {
  transform: translateY(-1px);
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes grid-scroll {
  from { background-position: 0 0; }
  to { background-position: 50px 50px; }
}

@keyframes bg-aurora {
  0% { background-position: 0% 0%; }
  33% { background-position: 100% 0%; }
  66% { background-position: 100% 100%; }
  100% { background-position: 0% 100%; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 30px hsl(var(--primary) / 0.4); }
  50% { box-shadow: 0 0 60px hsl(var(--primary) / 0.7), 0 0 80px hsl(var(--secondary) / 0.4); }
}

@keyframes orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.pv-alert-popup {
  background: hsl(240 25% 10% / 0.95) !important;
  border: 1px solid hsl(240 25% 25% / 0.45) !important;
  border-radius: 1rem !important;
  box-shadow: var(--shadow-card) !important;
  color: hsl(var(--foreground)) !important;
}

.pv-alert-title {
  color: hsl(var(--foreground)) !important;
  font-family: 'Space Grotesk', system-ui, sans-serif !important;
  font-weight: 700 !important;
}

.pv-alert-text {
  color: hsl(var(--muted-foreground)) !important;
}

.pv-alert-confirm,
.pv-alert-cancel {
  border: 0;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.7rem 1rem;
}

.pv-alert-confirm {
  background: var(--gradient-accent) !important;
  color: hsl(var(--primary-foreground)) !important;
  box-shadow: var(--shadow-glow-cyan);
}

.pv-alert-cancel {
  background: hsl(var(--muted)) !important;
  color: hsl(var(--foreground)) !important;
}

/* --- Hero specific Glow (Stitch.withgoogle effect) --- */
.global-cursor-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -5;
  background: radial-gradient(
    600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
    hsl(var(--primary-glow) / 0.08),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}
.hero-section:hover .global-cursor-glow,
#home-hero:hover .global-cursor-glow {
  opacity: 1;
}

.hero-ring {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  border: 1px solid hsl(var(--primary) / 0.24);
  filter: drop-shadow(0 0 26px hsl(var(--primary-glow) / 0.22));
  z-index: -12;
}

.hero-ring-one {
  width: min(58vw, 760px);
  height: min(58vw, 760px);
  top: -18%;
  left: -12%;
}

.hero-ring-two {
  width: min(46vw, 620px);
  height: min(46vw, 620px);
  bottom: -20%;
  right: -8%;
  border-color: hsl(var(--secondary) / 0.25);
}

html[data-theme="light"] .global-cursor-glow {
  background: radial-gradient(
    600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
    hsl(var(--primary-glow) / 0.15),
    transparent 40%
  );
}

/* Card Mouse Follow Glow */
.glass {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.glass::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--card-mouse-x, 0) var(--card-mouse-y, 0),
    hsl(var(--primary-glow) / 0.12),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: -1;
}
.glass:hover::after {
  opacity: 1;
}
.glass:hover {
  box-shadow: 0 22px 44px -28px hsl(354 85% 45% / 0.55);
}
html[data-theme="light"] .glass::after {
  background: radial-gradient(
    420px circle at var(--card-mouse-x, 0) var(--card-mouse-y, 0),
    hsl(var(--primary-glow) / 0.25),
    transparent 40%
  );
}

/* --- Theme Toggle Icons --- */
.dark-icon, .light-icon { display: none !important; }

/* Contact page refresh */
.contact-shell {
  position: relative;
}

.contact-shell::before {
  content: "";
  position: absolute;
  inset: -3rem 0 auto 0;
  height: 18rem;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(45% 70% at 20% 20%, hsl(var(--secondary) / 0.22), transparent 70%),
    radial-gradient(35% 55% at 75% 15%, hsl(var(--primary) / 0.28), transparent 70%);
  filter: blur(10px);
}

.contact-header {
  border-color: hsl(var(--secondary) / 0.3);
}

.contact-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.contact-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.contact-info-card {
  border-color: hsl(var(--primary) / 0.25);
}

.contact-info-card ul {
  padding-left: 1rem;
  list-style: disc;
}

.contact-form-wrap {
  border-color: hsl(var(--primary) / 0.35);
}

.contact-field {
  background: hsl(0 0% 8% / 0.85);
  border-color: hsl(var(--border) / 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

html[data-theme="light"] .contact-field {
  background: hsl(0 0% 100% / 0.9);
  border-color: hsl(var(--border));
}

.contact-field:hover {
  border-color: hsl(var(--primary) / 0.5);
}

.contact-field:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.2);
  transform: translateY(-1px);
}

textarea.contact-field {
  min-height: 10rem;
  resize: vertical;
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: 320px 1fr;
  }
}

html[data-theme="light"] .contact-field {
  background: hsl(0 0% 100% / 0.75);
}
html[data-theme="light"] .dark-icon { display: flex !important; }
html:not([data-theme="light"]) .light-icon { display: flex !important; }

/* --- Light Theme Variables & Overrides --- */
html[data-theme="light"] {
  --background: 0 0% 98%;
  --foreground: 0 0% 10%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 10%;
  --primary: 354 85% 50%; 
  --primary-foreground: 0 0% 100%;
  --primary-glow: 354 90% 60%;
  --secondary: 350 80% 45%; 
  --secondary-foreground: 0 0% 100%;
  --muted: 0 0% 94%;
  --muted-foreground: 0 0% 40%;
  --accent: 354 85% 50%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 0 0% 88%;
  --input: 0 0% 92%;
  --ring: 354 85% 50%;

  --shadow-glow: 0 0 40px hsl(354 85% 50% / 0.2);
  --shadow-glow-cyan: 0 0 40px hsl(350 80% 45% / 0.2);
  --shadow-elegant: 0 20px 40px -10px hsl(354 85% 45% / 0.15);
  --shadow-card: 0 8px 32px hsl(0 0% 0% / 0.05);

  --gradient-hero: linear-gradient(135deg, hsl(354 85% 50% / 0.06), hsl(0 0% 95% / 0.05), hsl(340 80% 40% / 0.06));
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse at top left, hsl(354 85% 85% / 0.35), transparent 50%),
    radial-gradient(ellipse at bottom right, hsl(340 80% 85% / 0.3), transparent 50%),
    radial-gradient(ellipse at center, hsl(0 0% 95% / 0.5), transparent 60%);
}

html[data-theme="light"] .glass {
  background: hsl(0 0% 100% / 0.75);
  border: 1px solid hsl(0 0% 88% / 0.8);
}

html[data-theme="light"] .grid-pattern {
  background-image:
    linear-gradient(hsl(0 0% 88% / 0.8) 1px, transparent 1px),
    linear-gradient(90deg, hsl(0 0% 88% / 0.8) 1px, transparent 1px);
}

html[data-theme="light"] [data-navbar].scrolled [data-navbar-inner] {
  background: hsl(0 0% 100% / 0.85);
  border: 1px solid hsl(0 0% 88% / 0.8);
}

html[data-theme="light"] .pv-alert-popup {
  background: hsl(0 0% 100% / 0.95) !important;
  border: 1px solid hsl(0 0% 88% / 0.8) !important;
}

html[data-theme="light"] .gradient-text {
  --gradient-text: linear-gradient(135deg, hsl(354 88% 48%), hsl(0 0% 15%), hsl(354 85% 52%));
}

/* Home updates section: prevent clipped badge/icon and improve responsive rhythm */
.home-update-grid .home-update-card {
  min-height: 220px;
  overflow: visible;
}

.home-update-grid .home-step-index {
  z-index: 4;
}

.home-update-grid .home-step-icon {
  position: relative;
  z-index: 2;
  animation: icon-float 3s ease-in-out infinite;
}

/* Better default responsive table behavior across pages with data tables */
.glass table {
  width: 100%;
}

@media (max-width: 1024px) {
  .glass.overflow-hidden {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .glass.overflow-hidden > table {
    min-width: 720px;
  }
}

@media (max-width: 768px) {
  .home-update-grid {
    gap: 1rem;
  }

  .home-update-grid .home-update-card {
    min-height: 0;
    padding: 1.1rem;
  }

  .home-update-grid .home-step-index {
    top: -0.6rem;
    right: -0.55rem;
    height: 1.75rem;
    width: 1.75rem;
    font-size: 0.72rem;
  }

  .home-update-grid .home-step-icon {
    height: 2.6rem;
    width: 2.6rem;
    margin-bottom: 0.7rem;
  }

  [data-mobile-menu] [data-theme-toggle] {
    width: 100%;
    justify-content: flex-start;
    border: 1px solid hsl(var(--border) / 0.7);
    background: hsl(var(--background) / 0.35);
  }

  .glass:hover,
  [data-navbar-inner] a:hover,
  [data-navbar-inner] button:hover {
    transform: none;
  }

  .hero-ring-one {
    width: 82vw;
    height: 82vw;
    top: -14%;
    left: -34%;
  }

  .hero-ring-two {
    width: 70vw;
    height: 70vw;
    bottom: -15%;
    right: -26%;
  }
}

/* Custom scrollbar styling for tables */
.overflow-x-auto::-webkit-scrollbar {
  height: 6px;
}
.overflow-x-auto::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 99px;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}
.overflow-x-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] .overflow-x-auto::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme="light"] .overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .overflow-x-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Custom Form & Select Dropdown Styling */
select {
  background-color: hsl(var(--card)) !important;
  color: hsl(var(--foreground)) !important;
  border: 1px solid hsl(var(--border) / 0.8) !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1rem 1rem !important;
  padding-right: 2.25rem !important;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

select:hover {
  border-color: hsl(var(--border)) !important;
}

select:focus {
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.25) !important;
  outline: none !important;
}

select option, select optgroup {
  background-color: #121216 !important;
  color: #f1f5f9 !important;
  padding: 10px 14px !important;
  font-size: 0.875rem !important;
}

select optgroup {
  font-weight: 700 !important;
  color: #f43f5e !important;
  background-color: #0c0c10 !important;
}

html[data-theme="light"] select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}

html[data-theme="light"] select option,
html[data-theme="light"] select optgroup {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] select optgroup {
  color: #e11d48 !important;
  background-color: #f8fafc !important;
}
