/* ========================================
   WATER QUALITY PAGE STYLES
   Using CoastWise color scheme from LocationPage
   ======================================== */

/* Global overflow prevention */
* {
  max-width: 100%;
  box-sizing: border-box;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */

.water-quality-page {
  min-height: 100vh;
  background-image: url('../images/sea.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #FFFFFF;
  padding: 10px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

.water-quality-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 77, 151, 0.8) 0%, rgba(161, 45, 41, 0.8) 100%);
  z-index: -1;
}

/* ========================================
   WATER QUALITY HEADER STYLES
   (Moved to shared location-header.css)
   ======================================== */

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  height: 100%;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ========================================
   SECTION STYLES
   ======================================== */

.ea-section,
.sww-section {
  border-radius: 0 0 10px 10px;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.section-title {
  background-color: #004d97;
  color: #FFFFFF;
  padding: 15px 20px;
  margin: 0px 0px 10px 0px;
  font-size: 1.4em;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.section-title i {
  font-size: 1.2em;
  color: #f8d447;
}

/* ========================================
   LOADING AND ERROR STATES
   ======================================== */

.loading-state,
.error-state,
.no-data-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #FFFFFF;
  text-align: center;
}

/* Loading spinner now defined in base.css */

/* Retry button now defined in base.css */

/* ========================================
   SUMMARY CARDS
   ======================================== */

.ea-summary-card,
.storm-summary-card {
  background-color: #004d97;
  border: 2px solid #f8d447;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.ea-summary-card:hover,
.storm-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 77, 151, 0.3);
  border-color: #f8d447;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.summary-header h3 {
  font-size: 1.2em;
  font-weight: bold;
  margin: 0;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-header h3 i {
  font-size: 1.2em;
  color: #f8d447;
}

/* Row layout for storm summary card */
.storm-summary-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.storm-summary-card .summary-header {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.storm-summary-card .summary-header h3 {
  margin-bottom: 0;
}

.storm-summary-card .activity-indicators {
  flex: 1;
  justify-content: center;
  min-width: 150px;
  margin-bottom: 0;
}

.storm-summary-card .summary-details {
  flex: 1;
  justify-content: flex-end;
  min-width: 200px;
  margin-bottom: 0;
}

.data-quality-indicators,
.activity-indicators {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quality-indicator,
.activity-indicator {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.indicator-label {
  font-size: 0.8em;
  color: #FFFFFF;
  opacity: 0.8;
  font-weight: bold;
}

.indicator-value {
  font-size: 1.1em;
  font-weight: bold;
  color: #f8d447;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.stat-item {
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: #f8d447;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9em;
  color: #FFFFFF;
  opacity: 0.8;
  font-weight: bold;
}

/* ========================================
   EA LOCATIONS GRID
   ======================================== */

.ea-locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.ea-location-card {
  background-color: #FFFFFF;
  border: 2px solid #004d97;
  border-radius: 10px;
  padding: 12px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.ea-location-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 77, 151, 0.3);
  border-color: #f8d447;
}

.location-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.location-card-header h4 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0;
  color: #004d97;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-card-header h4 i {
  font-size: 1.2em;
  color: #f8d447;
}

.data-availability {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.data-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7em;
  font-weight: bold;
  text-transform: uppercase;
}

.data-badge.available {
  background: rgba(32, 201, 151, 0.2);
  color: #20c997;
  border: 1px solid rgba(32, 201, 151, 0.3);
}

.data-badge.unavailable {
  background: rgba(255, 87, 34, 0.2);
  color: #ff5722;
  border: 1px solid rgba(255, 87, 34, 0.3);
}

/* ========================================
   STP RISK SECTION
   ======================================== */

.stp-risk-section {
  margin-bottom: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.risk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.risk-header h5 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0;
  color: #004d97;
}

.risk-level {
  font-size: 1em;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.risk-timestamp {
  font-size: 0.9em;
  color: #333333;
  opacity: 0.8;
  margin-bottom: 15px;
}

.risk-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.risk-comment {
  font-size: 0.9em;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 2px solid #28a745;
  display: inline-block;
  min-width: 120px;
  text-align: center;
  transition: all 0.3s ease;
}

.risk-comment-warning {
  background: #dc3545 !important;
  color: #FFFFFF !important;
  border: 2px solid #dc3545 !important;
}

.risk-metric {
  font-size: 0.9em;
  color: #333333;
  font-weight: 500;
}

.risk-timestamps {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.risk-timestamps .risk-timestamp {
  margin-bottom: 5px;
  font-size: 0.85em;
  color: #666666;
}

.risk-info {
  font-size: 0.85em;
  color: #666666;
  font-style: italic;
}

.warnings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.warning-item {
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 4px solid #f8d447;
}

.warning-text {
  font-size: 1em;
  font-weight: bold;
  color: #004d97;
  margin-bottom: 8px;
}

.warning-location {
  font-size: 0.9em;
  color: #333333;
  opacity: 0.8;
  margin-bottom: 5px;
}

.warning-time {
  font-size: 0.8em;
  color: #333333;
  opacity: 0.6;
  margin-bottom: 5px;
}

.warning-metric {
  font-size: 0.8em;
  color: #333333;
  opacity: 0.6;
  font-style: italic;
}

/* ========================================
   PROFILE DETAILS SECTION
   ======================================== */

.profile-details-section {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-details-section h5 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0 0 15px 0;
  color: #004d97;
}

.profile-item {
  margin-bottom: 10px;
  font-size: 0.95em;
  line-height: 1.5;
  color: #333333;
}

.profile-item strong {
  color: #f8d447;
  font-weight: bold;
}

/* ========================================
   STORM OVERFLOW CONTENT
   ======================================== */

.storm-overflow-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #ffffff;
}

.summary-details .water-quality-detail-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-details .water-quality-detail-item:last-child {
  border-bottom: none;
}

/* ========================================
   STORM OVERFLOWS GRID
   ======================================== */

.storm-overflows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.overflow-card {
  background-color: #FFFFFF;
  border: 2px solid #004d97;
  border-radius: 10px;
  padding: 12px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.overflow-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 77, 151, 0.3);
  border-color: #f8d447;
}

.overflow-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  position: relative;
}

.overflow-header h4 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0;
  color: #004d97;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 140px;
  flex: 1;
}

.overflow-header h4 i {
  font-size: 1.2em;
  color: #f8d447;
}

.overflow-status {
  font-size: 0.9em;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  display: inline-block;
  min-width: 120px;
  text-align: center;
  transition: all 0.3s ease;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
}

.overflow-status.active {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border: 2px solid #dc3545;
}

.overflow-status.inactive {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 2px solid #28a745;
}

.overflow-status.offline {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 2px solid #ffc107;
}

.overflow-status.unknown {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 2px solid #6c757d;
}

.overflow-details {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.85em;
}

.detail-row:last-child {
  border-bottom: none;
}

/* Water quality overflow detail label styles moved to shared location-header.css */

/* Water quality detail value styles moved to shared location-header.css */

.overflow-properties {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.overflow-properties h5 {
  font-size: 1em;
  font-weight: bold;
  margin: 0 0 10px 0;
  color: #004d97;
}

.property-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.85em;
}

.property-label {
  color: #333333;
  opacity: 0.8;
  font-weight: bold;
}

.property-value {
  color: #004d97;
  font-weight: bold;
}

/* ========================================
   DATA SOURCE INFO
   ======================================== */

.data-source-info {
  background-color: #004d97;
  border: 2px solid #f8d447;
  border-radius: 10px;
  padding: 15px;
  margin-top: 15px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.data-source-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 77, 151, 0.3);
  border-color: #f8d447;
}

.source-details h5 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0 0 15px 0;
  color: #FFFFFF;
}

.source-details p {
  margin-bottom: 10px;
  font-size: 0.95em;
  line-height: 1.5;
  color: #FFFFFF;
  opacity: 0.9;
}

.source-details strong {
  color: #f8d447;
  font-weight: bold;
}

.endpoints-used {
  margin-top: 15px;
}

.endpoints-used ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.endpoints-used li {
  margin-bottom: 5px;
  font-size: 0.9em;
  color: #FFFFFF;
  opacity: 0.8;
}

/* ========================================
   DISCLAIMER SECTION
   ======================================== */

.disclaimer-section {
  background-color: #cb3839;
  border: 10px solid #f8d447;
  padding: 20px;
  border-radius: 25px 25px 25px 25px;
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.disclaimer-title {
  font-size: 2em;
  font-weight: bold;
  color: #FFFFFF;
  margin: 10px 0 20px 0;
  text-align: center;
}

.disclaimer-content {
  color: #FFFFFF;
  line-height: 1.6;
  text-align: left;
  width: 100%;
}

.disclaimer-content p {
  margin: 15px 0;
  font-size: 1.2em;
  opacity: 0.9;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .water-quality-page {
    padding: 5px;
  }
  
  /* Header styles moved to shared location-header.css */
  
  .back-button {
    position: static;
    display: inline-block;
    margin: 10px 5px;
  }
  
  /* Header content and location details styles moved to shared location-header.css */
  
  .ea-locations-grid,
  .storm-overflows-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .summary-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .data-quality-indicators,
  .activity-indicators {
    flex-direction: column;
    gap: 10px;
  }
  
  .storm-summary-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .storm-summary-card .summary-header,
  .storm-summary-card .activity-indicators,
  .storm-summary-card .summary-details {
    min-width: auto;
    flex: none;
  }
  
  .summary-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .location-card-header,
  .overflow-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .overflow-header h4 {
    padding-right: 0;
    margin-bottom: 10px;
  }
  
  .overflow-status {
    position: static;
    align-self: flex-start;
  }
  
  .risk-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .section-title {
    font-size: 1.2em;
    padding: 10px 15px;
  }
  
  .disclaimer-title {
    font-size: 1.5em;
  }
  
  .disclaimer-content {
    padding: 0 10px;
  }
  
  .disclaimer-content p {
    font-size: 0.9em;
    margin: 12px 0;
  }
}

@media (max-width: 480px) {
  /* Header styles moved to shared location-header.css */
  
  .ea-section,
  .sww-section {
    padding: 0px;
  }
  
  .summary-stats {
    grid-template-columns: 1fr;
  }
  
  .ea-location-card,
  .overflow-card {
    padding: 12px;
  }
  
  .ea-summary-card,
  .storm-summary-card {
    padding: 10px;
  }
  
  .disclaimer-title {
    font-size: 1.3em;
  }
  
  .disclaimer-content p {
    font-size: 0.8em;
    margin: 10px 0;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .ea-location-card,
  .overflow-card,
  .ea-summary-card,
  .storm-summary-card,
  .back-button,
  .retry-button {
    transition: none;
  }
  
  .loading-spinner {
    animation: none;
  }
}

@media (max-width: 360px) {
  /* Header styles moved to shared location-header.css */
}

/* Focus styles for keyboard navigation */
.back-button:focus,
.retry-button:focus {
  outline: 2px solid #f8d447;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ea-location-card,
  .overflow-card {
    border: 2px solid #FFFFFF;
  }
  
  .back-button,
  .retry-button {
    border-width: 3px;
  }
}
