/* CSS for the weewx Standard skin - Responsive Design */

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

/* Container and layout */
#masthead {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 2px;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-image {
  max-width: 100%;
  height: auto;
  max-height: 120px;
}

.navbar-iframe {
  border: none;
  width: 100%;
  height: 50px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

#content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Widgets container */
.widgets-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.widget {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.forecast-iframe {
  width: 100%;
  height: 320px;
  border: none;
  border-radius: 8px;
}

.webcam-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.stats {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stats_header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats td {
  padding: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.stats tr:last-child td {
  border-bottom: none;
}

.stats_label {
  color: #2c3e50;
  font-weight: 500;
  width: 40%;
  background: #f8f9fa;
}

.stats_data {
  color: #e74c3c;
  font-weight: 600;
  width: 60%;
  background: white;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  border-top: 1px solid #eee;
}

/* About/resumen page styles */
#about {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#about .header {
  text-align: center;
  margin-bottom: 2rem;
}

#about .header h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#about p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

#about select {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#about select:hover {
  border-color: #667eea;
}

#about select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#about hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 1.5rem 0;
}

/* Plots container for day, week, month, year pages */
#plots {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

#plots img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* WebCam page styles */
#WebCam_img {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

#WebCam_img img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#WebCam_img a {
  display: inline-block;
  margin: 1rem 0;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

#WebCam_img a:hover {
  color: #5a6fd8;
  text-decoration: underline;
}

/* Forecast page styles */
#content h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin: 2rem 0 1rem 0;
  text-align: center;
}

#content img {
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#content iframe {
  max-width: 100%;
  margin: 1rem auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2rem 0;
}

/* Records page - 3-column table styles */
.stats table tr td:nth-child(3) {
  width: 25%;
  color: #e74c3c;
  font-weight: 600;
  background: white;
}

/* Header styles for pages with .header class */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.flag-counter {
  max-width: 100%;
  height: auto;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  #content {
    margin: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
  }

  .widgets-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stats table {
    font-size: 0.8rem;
  }

  .stats td {
    padding: 0.5rem;
  }

  .stats_header {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .forecast-iframe {
    height: 280px;
  }

  .navbar-iframe {
    height: 45px;
  }

  #about {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem;
    border-radius: 8px;
  }

  #about .header h3 {
    font-size: 1.3rem;
  }

  #about select {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  #plots img {
    margin: 0.75rem 0;
  }

  #content h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem 0;
  }

  #content img,
  #content iframe {
    margin: 0.75rem auto;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  #content {
    margin: 0.25rem;
    padding: 0.5rem;
  }

  .widgets-container {
    gap: 0.75rem;
  }

  .stats-grid {
    gap: 0.75rem;
  }

  .stats table {
    font-size: 0.75rem;
  }

  .stats td {
    padding: 0.4rem;
  }

  .stats_header {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .forecast-iframe {
    height: 250px;
  }

  /* Multi-column navbar on mobile */
  #navbar-menu {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    width: 100%;
    gap: 0.5rem;
    justify-items: stretch;
  }

  .navbar-iframe {
    height: 64px;
  }

  #about {
    padding: 1rem;
    border-radius: 6px;
  }

  #about .header h3 {
    font-size: 1.1rem;
  }

  #about select {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  #plots img {
    margin: 0.5rem 0;
  }

  #content h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
  }

  #content img,
  #content iframe {
    margin: 0.5rem auto;
  }

  .header h3 {
    font-size: 1.1rem;
  }
}

/* Navigation bar styles (for the iframe content) */
#navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

#navbar button,
#navbar select {
  padding: 0.5rem 1rem;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}

#navbar button:hover,
#navbar select:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#navbar select {
  text-align-last: center;
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
  #navbar {
    padding: 0.25rem;
    gap: 0.25rem;
  }

  #navbar button,
  #navbar select {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  #navbar {
    flex-direction: column;
    gap: 0.2rem;
  }

  #navbar button,
  #navbar select {
    width: 100%;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Additional responsive improvements */
@media (max-width: 1024px) {
  .widgets-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  #content {
    box-shadow: none;
    background: white;
  }

  .widget,
  .stats {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .stats_header {
    background: #f0f0f0;
    color: black;
  }
}
