/* Best Golf Day - Main Stylesheet */

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

:root {
  --primary-green: #15803d;
  --primary-dark: #166534;
  --primary-light: #16a34a;
  --accent-gold: #d97706;
  --accent-yellow: #fbbf24;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: white;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =====================
   HEADER
   ===================== */
header {
  background: var(--primary-green);
  color: white;
  padding: 1rem 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

.logo .logo-icon {
  font-size: 1.5rem;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  transition: opacity 0.2s;
  padding: 0.5rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  -webkit-tap-highlight-color: transparent;
}

nav a:hover {
  opacity: 0.8;
}

nav a.active {
  font-weight: 700;
  border-bottom: 2px solid var(--accent-yellow);
}

/* Hamburger menu for mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* =====================
   WEATHER PAGE
   ===================== */
.weather-container {
  min-height: 100vh;
  background: var(--gray-50);
  padding-top: 5.5rem;
  padding-bottom: 3rem;
}

.page-header {
  text-align: center;
  padding: 2rem 0 1rem;
}

.page-header h1 {
  font-size: 2.5rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--gray-600);
  font-size: 1.1rem;
}

/* Search Form */
.search-form {
  max-width: 800px;
  margin: 0 auto 2.5rem;
}

.search-box {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--gray-300);
  border-radius: 0.5rem;
  outline: none;
  background: white;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  gap: 0.5rem;
}

.btn-green {
  background: var(--primary-green);
  color: white;
}

.btn-green:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
  font-size: 0.9rem;
  padding: 0.625rem 1.25rem;
}

.btn-outline:hover {
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.btn-location {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
  font-size: 0.9rem;
  padding: 0.625rem 1.25rem;
  white-space: nowrap;
}

.btn-location:hover {
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.search-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Current Location Display */
#currentLocation {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--gray-600);
  font-size: 1.1rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--gray-600);
}

.spinner {
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-green);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-600);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* =====================
   WEATHER CARDS
   ===================== */
.weather-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.weather-results-header h2 {
  font-size: 1.25rem;
  color: var(--gray-800);
}

.sort-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  background: white;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
}

.weather-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s;
}

.weather-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.weather-card.excellent {
  background: var(--primary-green);
  color: white;
  border-color: var(--primary-dark);
}

.weather-card.good {
  background: #f0fdf4;
  border: 2px solid #86efac;
}

.weather-card.fair {
  background: #fffbeb;
  border: 2px solid #fde047;
}

.weather-card.poor {
  background: #fff1f2;
  border: 2px solid #fca5a5;
}

/* Best Day Badge */
.best-day-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-yellow);
  color: var(--gray-900);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.weather-date-info {
  flex: 1;
}

.weather-date {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  font-family: 'Poppins', sans-serif;
}

.weather-condition {
  font-size: 0.9rem;
  opacity: 0.85;
  text-transform: capitalize;
}

.weather-score {
  text-align: right;
  flex-shrink: 0;
}

.score-number {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  font-family: 'Poppins', sans-serif;
}

.score-label {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.condition-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Weather Metrics Grid */
.weather-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.weather-card.excellent .weather-metrics {
  border-top-color: rgba(255, 255, 255, 0.25);
}

.metric {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metric-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.metric-label {
  font-size: 0.7rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-value {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Weather description */
.weather-description {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  opacity: 0.85;
  text-transform: capitalize;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.weather-card.excellent .weather-description {
  border-top-color: rgba(255, 255, 255, 0.25);
}

/* =====================
   APP DOWNLOAD SECTION
   ===================== */
.app-section {
  background: var(--gray-900);
  color: white;
  padding: 2.5rem 0;
  margin-top: 3rem;
}

.app-section .container {
  text-align: center;
}

.app-section h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: white;
}

.app-section p {
  color: var(--gray-400);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.app-badges {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.5rem;
}

.store-badge-link {
  display: inline-block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 2px rgba(255,255,255,0.15);
}

.store-badge-link:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 10px 36px rgba(0,0,0,0.6), 0 0 0 3px rgba(255,255,255,0.3);
}

.store-badge-img {
  height: 80px;
  width: auto;
  display: block;
  border-radius: 12px;
}

/* Legacy fallback */
.app-badges a {
  display: inline-block;
  transition: transform 0.2s, opacity 0.2s;
}

.app-badges a:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.app-badges img:not(.store-badge-img) {
  height: 72px;
  width: auto;
}

/* =====================
   FOOTER
   ===================== */
footer {
  background: var(--gray-900);
  color: var(--gray-400);
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
}

footer a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: white;
}

footer .footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* =====================
   PRIVACY POLICY PAGE
   ===================== */
.privacy-container {
  min-height: 100vh;
  background: white;
  padding-top: 5.5rem;
  padding-bottom: 4rem;
}

.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.privacy-content h1 {
  font-size: 2.25rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.privacy-content .last-updated {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.privacy-content h2 {
  font-size: 1.35rem;
  color: var(--primary-green);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.privacy-content p {
  color: var(--gray-700);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.privacy-content ul {
  color: var(--gray-700);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.privacy-content ul li {
  margin-bottom: 0.4rem;
}

.privacy-content a {
  color: var(--primary-green);
  text-decoration: underline;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }

  nav.open {
    display: flex;
  }

  nav a {
    padding: 0.875rem 1.5rem;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .page-header h1 {
    font-size: 1.875rem;
  }

  .search-box {
    flex-direction: column;
  }

  .weather-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .score-number {
    font-size: 2.25rem;
  }

  .weather-date {
    font-size: 1.2rem;
  }

  .app-section h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .weather-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .weather-card {
    padding: 1.25rem;
  }

  .privacy-content h1 {
    font-size: 1.75rem;
  }
}

/* =====================
   ADSENSE PLACEHOLDER
   ===================== */
.ad-slot {
  text-align: center;
  margin: 1.5rem auto;
  max-width: 900px;
  min-height: 90px;
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.8rem;
}

/* =====================
   BACKLINK CLUSTER
   ===================== */
.backlink-cluster {
  background: #f0fdf4;
  border-top: 3px solid var(--primary-green);
  padding: 2rem 0;
}

.backlink-cluster .container {
  max-width: 900px;
}

.backlink-cluster-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.backlink-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
  align-items: center;
}

.backlink-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: white;
  border: 1px solid #bbf7d0;
  border-radius: 2rem;
  padding: 0.4rem 0.875rem;
  text-decoration: none;
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.backlink-item:hover {
  background: var(--primary-green);
  color: white;
  border-color: var(--primary-green);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(21, 128, 61, 0.25);
}

.backlink-item .bl-icon {
  font-size: 1rem;
}

@media (max-width: 480px) {
  .backlink-item {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }
}

/* How It Works Grid - always 4 columns on one row */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  text-align: center;
}

.how-it-works-grid > div {
  padding: 1.25rem 1rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
  .how-it-works-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    overflow-x: auto;
  }
  .how-it-works-grid > div {
    padding: 0.875rem 0.5rem;
    min-width: 80px;
  }
  .how-it-works-grid > div p {
    font-size: 0.75rem !important;
  }
  .how-it-works-grid > div h3 {
    font-size: 0.85rem !important;
  }
}

/* Utility */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
