/* Reset y tipografía */
* { box-sizing: border-box; margin: 0; padding: 0; }
body, html {
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(120deg, #b2fefa, #0ed2f7 80%);
  color: #222;
}

:root {
  --bg: #f8ffff;
  --bg-card: rgba(255,255,255,0.92);
  --text: #222;
  --text-soft: #444;
  --primary: #0ed2f7;
  --secondary: #3bb2b8;
  --badge-bg: #e0f7fa;
  --badge-text: #00796b;
  --btn-bg: linear-gradient(90deg, #0ed2f7, #b2fefa);
  --btn-text: #fff;
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.4s;
}

.weather-app {
  max-width: 420px;
  min-height: 90vh;
  margin: 32px auto;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(60,60,120,0.10);
  padding: 24px 12px 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  transition: background 0.4s;
}

.weather-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.app-title {
  font-size: 2em;
  font-weight: bold;
  background: linear-gradient(90deg,#42e695,#3bb2b8,#ff6ec4);
  -webkit-background-clip: text;
  color: transparent;
}
.info-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #3bb2b8;
  transition: color 0.2s;
}
.info-btn:hover { color: #ff6ec4; }

.weather-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.weather-icon img {
  width: 70px;
  height: 70px;
}
.weather-temp {
  font-size: 2.7em;
  font-weight: bold;
  color: #222;
}
.weather-desc, .weather-location {
  font-size: 1.1em;
  color: #444;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}
.weather-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  justify-content: center;
  width: 100%;
}
.weather-sun {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 0 0;
}
.sun-badge {
  background: #fffbe6;
  color: #ffb300;
  border-radius: 10px;
  padding: 4px 12px;
  font-size: 1em;
  box-shadow: 0 1px 4px rgba(255,200,0,0.08);
}
body.dark-mode .sun-badge {
  background: #232a36;
  color: #ffe066;
}
.weather-alerts {
  margin: 12px 0 0 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.alert-card {
  background: #fff3e0;
  color: #d84315;
  border-left: 5px solid #ff9800;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(255,152,0,0.08);
  width: 100%;
  max-width: 400px;
}
body.dark-mode .alert-card {
  background: #2d2323;
  color: #ffb300;
  border-left: 5px solid #ff6e40;
}

.weather-forecast {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  justify-content: center;
  width: 100%;
}
.forecast-day {
  background: #f1f8ff;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  min-width: 60px;
  font-size: 0.95em;
  box-shadow: 0 2px 8px rgba(31,38,135,0.08);
  flex-shrink: 0;
}

.weather-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}
.motivacion-btn {
  margin: 0 auto;
  background: linear-gradient(90deg, #0ed2f7, #b2fefa);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 24px;
  font-size: 1.1em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31,38,135,0.10);
  transition: background 0.3s, transform 0.2s;
}
.motivacion-btn:hover {
  background: linear-gradient(90deg, #43c6ac, #0ed2f7);
  transform: scale(1.07);
}

/* Modales */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30,34,60,0.18);
  backdrop-filter: blur(4px);
  z-index: 3000;
}
.modal[hidden] { display: none !important; }
.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(31,38,135,0.13);
  padding: 28px 18px 18px 18px;
  max-width: 350px;
  width: 92vw;
  text-align: center;
  position: relative;
  color: var(--text);
  transition: background 0.4s, color 0.4s;
}
.modal-content h2 {
  color: var(--primary);
}
.modal-content p {
  color: var(--text-soft);
}
.close-modal {
  position: absolute;
  top: 10px;
  right: 16px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--primary);
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
}
.close-modal:hover { color: var(--secondary); }

#modal-motivacion .motivacion-emoji {
  font-size: 2.2em;
  margin-bottom: 0.5em;
  display: block;
}
#modal-motivacion .btn-frase, #modal-motivacion .btn-share {
  margin: 12px 8px 0 8px;
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(90deg, #0ed2f7, #b2fefa);
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(31,38,135,0.10);
}
#modal-motivacion .btn-frase:hover, #modal-motivacion .btn-share:hover {
  background: linear-gradient(90deg, #43c6ac, #0ed2f7);
  transform: scale(1.07);
}

@media (max-width: 600px) {
  .weather-app {
    max-width: 100vw;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 10px 2px 10px 2px;
    box-shadow: none;
    justify-content: flex-start;
  }
  .app-title { font-size: 1.5em; }
  .weather-temp { font-size: 2em; }
  .forecast-day { font-size: 0.9em; min-width: 50px; padding: 6px 2px; }
  .modal-content { max-width: 98vw; padding: 16px 4px 10px 4px; font-size: 1em; }
}

body.dark-mode {
  --bg: #181c24;
  --bg-card: #232a36;
  --text: #f3f3f3;
  --text-soft: #b0b8c1;
  --primary: #42e695;
  --secondary: #ff6ec4;
  --badge-bg: #263445;
  --badge-text: #b2fefa;
  --btn-bg: linear-gradient(90deg, #3bb2b8, #232a36);
  --btn-text: #fff;
}

body.dark-mode .weather-desc,
body.dark-mode .weather-location {
  color: var(--text-soft);
}
body.dark-mode .badge {
  background: #263445;
  color: #b2fefa;
}
body.dark-mode .weather-badges svg {
  filter: brightness(1.5) drop-shadow(0 0 2px #fff2);
}
body.dark-mode .forecast-day {
  background: #232a36;
  color: #f3f3f3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
body.dark-mode .motivacion-btn {
  background: linear-gradient(90deg, #42e695, #3bb2b8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* Switch dark mode con iconos */
.switch-darkmode {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  margin: 0 10px;
  vertical-align: middle;
}
.switch-darkmode input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #b2fefa;
  border-radius: 24px;
  transition: background 0.3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.3s, background 0.3s;
}
.slider:after {
  content: "☀️";
  position: absolute;
  left: 6px;
  top: 3px;
  font-size: 1em;
  transition: opacity 0.3s;
}
input:checked + .slider {
  background: #232a36;
}
input:checked + .slider:before {
  transform: translateX(20px);
  background: #181c24;
}
input:checked + .slider:after {
  content: "🌙";
  left: 24px;
  color: #ffe066;
}

.weather-hourly {
  margin-top: 18px;
  padding: 10px 0 0 0;
  width: 100%;
}
.weather-hourly h3 {
  font-size: 1.1em;
  color: var(--primary);
  margin-bottom: 8px;
  text-align: center;
}
#hourly-graph {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
  display: flex;
  justify-content: center;
}
.hourly-svg {
  width: 100%;
  min-width: 340px;
  max-width: 600px;
  height: 120px;
  background: none;
  display: block;
}
.hour-label {
  font-size: 0.85em;
  fill: var(--text-soft);
}
.temp-dot {
  fill: var(--primary);
  stroke: #fff;
  stroke-width: 2;
}
.temp-line {
  stroke: var(--primary);
  stroke-width: 2;
  fill: none;
}
.rain-bar {
  fill: #2196f3;
  opacity: 0.5;
}
.rain-label {
  font-size: 0.75em;
  fill: #2196f3;
}
body.dark-mode .hour-label { fill: #b2fefa; }
body.dark-mode .rain-label { fill: #42e695; }
body.dark-mode .rain-bar { fill: #42e695; opacity: 0.5; }

.sensei-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 8px rgba(60,60,120,0.10);
}
.sensei-modal {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 10px auto;
  display: block;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 16px rgba(60,60,120,0.13);
}
body.dark-mode .sensei-logo,
body.dark-mode .sensei-modal {
  background: #181c24;
}

.weather-mood {
  margin: 18px 0 0 0;
  padding: 10px 0 0 0;
  width: 100%;
  background: none;
  text-align: center;
}
.weather-mood h3 {
  font-size: 1.1em;
  color: var(--primary);
  margin-bottom: 8px;
}
.mood-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.mood-emoji {
  font-size: 2em;
  cursor: pointer;
  transition: transform 0.15s;
  filter: grayscale(0.4) opacity(0.7);
}
.mood-emoji.selected {
  transform: scale(1.2);
  filter: none;
  border-bottom: 2px solid var(--primary);
}
.mood-history {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.mood-history-emoji {
  font-size: 1.3em;
  opacity: 0.8;
}
.mood-share {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31,38,135,0.10);
  transition: background 0.3s, transform 0.2s;
  margin: 0 auto 8px auto;
  display: block;
}
.mood-share:hover {
  background: linear-gradient(90deg, #43c6ac, #0ed2f7);
  transform: scale(1.07);
} 