/* ===================================================================
   WATERKNOW - Indicators Data Stylesheet
   =================================================================== */

:root {
  --color-primary-navy: #004F76;
  --color-ocean-blue: #1A83CC;
  --color-water-cyan: #00AEDF;
  --color-sky-cyan: #6FD2EB;
  --color-ice-soft: #CBEBF5;
  --color-ice-tint: #ffffff;
  --color-white: #ffffff;
  --color-text-dark: #0f2735;
  --color-text-muted: #4a6777;
  --color-focus-glow: rgba(0, 174, 223, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background-color: #ffffff !important;
  color: var(--color-text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utility Flex classes */
.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

/* ===================================================================
   Header & Navigation (Consistent with sensor-data)
   =================================================================== */
#mainNav {
  background-color: var(--color-primary-navy);
  box-shadow: 0 3px 12px rgba(0, 79, 118, 0.25);
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#mainNav .navbar-brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin-right: 0;
}

#mainNav .navbar-brand img {
  height: 38px;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}

#mainNav .navbar-brand:hover img {
  transform: scale(1.02);
}

.container,
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
}

@media (min-width: 576px) {
  .container,
  .navbar .container {
    max-width: 540px;
  }
}
@media (min-width: 768px) {
  .container,
  .navbar .container {
    max-width: 720px;
  }
}
@media (min-width: 992px) {
  .container,
  .navbar .container {
    max-width: 960px;
  }
}
@media (min-width: 1200px) {
  .container,
  .navbar .container {
    max-width: 1140px;
  }
}

/* Integrated Navbar Back Button (Matching sensor-data) */
#nav-back-button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

#nav-back-button:hover {
  background: var(--color-focus-glow);
  border-color: var(--color-water-cyan);
  transform: translateY(-1px);
  color: #ffffff;
  text-decoration: none;
}

#nav-back-button:active {
  transform: translateY(1px);
}

/* Station Badge (Matching sensor-data) */
.station-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-transform: uppercase;
}

#station-name {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  font-weight: 700;
  line-height: 1.5;
  display: inline-block;
}

.status-dot,
.station-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  background-color: #2ecc71;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: status-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes status-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

/* ===================================================================
   Main Content Area (Exact spacing matching sensor-data)
   =================================================================== */
#page {
  flex: 1;
  margin-top: 85px;
  padding: 15px 15px 35px 15px;
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* ===================================================================
   Category Accordion Containers
   =================================================================== */
.indicators-container {
  background-color: var(--color-white);
  border: 1px solid var(--color-ice-soft);
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 79, 118, 0.06);
  overflow: hidden;
  transition: all 0.25s ease;
}

.indicators-container:hover {
  border-color: rgba(0, 174, 223, 0.35);
  box-shadow: 0 6px 22px rgba(0, 79, 118, 0.1);
}

.indicators-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--color-primary-navy) 0%, #003652 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: default;
  user-select: none;
}

.text-indicators-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.popup-button {
  display: none !important;
}

/* ===================================================================
   Indicator Cards Grid
   =================================================================== */
.indicators-grid-container {
  padding: 24px;
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.indicator {
  position: relative;
  height: 190px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-primary-navy);
  border: 1px solid var(--color-ice-soft);
  box-shadow: 0 4px 12px rgba(0, 79, 118, 0.08);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.indicator:hover {
  transform: translateY(-4px);
  border-color: var(--color-water-cyan);
  box-shadow: 0 10px 24px rgba(0, 79, 118, 0.18);
}

.indicator img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.indicator:hover img {
  transform: scale(1.05);
  opacity: 0.92;
}

.indicator-name-box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 65px;
  background: linear-gradient(to top, rgba(0, 36, 56, 0.92) 0%, rgba(0, 36, 56, 0.72) 65%, transparent 100%);
  pointer-events: none;
}

.indicator-name {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.35;
  text-align: center;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* ===================================================================
   Footer (Uniform WATERKNOW footer)
   =================================================================== */
.footer {
  background-color: var(--color-white);
  border-top: 1px solid var(--color-ice-soft);
  padding: 1.25rem 2rem;
  text-align: center;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  margin-top: auto;
}

.footer strong {
  color: var(--color-primary-navy);
  font-weight: 700;
}

.footer a {
  color: var(--color-ocean-blue);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===================================================================
   Responsive Adjustments (Consistent with sensor-data)
   =================================================================== */
@media (max-width: 991px) {
  #page {
    margin-top: 85px;
    padding: 15px 12px 35px 12px;
  }
}

@media (max-width: 768px) {
  .container,
  .navbar .container {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }

  #mainNav {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  #mainNav .navbar-brand img {
    height: 32px;
  }

  #nav-back-button {
    padding: 6px 12px;
    margin-right: 10px;
    font-size: 13px;
    gap: 6px;
  }

  .station-badge {
    padding: 5px 12px;
    font-size: 0.78rem;
    line-height: 1.5;
    gap: 6px;
  }

  #station-name {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
  }

  #page {
    margin-top: 85px;
    padding: 15px 14px 30px 14px;
  }

  .indicators-title {
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  .indicators-grid-container {
    padding: 16px;
  }

  .indicators-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .container,
  .navbar .container {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  #mainNav {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  #mainNav .navbar-brand img {
    height: 28px;
  }

  .nav-back-text {
    display: none;
  }

  #nav-back-button {
    padding: 6px 10px;
    margin-right: 8px;
    font-size: 13px;
  }

  .station-badge {
    padding: 5px 10px;
    font-size: 0.75rem;
    line-height: 1.5;
    gap: 6px;
  }

  #station-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
  }

  #page {
    margin-top: 80px;
    padding: 14px 12px 24px 12px;
  }
}

/* ===================================================================
   Station Validation Error Modal
   =================================================================== */
.station-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 35, 55, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.station-error-modal {
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 38px 32px 34px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 40, 65, 0.35);
  border: 1px solid rgba(0, 174, 223, 0.25);
  box-sizing: border-box;
  animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.station-error-icon-box {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.15);
}

.station-error-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-navy);
  margin: 0 0 12px 0;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.station-error-message {
  font-size: 0.95rem;
  color: #4a6777;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.station-error-countdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--color-primary-navy);
  font-weight: 500;
  background: #F1FAFC;
  border: 1px solid var(--color-ice-soft);
  border-radius: 12px;
  padding: 8px 18px;
  margin: 0 0 24px 0;
}

.station-error-countdown strong {
  color: var(--color-ocean-blue);
  font-weight: 700;
  font-size: 1.05rem;
}

.station-error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-station-error-redirect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-primary-navy) 0%, var(--color-ocean-blue) 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 25px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 79, 118, 0.25);
  border: none;
  cursor: pointer;
}

.btn-station-error-redirect:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 79, 118, 0.35);
  color: #ffffff !important;
}

