/* styles.css */
:root {
  --bg-color: #f8f9fa;
  --text-color: #1a1a1a;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --card-bg: #f8f8f8;
  --accent-color: #0066cc;
  --warning-bg: #fff3cd;
  --warning-text: #856404;
}

[data-theme="dark"] {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --text-secondary: #a0a0a0;
  --border-color: #333355;
  --card-bg: #252542;
  --accent-color: #4da6ff;
  --warning-bg: #4a3f00;
  --warning-text: #ffc107;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#theme-toggle {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 1rem;
}

#theme-toggle::before {
  content: '☀️';
}

[data-theme="dark"] #theme-toggle::before {
  content: '🌙';
}

.nav-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.source-toggle {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.source {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.source:first-child {
  border-radius: 6px 0 0 6px;
}

.source:last-child {
  border-radius: 0 6px 6px 0;
}

.source.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.map-wrapper {
  position: relative;
}

.map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  touch-action: manipulation;
}

.fullscreen-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
}

.fullscreen-btn:hover {
  opacity: 1;
}

/* Fullscreen mode */
.map-wrapper.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.map-wrapper.fullscreen .map-container {
  flex: 1;
  aspect-ratio: unset;
  border-radius: 0;
}

.map-wrapper.fullscreen .time-tabs {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  padding: 0.5rem;
  border-radius: 12px;
  margin-top: 0;
}

.map-wrapper.fullscreen .tab {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.map-wrapper.fullscreen .tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.map-wrapper.fullscreen .fullscreen-btn::after {
  content: '✕';
}

.map-wrapper.fullscreen .fullscreen-btn {
  font-size: 1rem;
}

.uh-map {
  aspect-ratio: auto;
  max-height: 500px;
}

.map-wrapper.fullscreen .uh-map {
  max-height: none;
  height: 100%;
}

.map-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.time-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.tab {
  flex: 1;
  max-width: 80px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.forecasts {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forecast {
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.forecast h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.region-detail {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.forecast p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

#update-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.warning {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--warning-bg);
  color: var(--warning-text);
  border-radius: 8px;
  font-size: 0.85rem;
}

.warning::before {
  content: '⚠️ ';
}

.hidden {
  display: none;
}

.footer-links {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.footer-links a {
  color: var(--accent-color);
  text-decoration: none;
}

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

.footer-links .separator {
  color: var(--text-secondary);
  margin: 0 0.5rem;
}

.forecast-date {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.about-content {
  max-width: 600px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.about-content h3 {
  font-size: 1rem;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.about-content a {
  color: var(--accent-color);
  text-decoration: none;
}

.about-content a:hover {
  text-decoration: underline;
}

/* Fullscreen date display */
.fullscreen-date {
  display: none;
}

.map-wrapper.fullscreen .fullscreen-date {
  display: block;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  padding: 0.5rem 0 1rem 0;
}
