/* Common map styles for weather maps */

#map {
  height: 100vh;
  width: 100%;
}

#floating-title {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  direction: rtl;
  text-align: center;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

#floating-title h1 {
  font-size: 1.4em;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#floating-title .subtitle {
  font-size: 0.9em;
  color: #444;
  margin: 2px 0;
}

.data-source {
  font-size: 0.75em;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
}

.data-source a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #666;
  transition: opacity 0.2s;
}

.data-source a:hover {
  opacity: 0.7;
}

.ims-logo {
  height: 16px;
  width: auto;
  vertical-align: middle;
}

.title-icon {
  height: 1.2em;
  width: auto;
  border-radius: 4px;
}

/* Home button */
.home-btn {
  background: #f0f4f8;
  color: #2563eb;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
  white-space: nowrap;
}

.home-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

/* GitHub Link */
.github-link {
  color: #333;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.github-link:hover {
  color: #000;
}

.github-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Plotly Modebar Position */
.js-plotly-plot .modebar-container {
  left: 10px !important;
  right: auto !important;
}

.js-plotly-plot .modebar {
  left: 10px !important;
  right: auto !important;
}

.legend {
  background: white;
  padding: 10px 14px;
  font-size: 0.9em;
  line-height: 1.8;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  max-height: 80vh;
  overflow-y: auto;
}

.legend-item {
  margin: 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 6px;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  font-size: 12px;
}

@media (max-width: 600px) {
  #floating-title h1 {
    font-size: 1.2em;
  }

  #floating-title .data-source {
    font-size: 0.7em;
  }

  #floating-title .ims-logo {
    height: 14px;
  }

  .home-btn span {
    display: none;
  }
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1200px;
  margin: 110px auto 40px;
  padding: 0 20px;
  direction: rtl;
}

.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 5px 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-title-row h1 {
  margin: 0;
  font-size: 1.6em;
}

.header-subtitle {
  font-size: 0.95em;
  color: #4b5563;
  font-weight: 500;
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #eee;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfcfc;
}

.card-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
  margin: 0;
  text-decoration: none;
}

.card-title:hover {
  color: #0066cc;
}

.card-links {
  display: flex;
  gap: 15px;
}

.card-link {
  font-size: 0.85em;
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
}

.card-link:hover {
  text-decoration: underline;
}

.iframe-container {
  position: relative;
  width: 100%;
  height: 350px;
  background: #f9f9f9;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  overflow: hidden;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .dashboard-container {
    margin-top: 130px;
    padding: 0 10px;
  }

  .iframe-container {
    height: 300px;
  }
}