/* ==========================================
   Base styles & CSS Variables
   ========================================== */
:root {
  --color-bg: #1a1f1e;
  --color-card: #252b29;
  --color-text: #e8efe9;
  --color-muted: #6b7c72;
  --color-accent: #4ade80;
  --color-accent-hover: #22c55e;
  --color-warm: #fbbf24;
  --color-border: #3d4a44;
  --color-weather: #a8b5ad;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  line-height: inherit;
}

button {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* ==========================================
   Layout utilities
   ========================================== */
.bg-bg { background-color: var(--color-bg); }
.bg-card { background-color: var(--color-card); }
.bg-accent { background-color: var(--color-accent); }

.text-text { color: var(--color-text); }
.text-muted { color: var(--color-muted); }
.text-accent { color: var(--color-accent); }
.text-warm { color: var(--color-warm); }
.text-border { color: var(--color-border); }
.text-weather { color: var(--color-weather); }
.text-bg { color: var(--color-bg); }

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

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.h-8 { height: 2rem; }
.h-5 { height: 1.25rem; }
.h-32 { height: 8rem; }
.w-3\/4 { width: 75%; }
.w-1\/2 { width: 50%; }
.max-w-md { max-width: 28rem; }
.max-w-xs { max-width: 20rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none; }
.relative { position: relative; }
.fixed { position: fixed; }

.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.italic { font-style: italic; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-8 { margin-top: 2rem; }

.pt-12 { padding-top: 3rem; }
.pb-8 { padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.p-6 { padding: 1.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.border { border-width: 1px; border-style: solid; }
.border-border { border-color: var(--color-border); }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }

.opacity-0 { opacity: 0; }
.opacity-80 { opacity: 0.8; }

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }

.leading-relaxed { line-height: 1.625; }

/* Toast positioning */
.bottom-8 { bottom: 2rem; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }

/* Transitions */
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-opacity {
  transition-property: opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Space utilities */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ==========================================
   Responsive breakpoints
   ========================================== */
@media (min-width: 640px) {
  .sm\:pt-16 { padding-top: 4rem; }
  .sm\:p-8 { padding: 2rem; }
  .sm\:text-5xl { font-size: 3rem; line-height: 1; }
  .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
}

@media (min-width: 1024px) {
  .lg\:pt-20 { padding-top: 5rem; }
  .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

/* ==========================================
   Interactive states
   ========================================== */
.hover\:text-accent:hover { color: var(--color-accent); }
.hover\:text-text:hover { color: var(--color-text); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:bg-accent-hover:hover { background-color: var(--color-accent-hover); }

.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* ==========================================
   Component styles
   ========================================== */

/* Card entrance animation */
.animate-in {
  animation: fadeUp 0.4s ease-out;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loading shimmer */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-card) 25%,
    var(--color-border) 50%,
    var(--color-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Primary button */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-bg);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Map container */
.map-container {
  position: relative;
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
}

.map-container img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.6;
  filter: saturate(0.5);
}

.map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.05) 30%, var(--color-card) 80%);
  pointer-events: none;
}

.map-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.3);
  animation: pulse 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0.05); }
}

/* Rain background */
.rain-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cline x1='10' y1='0' x2='10' y2='15' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='30' y1='20' x2='30' y2='35' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='50' y1='5' x2='50' y2='20' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='70' y1='30' x2='70' y2='45' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='90' y1='10' x2='90' y2='25' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='20' y1='50' x2='20' y2='65' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='40' y1='60' x2='40' y2='75' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='60' y1='45' x2='60' y2='60' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='80' y1='70' x2='80' y2='85' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='5' y1='80' x2='5' y2='95' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='45' y1='85' x2='45' y2='100' stroke='%234ade80' stroke-width='1'/%3E%3Cline x1='95' y1='55' x2='95' y2='70' stroke='%234ade80' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  animation: rainFall 2s linear infinite;
}

@keyframes rainFall {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus states */
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* State transitions */
#loading-state,
#content-state,
#error-state {
  transition: opacity 0.2s ease-out;
}

#header-text,
#loading-message {
  transition: opacity 0.3s ease-out;
}
