:root {
  --bg-dark: #090D16;
  --card-bg: #131A2A;
  --card-border: #1E293B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent-gold: #F59E0B;
  --accent-amber: #D97706;
  --accent-neon: #38BDF8;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-purple: #A855F7;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(19, 26, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(90deg, #FDE68A, #F59E0B, #FB923C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

.live-dot.pulse {
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Container */
.main-container {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* User Card */
.user-status-card {
  background: linear-gradient(180deg, #182238 0%, #131A2A 100%);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.user-info-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-box {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-details h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  overflow-wrap: anywhere;
}

.venue-line {
  font-size: 13px;
  color: var(--accent-neon);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-line {
  font-size: 13px;
  color: #CBD5E1;
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battery-tag {
  font-size: 13px;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.8);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  color: #E2E8F0;
  flex-shrink: 0;
}

/* Metrics Grid */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.bac-display {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

#bacValue {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #F8FAFC;
}

.zone-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.zone-badge.sober {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.zone-badge.buzzed {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.zone-badge.tipsy {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.zone-badge.drunk {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.timer-display span {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-gold);
}

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Alert Box */
.alert-box {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-icon {
  font-size: 20px;
}

.alert-content strong {
  font-size: 13px;
  color: #FCA5A5;
  display: block;
}

.alert-content p {
  font-size: 12px;
  color: #E2E8F0;
  margin-top: 2px;
}

/* Map Card */
.map-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.map-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--card-border);
}

.map-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #E2E8F0;
}

.map-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.map-canvas {
  height: 320px;
  width: 100%;
  background: #111827;
}

.map-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid var(--card-border);
}

.coords-text {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

#recenterBtn {
  min-height: 44px;
}

.leaflet-touch .leaflet-bar a {
  width: 44px;
  height: 44px;
  line-height: 44px;
}

/* Actions Section */
.actions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ride-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-uber {
  background: #000000;
  color: #FFFFFF;
  border: 1px solid #333333;
}

.btn-uber:hover {
  background: #1A1A1A;
  transform: translateY(-2px);
}

.btn-lyft {
  background: linear-gradient(135deg, #FF00BF, #D900A3);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(255, 0, 191, 0.3);
}

.btn-lyft:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-texts {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.btn-label {
  font-size: 14px;
  line-height: 1.2;
}

.btn-sub {
  font-size: 10px;
  opacity: 0.8;
  font-weight: 400;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #1E293B;
  border-color: #334155;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}

/* Button styled as a footer link (used for Cookie Settings) */
.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* Home / Hero View */
.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-beer {
  font-size: 54px;
  margin-bottom: 12px;
  display: inline-block;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #FDE68A, #F59E0B, #FB923C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 24px auto;
}

.session-input-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: left;
}

.session-input-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: #FFFFFF;
}

.session-input-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  min-width: 0;
  background: #0B0F19;
  border: 1px solid #334155;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
}

.input-row input:focus {
  border-color: var(--accent-gold);
}

.btn-primary {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000000;
  font-weight: 800;
  padding: 12px 20px;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
}

.feature-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 16px;
  padding: 16px;
}

.f-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.feature-card h4 {
  font-size: 14px;
  color: #F8FAFC;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(30, 41, 59, 0.5);
  margin-top: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

.disclaimer {
  font-size: 10px;
  color: #475569;
  max-width: 500px;
  margin: 6px auto 0 auto;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2000;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  margin: 0 auto;
  background: rgba(19, 26, 42, 0.97);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-text {
  flex: 1 1 240px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-banner-text strong {
  color: var(--text-primary);
  font-size: 13px;
}

.cookie-banner-text a {
  color: var(--accent-neon);
  font-weight: 600;
}

.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Screenshots Section */
.screenshots-section {
  margin-top: 60px;
  text-align: center;
}

.screenshots-section .section-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 8px;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 30px;
  text-align: left;
}

.screenshot-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.screenshot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.screenshot-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #0B0F19;
}

.screenshot-card h4 {
  font-size: 14px;
  color: #F8FAFC;
  padding: 12px 14px 4px;
  font-weight: 600;
}

.screenshot-card p {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 14px 14px;
  line-height: 1.4;
}

/* Wear OS Section */
.wear-section {
  margin-top: 60px;
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--card-border);
}

.wear-section .section-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 8px;
}

.wear-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Support / Donate */
.support-section {
  margin-top: 40px;
  padding: 28px 20px;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 18px;
}

.support-section .section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 8px;
}

.support-text {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 16px auto;
}

.btn-bmc {
  background: linear-gradient(135deg, #FFDD00, #FFAA00);
  color: #000000;
  display: inline-flex;
  box-shadow: 0 4px 14px rgba(255, 221, 0, 0.3);
}

.btn-bmc:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.support-line {
  margin: 8px auto 0 auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.support-line a,
.app-footer .support-line a {
  color: var(--accent-gold);
  font-weight: 700;
  text-decoration: none;
}

.support-line a:hover {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .input-row {
    flex-direction: column;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .ride-buttons-row,
  .secondary-actions {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .screenshots-grid {
    grid-template-columns: 1fr;
  }
}
