@tailwind base;
@tailwind components;
@tailwind utilities;

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  margin: 0;
}

#root {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

section {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  min-height: 100vh;
  position: relative;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.gradient-text {
  background: linear-gradient(to right, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  background: linear-gradient(to right, #6366f1, #9333ea);
  color: white;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(to right, #818cf8, #a855f7);
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  border: 1px solid #475569;
  color: #cbd5e1;
  font-weight: 600;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}
.btn-secondary:hover {
  border-color: #a855f7;
  color: #d8b4fe;
}

.glass-card {
  border-radius: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  transition: all 0.5s;
}
.glass-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

.badge-done {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(52, 211, 153, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-progress {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-planned {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(71, 85, 105, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(71, 85, 105, 0.3);
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

@keyframes pulse-slow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.delay-1000 { animation-delay: 1s; }

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Pill badge */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.1);
  backdrop-filter: blur(4px);
}

/* Tables */
.snap-table { width: 100%; }
.snap-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1e293b;
}
.snap-table td {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.snap-table tr:hover { background: rgba(30, 41, 59, 0.3); }

/* Chart containers */
.chart-container { width: 100%; height: 300px; }

/* Counter animation */
.counter-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: white;
}

/* Tooltip */
.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
}
.has-tooltip:hover .tooltip { opacity: 1; }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s;
}

@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  #root {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    scroll-snap-type: none;
  }

  section {
    min-height: auto;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  #hero {
    min-height: 100svh;
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  #scroll-nav {
    display: none;
  }

  .glass-card {
    min-width: 0;
    border-radius: 0.875rem;
  }

  .snap-table {
    min-width: 640px;
  }

  .snap-table th,
  .snap-table td {
    padding: 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .chart-container {
    height: 260px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .pill {
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }

  .tooltip {
    display: none;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 3.5rem !important;
    line-height: 1;
  }

  h2 {
    font-size: 2rem !important;
    line-height: 1.15;
  }

  section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .glass-card {
    padding: 1.25rem !important;
  }

  .chart-container {
    height: 220px;
  }
}
