/* WiFi Dead Zone Finder - Stripe-inspired Design */

:root {
  /* Core colors */
  --white: #ffffff;
  --black: #0a2540;
  --gray-50: #f6f9fc;
  --gray-100: #e3e8ee;
  --gray-200: #c1c9d2;
  --gray-400: #8898aa;
  --gray-500: #697386;
  --gray-600: #525f7f;
  --gray-900: #1a1f36;

  /* Accent */
  --purple: #635bff;
  --purple-light: #7a73ff;
  --cyan: #00d4ff;
  --pink: #ff49db;
  --orange: #ff7849;

  /* Signal colors */
  --green: #0cce6b;
  --yellow: #f5be31;
  --red: #ed5f74;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, sans-serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-600);
  background: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Gradient background accent - very subtle */
.gradient-bg {
  position: fixed;
  top: -60%;
  right: -40%;
  width: 70%;
  height: 80%;
  background: linear-gradient(135deg,
    rgba(99, 91, 255, 0.06) 0%,
    rgba(255, 73, 219, 0.04) 50%,
    rgba(255, 120, 73, 0.03) 100%
  );
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
}

/* App container */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-6);
  padding-bottom: calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
}

/* Header */
.header {
  padding: var(--space-8) 0 var(--space-10);
}

.header-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--purple);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-bottom: var(--space-3);
}

.header h1 span {
  background: linear-gradient(90deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  font-size: 17px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Navigation */
.nav {
  display: flex;
  gap: var(--space-1);
  background: var(--white);
  border: 1px solid var(--gray-100);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
}

.nav-btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--gray-500);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  color: var(--gray-600);
}

.nav-btn.active {
  color: var(--purple);
  background: rgba(99, 91, 255, 0.08);
  font-weight: 600;
}

/* Card */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
}

/* Location input section */
.location-section {
  margin-bottom: var(--space-6);
}

.location-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-3);
  display: block;
}

.location-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.location-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.location-input {
  flex: 1;
  height: 40px;
  padding: 0 var(--space-4);
  font-size: 15px;
  font-family: inherit;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.15s ease;
}

.location-input:hover {
  border-color: var(--gray-400);
}

.location-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.location-input::placeholder {
  color: var(--gray-400);
}

/* Test button */
.test-btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.test-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.4);
}

.test-btn:active {
  transform: translateY(0);
}

.test-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Progress */
.progress-section {
  display: none;
  padding: var(--space-8) 0;
  text-align: center;
}

.progress-section.active {
  display: block;
}

.progress-bar-container {
  height: 6px;
  background: rgba(99, 91, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--pink) 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 14px;
  color: var(--gray-500);
}

/* Result section */
.result-section {
  display: none;
  text-align: center;
  padding: var(--space-4) 0;
}

.result-section.active {
  display: block;
}

.score-display {
  margin-bottom: var(--space-6);
}

.score-value {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--black);
  margin-bottom: var(--space-1);
}

.score-label {
  font-size: 14px;
  color: var(--gray-400);
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.rating-description {
  font-size: 15px;
  color: var(--gray-500);
  max-width: 280px;
  margin: 0 auto;
}

/* Metrics row */
.metrics-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-5) 0;
  margin: var(--space-5) 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.metric {
  text-align: center;
  flex: 1;
}

.metric-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: var(--space-1);
}

.metric-label {
  font-size: 12px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Action buttons */
.actions {
  display: flex;
  gap: var(--space-3);
}

.btn {
  flex: 1;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  color: white;
  background: var(--purple);
  border: none;
}

.btn-primary:hover {
  background: var(--purple-light);
}

.btn-secondary {
  color: var(--gray-600);
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Results list */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.results-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
}

.results-count {
  font-size: 13px;
  color: var(--gray-400);
}

/* Results table */
.results-table {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.results-table-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border-top: 1px solid var(--gray-100);
  transition: background 0.1s ease;
}

.result-row:hover {
  background: rgba(99, 91, 255, 0.02);
}

.result-location {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.result-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
}

.result-rating {
  font-size: 13px;
  color: var(--gray-500);
}

.result-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  min-width: 36px;
  text-align: right;
}

.result-delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: all 0.15s ease;
}

.result-row:hover .result-delete {
  opacity: 1;
}

.result-delete:hover {
  background: rgba(237, 95, 116, 0.1);
  color: var(--red);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.8;
}

.empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: var(--space-2);
}

.empty-text {
  font-size: 14px;
  color: var(--gray-500);
}

/* Insights section */
.insights-section {
  margin-top: var(--space-8);
}

.insights-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.insight-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
}

.insight-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: var(--space-1);
}

.insight-text {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Color utilities */
.bg-green { background: rgba(12, 206, 107, 0.12); color: #0a9e52; }
.bg-yellow { background: rgba(245, 190, 49, 0.15); color: #b8860b; }
.bg-red { background: rgba(237, 95, 116, 0.12); color: #d63d5a; }
.bg-purple { background: rgba(99, 91, 255, 0.12); color: var(--purple); }

/* Responsive */
@media (max-width: 400px) {
  .app {
    padding: var(--space-4);
  }

  .header h1 {
    font-size: 28px;
  }

  .score-value {
    font-size: 56px;
  }

  .metrics-row {
    gap: var(--space-2);
  }

  .actions {
    flex-direction: column;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #0a0a0a;
    --black: #ffffff;
    --gray-50: #1a1a1a;
    --gray-100: #2a2a2a;
    --gray-200: #3a3a3a;
    --gray-400: #888888;
    --gray-500: #999999;
    --gray-600: #aaaaaa;
    --gray-900: #f0f0f0;
  }

  .gradient-bg {
    opacity: 0.6;
  }
}
