/* ==========================================================================
   MyNetSpeedCheck - Luxe Crystal Glassmorphism Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Accent Color Palette */
  --accent-cyan: #00F2FE;
  --accent-cyan-deep: #0284C7;
  --accent-magenta: #F355DA;
  --accent-violet: #8B5CF6;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-crimson: #EF4444;

  /* Glass Tokens */
  --glass-bg-primary: rgba(255, 255, 255, 0.78);
  --glass-bg-secondary: rgba(255, 255, 255, 0.62);
  --glass-bg-solid: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-border-subtle: rgba(226, 232, 240, 0.75);
  --glass-shadow: 0 8px 30px -4px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  --glass-shadow-hover: 0 16px 40px -8px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.95) inset;
  --glass-shadow-glow: 0 8px 32px -4px rgba(0, 242, 254, 0.22);
}

body {
  font-family: var(--font-sans);
  background-color: #F8FAFC;
  color: #0F172A;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.font-mono-stat {
  font-family: var(--font-mono);
}

/* ==========================================================================
   Ambient Pastel Radial Gradients (Background)
   ========================================================================== */
.ambient-glow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.45;
  will-change: transform;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.glow-orb-1 {
  top: -10%;
  left: -5%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.32) 0%, rgba(56, 189, 248, 0.12) 50%, transparent 70%);
  animation-duration: 20s;
}

.glow-orb-2 {
  top: 10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(243, 85, 218, 0.22) 0%, rgba(139, 92, 246, 0.1) 50%, transparent 70%);
  animation-duration: 24s;
  animation-delay: -5s;
}

.glow-orb-3 {
  bottom: 5%;
  left: 20%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.16) 0%, rgba(0, 242, 254, 0.08) 50%, transparent 70%);
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(35px, 25px) scale(1.06);
  }
  100% {
    transform: translate(-25px, -15px) scale(0.96);
  }
}

/* Subtle Grid Dot Texture */
.ambient-dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.6;
}

/* ==========================================================================
   Luxe Crystal Glassmorphic Card Components
   ========================================================================== */
.crystal-glass {
  background: var(--glass-bg-primary);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.crystal-glass-subtle {
  background: var(--glass-bg-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-subtle);
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.02);
}

.crystal-card {
  position: relative;
  z-index: 1;
  background: var(--glass-bg-primary);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 1.125rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.crystal-card:hover,
.crystal-card:focus-within,
.crystal-card:has(.tooltip-trigger:hover) {
  z-index: 40;
  transform: translateY(-1.5px);
  box-shadow: var(--glass-shadow-hover);
  border-color: rgba(255, 255, 255, 1);
}

.crystal-card-interactive {
  cursor: pointer;
}

.crystal-card-interactive:active {
  transform: translateY(0);
}

/* Header Glass */
.crystal-nav {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 2px 20px -2px rgba(15, 23, 42, 0.03);
}

/* ==========================================================================
   Hero Speedometer & Arc Gauge Styles
   ========================================================================== */
.gauge-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.gauge-svg {
  filter: drop-shadow(0 6px 16px rgba(0, 242, 254, 0.12));
}

.gauge-bg-track {
  stroke: rgba(226, 232, 240, 0.8);
  stroke-linecap: round;
}

.gauge-progress-arc {
  stroke-linecap: round;
  stroke-dasharray: 361.28;
  stroke-dashoffset: 361.28;
  transition: stroke-dashoffset 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.45));
}

.gauge-needle {
  transform-origin: 150px 145px;
  transition: transform 0.35s cubic-bezier(0.34, 1.25, 0.64, 1);
}

/* Start Speed Test Button */
.btn-start-test {
  position: relative;
  background: linear-gradient(135deg, #00F2FE 0%, #38BDF8 38%, #818CF8 75%, #F355DA 100%);
  background-size: 200% 200%;
  color: #FFFFFF;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 24px -2px rgba(0, 242, 254, 0.38), 0 3px 10px rgba(243, 85, 218, 0.22);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: gradientShift 6s ease infinite;
}

.btn-start-test:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px -3px rgba(0, 242, 254, 0.5), 0 4px 15px rgba(243, 85, 218, 0.3);
}

.btn-start-test:active {
  transform: translateY(1px) scale(0.98);
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Live Pulse Ring */
.pulse-ring {
  position: absolute;
  inset: -5px;
  border-radius: 9999px;
  border: 2px solid rgba(0, 242, 254, 0.45);
  animation: pingRing 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes pingRing {
  0% {
    transform: scale(0.95);
    opacity: 0.75;
  }
  70% {
    transform: scale(1.22);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* ==========================================================================
   Badges & Glows
   ========================================================================== */
.badge-grade-a {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-grade-b {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-grade-c {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.crystal-pill {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

/* Gradient Title with Descender Protection */
.title-gradient {
  background: linear-gradient(135deg, #0284C7 0%, #6366F1 50%, #D946EF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 0.25rem;
  padding-right: 0.25rem;
  line-height: 1.25;
}

/* ==========================================================================
   Ad Placeholder Container Styling
   ========================================================================== */
.ad-slot-frame {
  background: rgba(248, 250, 252, 0.65);
  border: 1.5px dashed rgba(203, 213, 225, 0.8);
  border-radius: 0.875rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.ad-slot-frame:hover {
  border-color: rgba(148, 163, 184, 0.9);
}

.ad-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

/* Slim Skyscraper side ads */
.ad-skyscraper-slim {
  min-height: 480px;
  height: 100%;
  width: 100%;
  max-width: 160px;
}

/* ==========================================================================
   Interactive Range Slider (Download Calculator)
   ========================================================================== */
.custom-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(to right, #00F2FE 0%, #818CF8 50%, #E2E8F0 50%, #E2E8F0 100%);
  outline: none;
  transition: background 0.15s ease-in-out;
}

.custom-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #00F2FE;
  box-shadow: 0 2px 6px rgba(0, 242, 254, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.custom-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.custom-range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #00F2FE;
  box-shadow: 0 2px 6px rgba(0, 242, 254, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* ==========================================================================
   FAQ Layout (Static Cards)
   ========================================================================== */
.faq-item {
  transition: all 0.22s ease;
}
.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -4px rgba(0, 242, 254, 0.08);
}

/* ==========================================================================
   Custom Tooltips (Luxe Rounded Glass / Modern Dark Popover)
   ========================================================================== */
.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-bottom: none;
  vertical-align: middle;
  line-height: 1;
  outline: none;
  z-index: 20;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus-visible {
  z-index: 100;
}

.tooltip-trigger svg {
  display: block;
}

.tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: #0F172A;
  color: #F8FAFC;
  font-size: 0.725rem;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  white-space: normal;
  width: max-content;
  max-width: 200px;
  text-align: center;
  box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.4), 0 4px 10px -2px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 9999;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
}

.tooltip-trigger:hover .tooltip-bubble,
.tooltip-trigger:focus-visible .tooltip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #0F172A transparent transparent transparent;
}

/* ==========================================================================
   Table Styling
   ========================================================================== */
.crystal-table th {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #64748B;
  background: rgba(241, 245, 249, 0.6);
}

.crystal-table tr {
  transition: background-color 0.15s ease;
}

.crystal-table tr:hover {
  background-color: rgba(248, 250, 252, 0.85);
}

/* ==========================================================================
   Smooth Scrolling & Micro-Animations
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(0, 242, 254, 0.25);
  color: #0F172A;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}
