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

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  border: none;
}

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

/* Header */
header {
  background: #d9d9d9;
  padding: 1rem 0;
}

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

.logo {
  flex: 1;
}

.logo img {
  width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}



/* Desktop navigation */
.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.desktop-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.desktop-nav a:hover, .desktop-nav a.active {
  color: #2c5aa0;
}

/* Hide mobile nav on desktop */
.mobile-nav {
  display: none;
}

/* Main Layout */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 2rem;
  padding: 2rem 0;
  min-height: 60vh;
  margin: 0.5rem 0;
}

.tile {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* Footer */
footer {
  background: #2c5aa0;
  color: white;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

footer a {
  color: #b3d1ff;
  text-decoration: none;
}

footer a:hover {
  color: white;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  background: radial-gradient(ellipse at top, #5a8dd8 0%, #4a7bc8 30%, #2c5aa0 70%, #1e3f73 100%);
  color: white;
  box-shadow: 
    0 12px 25px rgba(44, 90, 160, 0.4),
    inset 0 3px 6px rgba(255, 255, 255, 0.4),
    inset 0 -3px 6px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.desktop-text {
  display: inline;
}

.mobile-text {
  display: none;
}

.btn-primary {
  background: radial-gradient(ellipse at top, #5a8dd8 0%, #4a7bc8 30%, #2c5aa0 70%, #1e3f73 100%);
  color: white;
}

.btn-secondary {
  background: radial-gradient(ellipse at top, #5a8dd8 0%, #4a7bc8 30%, #2c5aa0 70%, #1e3f73 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 16px 32px rgba(44, 90, 160, 0.5),
    inset 0 4px 8px rgba(255, 255, 255, 0.5),
    inset 0 -4px 8px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.btn:active {
  transform: translateY(0px);
  box-shadow: 
    0 6px 12px rgba(44, 90, 160, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

/* Typography */
h1, h2, h3 {
  margin-bottom: 1rem;
  color: #2c5aa0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #666;
  font-style: italic;
}

.loading-spinner::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2c5aa0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

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

/* Forecast History */
.forecast-item {
  transition: box-shadow 0.2s ease;
}

.forecast-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  main {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  /* Hide desktop nav, show mobile nav */
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav {
    display: block;
    background: #f8f9fa;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .mobile-nav ul {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    transform: translateX(-10px);
  }
  
  .mobile-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
  }
  
  .mobile-nav a:hover, .mobile-nav a.active {
    color: #2c5aa0;
  }
  
  .hero-banner-desktop {
    display: none !important;
  }
  
  .hero-banner-mobile {
    display: block !important;
  }
  
  .footer-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 1rem !important;
  }
  
  .footer-links {
    align-self: center !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
  }
  
  .tile {
    padding: 1rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .btn {
    display: block;
    text-align: center;
    margin: 0.5rem 0;
    width: 100%;
  }
  
  .button-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .button-container .btn {
    margin: 0;
  }
  
  .mobile-text {
    display: inline;
  }
  
  .desktop-text {
    display: none;
  }
  
  /* Pricing cards mobile fix */
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  /* Benefits grid mobile fix */
  div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 2rem"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  /* Fix clipped bullets on mobile */
  ul {
    padding-left: 1.5rem !important;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  
  main {
    gap: 0.75rem;
  }
  
  .tile {
    padding: 0.75rem;
  }
  

  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
}
/* Forecast card mobile optimizations - added for responsive design */
@media (max-width: 768px) {
  .forecast-row {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .forecast-row > div[style*="width:40px"] {
    width: 100% !important;
    display: flex;
    justify-content: flex-start;
  }
  
  .forecast-row > div[style*="flex:0 0 140px"] {
    flex: 1 1 auto !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }
  
  .forecast-row > div[style*="flex:0 0 140px"] img,
  .forecast-row > div[style*="flex:0 0 140px"] div {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .forecast-row > div[style*="flex:1"] {
    width: 100% !important;
  }
  
  .forecast-expander {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  
  .forecast-expander > div {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .detail-card {
    padding: 8px !important;
  }
  
  .forecast-details-table {
    font-size: 0.85rem !important;
  }
  
  .forecast-details-table th,
  .forecast-details-table td {
    padding: 4px 6px !important;
    word-break: break-word;
  }
  
  .forecast-row button {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 4px 0 !important;
  }
}

/* Prevent horizontal scroll on mobile - ensure all containers respect viewport */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  .container {
    padding: 0 10px;
    overflow-x: hidden;
    width: 100%;
  }
  
  /* Ensure the forecast history container doesn't overflow */
  .container > div[style*="max-width: 800px"] {
    max-width: 100% !important;
    overflow-x: hidden;
  }
  
  #forecastHistory {
    overflow-x: hidden;
    width: 100%;
  }
  
  /* Ensure images don't cause overflow */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Force all child divs to respect parent width */
  .forecast-row * {
    max-width: 100%;
  }
  
  /* Ensure inline styles don't override mobile responsiveness */
  div[style*="display: flex"] {
    flex-wrap: wrap;
  }
  
  /* Fix any potential width issues with buttons and flex containers */
  .auth-required > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  
  .auth-required > div[style*="display: flex"] > div {
    width: 100% !important;
    white-space: normal !important;
  }
}

/* Fix mobile clipping - update previous mobile rules */
@media (max-width: 768px) {
  /* Override previous overflow hidden that was clipping content */
  body {
    overflow-x: auto !important;
    overflow-y: auto !important;
  }
  
  .container {
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
  
  .container > div[style*="max-width: 800px"] {
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
  
  #forecastHistory {
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
  
  /* Instead, ensure elements size correctly */
  .forecast-row {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .forecast-expander {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .detail-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure table container scrolls if needed rather than parent */
  .forecast-details-table {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
  }
  
  /* Ensure detail card content is visible */
  .detail-card > div {
    width: 100% !important;
    overflow-x: auto !important;
  }
}

/* Enable word wrapping in forecast table columns on mobile */
@media (max-width: 768px) {
  .forecast-details-table th,
  .forecast-details-table td {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    min-width: 60px !important;
  }
  
  /* Make table responsive - allow natural column sizing */
  .forecast-details-table {
    table-layout: auto !important;
  }
  
  /* Ensure text content wraps within cells */
  .forecast-details-table th *,
  .forecast-details-table td * {
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  /* Allow arrows and icons to stay inline but wrap if needed */
  .forecast-details-table span[style*="white-space:nowrap"] {
    white-space: normal !important;
    display: inline !important;
  }
}

/* Remove left indent on forecast card details for mobile */
@media (max-width: 768px) {
  /* Remove the left margin that creates indent under buttons */
  .forecast-expander > div[style*="margin-left:52px"] {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
  
  /* Ensure detail card uses full width on mobile */
  .forecast-expander .detail-card {
    margin-left: 0 !important;
    padding-left: 12px !important;
  }
}

/* Restore horizontal scrolling for forecast tables on mobile - removes word wrapping */
@media (max-width: 768px) {
  /* Allow table to scroll horizontally instead of wrapping */
  .forecast-details-table {
    display: table !important;
    overflow-x: visible !important;
    table-layout: fixed !important;
    white-space: nowrap !important;
  }
  
  .forecast-details-table th,
  .forecast-details-table td {
    white-space: nowrap !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    min-width: auto !important;
  }
  
  /* Remove word wrapping from table content */
  .forecast-details-table th *,
  .forecast-details-table td * {
    white-space: nowrap !important;
    word-wrap: normal !important;
  }
  
  /* Restore nowrap for arrows and icons */
  .forecast-details-table span[style*="white-space:nowrap"] {
    white-space: nowrap !important;
  }
  
  /* Ensure the container allows horizontal scroll */
  .detail-card > div > div[style*="overflow:auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Fix column clipping in forecast table on mobile */
@media (max-width: 768px) {
  .forecast-details-table {
    table-layout: auto !important;
  }
  
  .forecast-details-table th,
  .forecast-details-table td {
    padding: 6px 12px !important;
  }
}
