/* Reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --yellow-50: #fefce8;
  --yellow-100: #fef9c3;
  --yellow-500: #eab308;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-800); background: var(--white); line-height: 1.6; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--blue-600); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--white) 100%);
  padding: 60px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

/* Planner */
.planner {
  padding: 40px 0;
}

.planner-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .planner-grid { grid-template-columns: 1fr; }
}

.input-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 80px;
}

.input-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--gray-900);
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 6px;
}

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

.input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--white);
}

.input-row input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-100);
}

.btn-primary {
  padding: 10px 18px;
  background: var(--blue-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
}

.btn-primary:hover { background: var(--blue-700); }
.btn-primary:active { transform: scale(0.98); }

.presets {
  margin-top: 20px;
}

.presets-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-preset {
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  color: var(--gray-700);
}

.btn-preset:hover {
  background: var(--blue-50);
  border-color: var(--blue-200);
  color: var(--blue-700);
}

.saved-location {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.btn-text {
  background: none;
  border: none;
  color: var(--blue-600);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font);
  padding: 0;
}

.btn-text:hover { text-decoration: underline; }

/* Results panel */
.results-panel {
  min-height: 300px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state h3 {
  margin: 16px 0 8px;
  color: var(--gray-700);
}

.empty-state p {
  max-width: 360px;
  margin: 0 auto;
}

.forecast-results { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.results-header h2 {
  font-size: 1.3rem;
  color: var(--gray-900);
}

.result-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font);
  color: var(--gray-700);
}

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

/* Best window */
.best-window {
  background: linear-gradient(135deg, var(--green-50), var(--green-100));
  border: 2px solid var(--green-500);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.best-badge {
  display: inline-block;
  background: var(--green-600);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.best-details {
  display: flex;
  gap: 16px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-700);
  margin-bottom: 8px;
}

.best-window p {
  color: var(--gray-700);
  font-size: 0.95rem;
}

/* Day cards */
.day-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .day-cards { grid-template-columns: 1fr; }
}

.day-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.day-card.best {
  border-color: var(--green-500);
  box-shadow: 0 0 0 2px var(--green-100);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.day-header h3 {
  font-size: 1.1rem;
  color: var(--gray-900);
}

.day-date {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.day-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.day-rating {
  text-align: center;
  padding: 8px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
}

.rating-great {
  background: var(--green-50);
  color: var(--green-700);
}

.rating-ok {
  background: var(--yellow-50);
  color: #854d0e;
}

.rating-poor {
  background: var(--red-50);
  color: var(--red-500);
}

/* Scenario walkthrough */
.scenario-walkthrough {
  background: var(--gray-50);
  padding: 60px 0;
}

.scenario-walkthrough h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 32px;
  color: var(--gray-900);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 760px) {
  .scenario-grid { grid-template-columns: 1fr; }
}

.scenario-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.scenario-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.scenario-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.scenario-card p {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Tips section */
.tips-section {
  padding: 60px 0;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 700px) {
  .tips-grid { grid-template-columns: 1fr; }
}

.tips-block h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--gray-900);
}

.tips-block ul {
  list-style: none;
  padding: 0;
}

.tips-block li {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.tips-block li:last-child { border-bottom: none; }

/* FAQ */
.faq-section {
  background: var(--gray-50);
  padding: 60px 0;
}

.faq-section h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 32px;
  color: var(--gray-900);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-list details {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-list summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-800);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--gray-400);
  transition: transform 0.2s;
}

.faq-list details[open] summary::after {
  content: '−';
}

.faq-list details p {
  padding: 0 20px 16px;
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Why section */
.why-section {
  padding: 60px 0;
}

.why-content {
  max-width: 720px;
  margin: 0 auto;
}

.why-content h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: var(--gray-900);
}

.why-content p {
  font-size: 1rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 16px;
}

.last-updated {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 24px;
}

/* Footer */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 40px 0 24px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-logo {
  font-weight: 700;
  color: var(--white);
  font-size: 1.1rem;
}

.footer-brand p {
  font-size: 0.9rem;
  margin-top: 8px;
  max-width: 300px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--gray-400);
  font-size: 0.9rem;
}

.footer-links a:hover { color: var(--white); }

.footer-note {
  font-size: 0.8rem;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--gray-800);
}

.footer-note a { color: var(--gray-300); }

/* Print */
@media print {
  .site-header, .site-footer, .input-panel, .result-actions, .presets, .saved-location { display: none; }
  .planner-grid { display: block; }
  .best-window { border: 2px solid #000; background: #fff; }
  .day-card { break-inside: avoid; }
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
