/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #242f45;
  --accent-primary: #3b82f6;
  --accent-secondary: #00ffaa;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #00ffaa);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #2d3a52;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  background-image: radial-gradient(
      ellipse at top,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at bottom right,
      rgba(139, 92, 246, 0.08) 0%,
      transparent 50%
    );
}

/* ===== Container ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 2.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* ===== Countdown Section ===== */
.countdown-section {
  margin-bottom: 2.5rem;
}

.countdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.countdown-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.countdown-label {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.time-value {
  font-size: 4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 100px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.time-separator {
  font-size: 3rem;
  color: var(--text-muted);
  font-weight: 300;
}

.countdown-labels {
  display: flex;
  justify-content: center;
  gap: 4.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.confidence-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.confidence-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

.confidence-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.observation-count {
  color: var(--text-muted);
}

/* ===== Stats Section ===== */
.stats-section {
  margin-bottom: 2.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Observations Section ===== */
.observations-section {
  margin-bottom: 2rem;
}

.observations-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.observations-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.observations-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.observations-table th,
.observations-table td {
  padding: 0.875rem 1rem;
  text-align: left;
}

.observations-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.observations-table tbody tr {
  border-top: 1px solid var(--border-color);
  transition: background 0.15s;
}

.observations-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.observations-table td {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.observations-table .server-id {
  font-family: "Monaco", "Consolas", monospace;
  color: var(--accent-primary);
}

.observations-table .day-value {
  color: var(--text-primary);
  font-weight: 600;
}

.loading-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.api-status {
  margin-top: 0.5rem;
}

.status-indicator {
  font-weight: 500;
}

.status-indicator.online {
  color: var(--success);
}

.status-indicator.offline {
  color: var(--error);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .logo h1 {
    font-size: 1.75rem;
  }

  .time-value {
    font-size: 2.5rem;
    min-width: 60px;
  }

  .time-separator {
    font-size: 2rem;
  }

  .countdown-labels {
    gap: 2.5rem;
    font-size: 0.75rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
