/* Solarized Light Theme */
:root {
  --base03: #fdf6e3; /* Background */
  --base02: #eee8d5; /* Container BG, Footer Controls BG */
  --base01: #93a1a1; /* Muted text (copyright, full date) */
  --base00: #839496; /* Regular text (alert details) */
  --base0: #657b83;  /* Body text, slightly darker */
  --base1: #586e75;  /* Filter label, Time ago */
  --base2: #073642;
  --base3: #002b36;
  --yellow: #b58900;
  --orange: #cb4b16;
  --red: #dc322f;
  --magenta: #d33682;
  --violet: #6c71c4;
  --blue: #268bd2;   /* Links, Buttons, Card Border */
  --cyan: #2aa198;   /* Hover effects */
  --green: #859900;  /* Alert Header Text */

  --footer-height: 70px; /* Define footer height for body padding */
}

body {
  background-color: var(--base03);
  color: var(--base0);
  font-family: Arial, sans-serif;
  margin: 0;
  /* Add padding to the bottom to prevent content being hidden by fixed footer */
  padding: 16px 16px calc(var(--footer-height) + 16px) 16px;
  min-height: 100vh;
  box-sizing: border-box;
}

.container {
  background-color: var(--base02);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  /* Let container grow, but body padding handles footer space */
  min-height: calc(100vh - 32px - var(--footer-height));
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  /* Remove refresh button from here */
}

.logo {
  max-height: 50px;
  width: auto;
}

.line-filters {
  margin-bottom: 1.5rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.filter-label {
  font-weight: bold;
  color: var(--base1);
}

.filter-group-container {
    display: inline-flex;
    gap: 4px;
    padding: 2px;
    border-radius: 20px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
}

.filter-button {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  border-radius: 50%; /* Make the clickable area/outline circular */
  padding: 2px;       /* Padding around the badge for the outline */
  display: inline-flex; /* Wraps the badge */
  /* vertical-align: middle; /* Keep for alignment */
}

.filter-button:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.filter-button.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--blue); /* Circular active state outline */
}

.filter-badge { /* Styles for badges used in filters - ensure circular */
  width: 30px;
  height: 30px;
  min-width: 30px; /* Prevent shrinking */
  min-height: 30px;
  border-radius: 50%; /* Ensure it's a circle */
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: bold;
  text-align: center;
  overflow: hidden;
}


h1 {
  color: var(--blue);
  margin: 0;
}

#status-container {
  margin-top: 1rem;
  flex-grow: 1;
  position: relative;
}

.status-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  width: 100%;
}
.status-wrapper.hidden {
    display: none;
}


.status-card {
  background-color: var(--base03);
  padding: 1rem;
  border-radius: 8px;
  border-left: 6px solid var(--blue);
  cursor: pointer;
  break-inside: avoid;
  box-sizing: border-box;
  transition: box-shadow 0.3s;
  height: fit-content;
  display: flex;
  flex-direction: column;
}

.status-card:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.line-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.status-card strong {
  color: var(--green);
  display: block;
  font-weight: bold;
  font-size: 1rem;
}

.status-card p { /* Details text */
  color: var(--base00);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.status-details {
    margin-top: 0.5rem;
}

.status-details.hidden {
  display: none;
}

.line-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: bold;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  text-align: center;
  font-size: 12px;
  line-height: 24px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.alert-time {
  font-size: 0.85rem;
  color: var(--base1);
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
}

.time-ago {
  font-weight: 600;
}

.full-date {
  font-size: 0.75rem;
  color: var(--base01);
  margin-top: 0.25rem;
}

/* No Alerts Message */
.no-alerts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--base01);
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
}
.no-alerts img {
    max-width: 100px;
    margin-bottom: 1rem;
    opacity: 0.7;
}
.no-alerts p {
    font-size: 1.1rem;
    color: var(--base00);
}
.no-alerts.hidden {
    display: none;
}


/* Footer styles */
.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--base01);
  color: var(--base1);
  font-size: 0.875rem;
}

.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.footer a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.3s;
}

.footer a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.footer-copyright {
  text-align: center;
  color: var(--base01);
  font-size: 0.75rem;
}

.footer-divider {
  color: var(--base01);
}


/* Fixed Footer Controls */
.footer-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--base02);
    border-top: 1px solid var(--base01);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 100;
    height: var(--footer-height);
    box-sizing: border-box;
}

.control-button {
    padding: 8px 12px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s, box-shadow 0.2s;
    background-color: var(--blue);
    color: white;
}
.control-button:hover {
    background-color: var(--cyan);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.refresh-button {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.refresh-button svg {
     width: 20px;
     height: 20px;
}

.toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--base1);
    gap: 8px;
}

.toggle-text {
    font-size: 0.9rem;
    user-select: none;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: var(--base01);
    border-radius: 10px;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--base03);
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

#future-alerts-toggle {
    display: none; /* Hide the actual checkbox */
}

#future-alerts-toggle:checked + .toggle-label .toggle-slider {
    background-color: var(--green); /* Track color when checked */
}

#future-alerts-toggle:checked + .toggle-label .toggle-slider::before {
    transform: translateX(20px); /* Move handle to the right */
}


/* Responsive grid adjustments */
@media (min-width: 640px) {
  .status-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

@media (min-width: 1024px) {
  .status-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}

@media (min-width: 1440px) {
  .status-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 599px) {
  body {
      padding: 8px 8px calc(var(--footer-height) + 8px) 8px;
  }
  .container {
    padding: 1rem; /* Reduce container padding */
    min-height: calc(100vh - 16px - var(--footer-height));
  }

  .status-card {
    padding: 0.75rem;
  }

  .status-wrapper {
    grid-template-columns: 1fr; /* Single column */
    gap: 0.75rem;
  }

  .footer-main {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-divider {
    display: none;
  }

  .footer-controls {
      padding: 8px 12px;
      height: calc(var(--footer-height) - 10px);
  }
  .control-button {
      padding: 6px 10px;
      font-size: 0.85rem;
  }
  .refresh-button {
      width: 36px;
      height: 36px;
  }
   .refresh-button svg {
     width: 18px;
     height: 18px;
  }
  .toggle-text {
      font-size: 0.85rem;
  }
   .toggle-slider {
      width: 36px;
      height: 18px;
      border-radius: 9px;
  }
  .toggle-slider::before {
      width: 14px;
      height: 14px;
  }
  #future-alerts-toggle:checked + .toggle-label .toggle-slider::before {
      transform: translateX(18px);
  }

}
