/* Base styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Layout components */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-header {
  background-color: #2c3e50;
  padding: 1rem;
  color: white;
  width: 100%;
  position: relative;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 0;
}

.title-icon {
  height: 2rem;
  width: auto;
  margin: 0;
}

.app-title {
  margin: 0;
  font-size: 1.5rem;
  padding-left: 0.25rem;
}

.footer-link {
  color: #ffd700;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #ffed4e;
}

/* Hamburger menu button - hidden on desktop */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  position: relative;
}

.hamburger-icon {
  width: 28px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Navigation */
.nav-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: #34495e;
}

/* Ko-fi Button */
.kofi-button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ff5e5b 0%, #ff4747 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 71, 71, 0.3);
  white-space: nowrap;
}

.kofi-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 71, 71, 0.4);
  background: linear-gradient(135deg, #ff4747 0%, #ff3333 100%);
}

.kofi-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.kofi-text {
  line-height: 1;
}

/* Promotional Banner */
.promo-banner {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  width: 100%;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 90;
}

.promo-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.promo-text-container {
  text-align: center;
}

.promo-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.promo-link {
  color: white;
  text-decoration: underline;  /* Always show underline */
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.promo-link:hover {
  color: #fff;
  text-decoration-thickness: 3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main content area */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* Map container styles */
.map-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  height: 50vh !important;
  min-height: 400px;
  margin: 0 auto !important;
}

/* Table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.dash-table-container {
  width: 100% !important;
  overflow-x: auto;
}

/* SNOTEL column styling - blue, no underline, clickable appearance */
.dash-table-container .dash-cell[data-dash-column="SNOTEL"],
.dash-table-container td[data-dash-column="SNOTEL"] {
  color: #1f77b4;
  cursor: pointer;
}

.dash-table-container .dash-cell[data-dash-column="SNOTEL"]:hover,
.dash-table-container td[data-dash-column="SNOTEL"]:hover {
  color: #0d5aa7;
}

/* Align 7 Day Forecast column to the right */
.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"],
.dash-table-container td[data-dash-column="7 Day Forecast"],
.dash-table-container .dash-header[data-dash-column="7 Day Forecast"],
.dash-table-container th[data-dash-column="7 Day Forecast"] {
  text-align: right;
}

/* Reset paragraph styling ONLY in 7 Day Forecast column */
.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] .cell-markdown p,
.dash-table-container td[data-dash-column="7 Day Forecast"] .cell-markdown p {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
  line-height: inherit;
  font-weight: inherit;
  text-align: right;
}

/* Forecast link styling - blue to indicate link, no underline by default */
.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a,
.dash-table-container td[data-dash-column="7 Day Forecast"] a {
  color: #1f77b4;
  text-decoration: none;
  font-weight: normal;
  font-size: 14px;
  font-family: inherit;
  line-height: inherit;
  transition: color 0.2s ease;
  cursor: pointer;
}

.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a:hover,
.dash-table-container td[data-dash-column="7 Day Forecast"] a:hover {
  color: #0d5aa7;
  text-decoration: underline;
}

/* Footer styles */
.app-footer {
  background-color: #2c3e50;
  color: white;
  padding: 1rem;
  margin-top: auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  width: 100%;
}

.footer-text {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.header-spacer {
  display: block;
}

/* ========================================================================== */
/* FORECAST PAGE SPECIFIC STYLES */
/* ========================================================================== */

/* Forecast page base */
.forecast-main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Forecast dropdown */
.forecast-location-select {
  font-size: 1.1em !important;
  padding: 10px 12px !important;
  border-radius: 8px;
  border: 2px solid #cbd5e0 !important;
  margin-bottom: 20px;
}

/* Snow summary box */
.snow-summary {
  background: linear-gradient(135deg, #ffffff 0%, #ebf8ff 100%);
  border-radius: 12px;
  padding: 20px 25px;
  margin-bottom: 20px;
  border: 2px solid #4299e1;
  box-shadow: 0 4px 12px rgba(66,153,225,0.2);
}

.snow-summary h2 {
  color: #2c5282;
  margin: 0 0 15px 0;
  font-size: 1.5em;
  text-align: center;
}

.snow-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 650px;
  margin: 0 auto;
}

.snow-stat {
  text-align: center;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.snow-stat-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #2c5282;
  margin: 0;
  line-height: 1.1;
}

.snow-stat-label {
  font-size: 0.8em;
  color: #718096;
  margin-top: 3px;
  font-weight: 500;
}

.no-snow {
  text-align: center;
  padding: 15px;
  color: #718096;
}

/* Forecast cards */
.forecast-cards-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forecast-card {
  background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  min-height: 85px;
  position: relative;
}

.forecast-card::after {
  content: '▼';
  position: absolute;
  right: 15px;
  bottom: 10px;
  font-size: 0.8em;
  color: #a0aec0;
  transition: color 0.2s ease;
}

.forecast-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateX(4px);
}

.forecast-card:hover::after {
  color: #667eea;
}

.forecast-card:active {
  background: linear-gradient(135deg, #e2e8f0 0%, #edf2f7 100%);
}

.forecast-card-snow {
  background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
  border-left: 5px solid #4299e1;
}

/* Card internals */
.card-icon {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
}

.card-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.card-day-name {
  font-size: 1.3em;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
}

.card-short-forecast {
  font-size: 0.95em;
  color: #4a5568;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-temps {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 60px;
}

.temp-high {
  font-size: 1.3em;
  font-weight: 700;
  color: #e53e3e;
}

.temp-low {
  font-size: 1.3em;
  font-weight: 600;
  color: #4299e1;
}

.temp-label {
  font-size: 0.75em;
  color: #718096;
  font-weight: 500;
}

.snow-badge {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
  box-shadow: 0 2px 4px rgba(66,153,225,0.3);
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
  }
  
  .app-header {
    padding: 1rem 0.5rem;
  }
  
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: left;
    padding: 0 0.5rem;
    width: 100%;
  }
  
  .app-title {
    font-size: 1.2rem;
    margin: 0;
  }
  
  /* Hide spacer on mobile */
  .header-spacer {
    display: none;
  }
  
  /* Show hamburger menu on mobile */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    margin-right: 0.5rem;
  }
  
  .hamburger-icon {
    width: 28px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
  }
  
  /* Mobile navigation container */
  .nav-container {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background-color: #2c3e50;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    width: 100%;
  }
  
  .nav-container.active {
    max-height: 500px;
  }
  
  /* Mobile navigation */
  .nav-links {
    position: static;
    flex-direction: column;
    gap: 0;
    width: 100%;
    box-shadow: none;
  }
  
  .nav-links.active {
    max-height: none;
  }
  
  .nav-link {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 0;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    box-sizing: border-box;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  /* Ko-fi button on mobile */
  .kofi-button {
    width: calc(100% - 3rem);
    margin: 1rem 1.5rem;
    justify-content: center;
    box-sizing: border-box;
  }
  
  /* Promo banner mobile styles */
  .promo-banner {
    padding: 0.4rem 0.5rem;
  }
  
  .promo-content {
    padding: 0 0.5rem;
  }
  
  .promo-icon {
    display: none;
  }
  
  .promo-heading {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .promo-link {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
  }
  
  /* Mobile page content - Title and Set Home button */
  .main-content h2 {
    font-size: 1.3rem;
    margin: 0;
    flex: 1;
    min-width: 0;
  }
  
  /* Adjust the flexbox container for title + button on mobile */
  .main-content > div > div:first-child {
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 15px !important;
  }
  
  /* Make Set Home button more compact on mobile */
  #set-home-button {
    font-size: 0.8rem !important;
    padding: 6px 10px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .map-container {
    width: 100% !important;
    height: 50vh !important;
    min-height: 350px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Table scrolling - FIXED */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  
  .dash-table-container {
    width: 100% !important;
    overflow-x: auto;
  }
  
  /* Don't break table structure on mobile */
  table {
    width: 100% !important;
    table-layout: auto;
  }
  
  /* Remove hyperlink styling from SNOTEL column on mobile only */
  .dash-table-container .dash-cell[data-dash-column="SNOTEL"],
  .dash-table-container td[data-dash-column="SNOTEL"],
  .dash-table-container .dash-header[data-dash-column="SNOTEL"],
  .dash-table-container th[data-dash-column="SNOTEL"] {
    color: inherit !important;
    cursor: default !important;
  }
  
  /* Keep 7 Day Forecast links working on mobile with right alignment */
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"],
  .dash-table-container td[data-dash-column="7 Day Forecast"],
  .dash-table-container .dash-header[data-dash-column="7 Day Forecast"],
  .dash-table-container th[data-dash-column="7 Day Forecast"] {
    text-align: right !important;
  }
  
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] .cell-markdown p,
  .dash-table-container td[data-dash-column="7 Day Forecast"] .cell-markdown p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
    line-height: inherit;
    font-weight: inherit;
    text-align: right;
  }
  
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a,
  .dash-table-container td[data-dash-column="7 Day Forecast"] a {
    color: #1f77b4 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    font-weight: normal;
    font-size: 14px;
    font-family: inherit;
    line-height: inherit;
  }
  
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a:hover,
  .dash-table-container td[data-dash-column="7 Day Forecast"] a:hover {
    color: #0d5aa7 !important;
    text-decoration: underline !important;
  }
  
  .footer-text {
    font-size: 0.8rem;
  }
  
  /* Forecast page mobile styles */
  .forecast-main-container {
    padding: 0;
  }
  
  .forecast-card {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .forecast-card::after {
    font-size: 0.9em;
    right: 10px;
  }
  
  .card-icon {
    width: 60px;
    height: 60px;
  }
  
  .card-day-name {
    font-size: 1.1em;
  }
  
  .card-short-forecast {
    font-size: 0.9em;
  }
  
  .card-temps {
    min-width: 55px;
  }
  
  .snow-summary-grid {
    max-width: 100%;
  }
  
  .snow-stat {
    padding: 10px;
  }
  
  .snow-stat-value {
    font-size: 1.6em;
  }
  /* Force collapsed state for forecast cards */
  .forecast-cards-row .collapse:not(.show) {
  display: none !important;
}
  /* Forecast detail panel */
  .forecast-detail {
    padding: 15px;
    background: white;
    border-radius: 0 0 10px 10px;
    margin-top: -10px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-top: none;
    font-size: 0.95em;
    color: #4a5568;
  }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
  .promo-heading {
    font-size: 0.8rem;
  }
  
  .main-content h2 {
    font-size: 1.1rem;
  }
  
  #set-home-button {
    font-size: 0.75rem !important;
    padding: 5px 8px !important;
  }
}