/* ========================================
   SHARED LOCATION HEADER STYLES
   Used across LocationPage, LocationForecast, and WaterQualityPage
   ======================================== */

/* ========================================
   LOCATION HEADER BASE STYLES
   ======================================== */

.location-header {
  background-color: #cb3839;
  border-top: 25px  solid #f8d447;
  padding: 10px;
  border-radius: 25px 25px 0px 0px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 270px;
  height: auto;
  overflow: visible;
}

/* ========================================
   HEADER BUTTON CONTAINERS
   ======================================== */

.header-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.back-button-container,
.forecast-button-container,
.water-quality-button-container {
  padding: 0;
  margin: 0;
}

/* ========================================
   REUSABLE HEADER BUTTON STYLES
   ======================================== */

.header-button {
  background-color: #004d97;
  color: #FFFFFF;
  padding: 12px 20px;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9em;
  transition: all 0.3s ease;
  border: 2px solid #f8d447;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  min-width: 180px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.header-button:hover {
  background-color: #0066cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-color: #f8d447;
}

.header-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   SPECIFIC BUTTON STYLES
   ======================================== */

/* Specific button styles inherit from .header-button */

/* ========================================
   HEADER CONTENT LAYOUT
   ======================================== */

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  flex: 1;
  position: relative;
  min-height: fit-content;
  height: auto;
}

.header-text {
  flex: 1;
}

.header-buttons-container {
  position: absolute;
  left: 15px;
  top: 15px;
  z-index: 10;
}

.header-clock-section {
  position: absolute;
  right: 15px;
  top: 15px;
  z-index: 10;
}

.header-qr-section {
  position: absolute;
  right: 15px;
  top: 60px;
  z-index: 10;
}

/* ========================================
   TITLE AND SUBTITLE STYLES
   ======================================== */

.location-title,
.page-title {
  font-size: 3em;
  font-weight: bold;
  color: #FFFFFF;
  margin: 10px 0;
  text-align: center;
}

.location-subtitle,
.page-subtitle {
  font-size: 1.2em;
  color: #FFFFFF;
  margin: 10px 0 20px 0;
  opacity: 0.9;
}

/* ========================================
   LOCATION DETAILS
   ======================================== */

.location-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  min-height: fit-content;
  height: auto;
}

.detail-item {
  text-align: center;
  min-width: 150px;
}

/* ========================================
   DETAIL LABEL AND VALUE STYLES (UNIFIED)
   ======================================== */

.detail-label {
  font-size: 0.9em !important;
  color: #FFFFFF !important;
  opacity: 0.8 !important;
  margin-bottom: 5px !important;
  font-weight: bold !important;
}

.detail-value {
  font-size: 1.1em !important;
  color: #ffffff !important;
  font-family: 'Courier New', monospace !important;
  font-weight: bold !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Legacy support for existing page-specific classes */
.location-page-detail-label,
.location-forecast-detail-label,
.water-quality-detail-label {
  font-size: 0.9em !important;
  color: #FFFFFF !important;
  opacity: 0.8 !important;
  margin-bottom: 5px !important;
  font-weight: bold !important;
}

.location-page-detail-value,
.location-forecast-detail-value,
.water-quality-detail-value {
  font-size: 1.1em !important;
  color: #000000 !important;
  font-family: 'Courier New', monospace !important;
  font-weight: bold !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* ========================================
   CLOCK IN HEADER
   ======================================== */

.clock-container {
  display: flex;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 100px;
  gap: 4px;
}

.clock-time {
  color: #FFFFFF;
  font-size: 1.2em;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.clock-date {
  color: #ffffff;
  font-size: 1em;
  font-weight: 600;
  opacity: 0.9;
}

/* ========================================
   QR CODE IN HEADER (FLEXIBLE LAYOUT)
   ======================================== */

.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
}

.qr-code-container h3 {
  color: #FFFFFF;
  margin: 0;
  font-size: 1em;
  font-weight: 600;
}

#qr-code-container {
  padding: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: inline-block;
  max-width: 110px;
  max-height: 110px;
}

#qr-code-image {
  display: block;
  border-radius: 4px;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

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

@media (max-width: 768px) {
  .location-header {
    padding: 8px;
    border-width: 6px;
    gap: 10px;
    min-height: 180px;
    height: auto;
  }
  
  .location-title,
  .page-title {
    font-size: 2em;
  }
  
  .location-subtitle,
  .page-subtitle {
    font-size: 1em;
  }
  
  .header-button {
    min-width: 150px;
    font-size: 0.8em;
    padding: 10px 15px;
  }
  
  .header-buttons-container {
    position: static;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 10px;
    min-height: fit-content;
    height: auto;
  }
  
  .header-clock-section {
    position: static;
    justify-content: center;
    margin-top: 10px;
  }
  
  .header-qr-section {
    position: static;
    justify-content: center;
    margin-top: 10px;
  }
  
  
  #qr-code-container {
    max-width: 80px;
    max-height: 80px;
  }
}

@media (max-width: 360px) {
  .location-header {
    padding: 8px;
    border-width: 6px;
    min-height: 160px;
  }
  
  .location-title,
  .page-title {
    font-size: 1.3em;
  }
  
  .location-subtitle,
  .page-subtitle {
    font-size: 0.9em;
  }

  
  #qr-code-container {
    max-width: 60px;
    max-height: 60px;
  }
}

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

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  .header-button,
  .back-button {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .header-button,
  .back-button {
    transition: none;
  }
}

/* ========================================
   REAL-TIME STATUS INDICATOR
   ======================================== */

.realtime-status-container {
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  min-width: 140px;
}

/* Responsive adjustments for realtime status */
@media (max-width: 768px) {
  .realtime-status-container {
    min-width: 120px;
    padding: 4px 8px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .realtime-status-container {
    min-width: 100px;
    padding: 3px 6px;
    font-size: 0.8em;
  }
}
