/*(c) ggelado 2026*/

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* Variables para modo claro (por defecto) */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #213547;
  --text-secondary: #1f2a37;
  --text-muted: #374151;
  --border-color: #e0e0e0;
  --link-color: #2331b0;
  --link-hover: #1a247f;
  --accent-warning: #f59e0b;
  --accent-success: #16a34a;
  --accent-danger: #990000;
  
  /* Tipografía */
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'SFMono-Regular', Consolas, monospace;
  
  /* Radios y sombras */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: #c0c0c0;
    --text-muted: #a8a8a8;
    --border-color: #404040;
    --link-color: #8b9dff;
    --link-hover: #a8c1ff;
    --accent-warning: #f59e0b;
    --accent-success: #16a34a;
    --accent-danger: #ff6b6b;
  }

  html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
  }
}
*/

html, body {
  font-family: var(--font-body);
  line-height: 1.65;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

a {
  font-weight: 500;
  color: var(--link-color);
  transition: color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

p {
  font-family: var(--font-body);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text-primary);
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}


ul, ol {
  font-family: var(--font-body);
  color: var(--text-primary);
}

li {
  font-family: var(--font-body);
}

blockquote {
  font-family: var(--font-body);
  color: var(--text-secondary);
  border-left: 3px solid var(--border-color);
}

strong, b {
  font-family: var(--font-body);
}

em, i {
  font-family: var(--font-body);
}

label {
  font-family: var(--font-body);
  color: var(--text-primary);
}

input, textarea, select {
  font-family: var(--font-body);
  color: var(--text-primary);
}

table {
  font-family: var(--font-body);
}

th, td {
  font-family: var(--font-body);
  border: 1px solid var(--border-color);
}

.site-header {
  position: relative;
  padding-bottom: 10px;
}

.theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85em;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  z-index: 10000;
}

.theme-toggle:hover {
  background: var(--bg-primary);
  border-color: var(--link-color);
  color: var(--link-color);
}

.theme-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon--sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle__icon--sun {
  display: inline-flex;
}

html[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 0.45em 1em;
  font-size: 0.875em;
  font-weight: 500;
  font-family: var(--font-body);
  background-color: #f9f9f9;
  color: #213547;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
button:hover {
  border-color: var(--link-color);
  background-color: #f0f0f0;
}
button:focus,
button:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  button {
    background-color: #333;
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
  }
  button:hover {
    background-color: #444;
  }
}
*/

/* Contenedores de avisos */
.avisos-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  animation: fade-in-up 0.35s ease both;
}

.aviso-activo {
  border-left: 4px solid var(--accent-warning);
  background: #fffbeb;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s;
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .aviso-activo {
    background: rgba(245, 158, 11, 0.1);
  }
}
*/

.aviso-visto {
  border-left-color: #4851d8 !important;
  background: #f8faff !important;
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .aviso-visto {
    border-left-color: #8b9dff !important;
    background: rgba(139, 157, 255, 0.08) !important;
  }
}
*/

/* Bloques de código */
pre {
  background-color: #f6f8fa;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow: auto;
  font-size: 0.9em;
  line-height: 1.45;
  font-family: var(--font-mono);
}

code {
  font-family: var(--font-mono);
  background-color: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

pre code {
  font-family: var(--font-mono);
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.85em;
}

.highlight {
  background-color: #f6f8fa;
  border-radius: var(--radius-sm);
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  pre {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e8e8e8;
  }

  code {
    background-color: #2d2d2d;
    color: #e8e8e8;
  }

  .highlight {
    background-color: #2d2d2d;
    color: #e8e8e8;
  }

  .highlight .c { color: #7f8f8f; }
  .highlight .k { color: #e3e3e3; font-weight: bold; }
  .highlight .n { color: #e3e3e3; }
  .highlight .s { color: #7ec699; }
  .highlight .nb { color: #a8c5d8; }
  .highlight .m { color: #d19a66; }
}
*/

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .markdown-body pre,
  .markdown-body .highlight pre {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
  }

  .markdown-body code,
  .markdown-body pre code {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
  }

  .markdown-body pre code {
    background-color: transparent !important;
  }

  .markdown-body .highlight {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
  }

  .markdown-body .fenced-code-block {
    color: #e5e7eb !important;
  }
}
*/

.aviso-activo a {
  font-size: 1.05em;
}

.aviso-fecha {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-left: 8px;
}

.sin-avisos {
  color: #166534;
  background: #f0fdf4;
  border-left: 4px solid var(--accent-success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .sin-avisos {
    color: #86efac;
    background: rgba(22, 163, 74, 0.1);
  }
}
*/

.avisos-retirados {
  font-size: 0.9em;
  margin-top: 4px;
}

/* Próximos avisos */
.proximos-avisos {
  margin-top: 30px;
  margin-bottom: 20px;
}

.proximos-avisos summary {
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text-primary);
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: background 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}

.proximos-avisos summary:hover {
  color: var(--link-color);
  background-color: var(--bg-primary);
  border-color: var(--link-color);
}

.proximos-avisos details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid var(--border-color);
}

.proximos-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.futuro-aviso {
  border-left: 3px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
  font-size: 0.95em;
  box-shadow: var(--shadow-sm);
}

.futuro-aviso:hover {
  border-left-color: var(--link-color);
}

.futuro-aviso-titulo {
  font-size: 1em;
  font-weight: 500;
}

.futuro-aviso-excerpt {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 4px;
}

.futuro-aviso-fecha {
  font-size: 0.85em;
  color: var(--text-muted);
}

/* Notificaciones */
.notificacion-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #5a1c08;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent-warning);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  animation: fade-in-up 0.35s ease both;
  animation-delay: 0.1s;
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .notificacion-banner {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
  }
}
*/

.notificacion-banner a {
  color: #4b1606;
  background: rgba(0,0,0,0.18);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.95em;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.notificacion-banner a:hover {
  background: rgba(0,0,0,0.14);
  opacity: 1;
  text-decoration: none;
}

/* Alertas dinamicas */
.alerta-meteo,
.alerta-bloqueos,
.banner-trafico {
  font-family: var(--font-body);
  background-color: #f9f9f9;
  border-left: 5px solid #e55353;
  color: #5a1414;
  padding: 12px 60px 12px 16px;
  font-weight: 500;
  font-size: 1.05em;
  position: sticky;
  top: 10px;
  z-index: 9999;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  max-width: 90%;
  margin: 10px auto;
  line-height: 1.4;
  transition: box-shadow 0.15s;
}

.alerta-bloqueos {
  display: none;
  background-color: #fff5f5;
  border-left-color: #e53e3e;
  color: #b10f25;
  font-size: 0.95em;
  box-shadow: var(--shadow-md);
}

.alerta-bloqueos--active {
  display: block;
}

.banner-trafico {
  display: none;
  background-color: #ebf8ff;
  border-left-color: #3182ce;
  color: #173054;
  box-shadow: var(--shadow-md);
}

.banner-trafico--discreto {
  position: relative;
  top: auto;
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 60px 6px 12px;
  font-weight: 400;
  font-size: 0.9em;
  font-family: var(--font-body);
  box-shadow: none;
  opacity: 0.9;
  z-index: 1;
  border-radius: var(--radius-sm);
}

.banner-trafico--destacado {
  position: sticky;
  top: 10px;
  background-color: #ebf8ff;
  border-left: 5px solid #3182ce;
  color: #173054;
  padding: 12px 60px 12px 16px;
  font-weight: 500;
  font-size: 1.05em;
  font-family: var(--font-body);
  box-shadow: var(--shadow-md);
  opacity: 1;
  z-index: 9999;
  border-radius: var(--radius-sm);
  transition: box-shadow 0.15s;
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .alerta-meteo,
  .alerta-bloqueos,
  .banner-trafico {
    background-color: #111827;
    border-left-color: #ef4444;
    color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .alerta-bloqueos {
    background-color: rgba(239, 68, 68, 0.12);
    border-left-color: #ef4444;
    color: #fecaca;
  }

  .banner-trafico--discreto {
    background-color: #111827;
    border-left-color: #374151;
    color: #9ca3af;
  }

  .banner-trafico--destacado {
    background-color: rgba(59, 130, 246, 0.12);
    border-left-color: #60a5fa;
    color: #dbeafe;
  }
}
*/

/* Enlaces de utilidad */
.enlaces-utilidad {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  animation: fade-in-up 0.35s ease both;
  animation-delay: 0.15s;
}

.enlaces-utilidad a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-primary);
  font-size: 0.9em;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  text-decoration: none;
}

.enlaces-utilidad a:hover {
  border-color: var(--link-color);
  background: rgba(72, 81, 216, 0.08);
  color: var(--link-color);
  opacity: 1;
  text-decoration: none;
}

/* Widgets */
.widgets-container {
  max-width: 900px;
  margin: 24px auto;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.95em;
  box-shadow: var(--shadow-md);
  animation: fade-in-up 0.35s ease both;
  animation-delay: 0.05s;
}

.widgets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.widget {
  flex: 1 1 260px;
  min-width: 0;
}

.widget-contenido {
  margin-top: 6px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  width: 100%;
  box-sizing: border-box;
}

.widget-aemet {
  height: auto;
}

.widget-crtm {
  padding: 8px;
  overflow-x: auto;
}

.widget-buses {
  padding: 8px;
  font-size: 0.9em;
  text-align: center;
}

.widget-buses-label {
  margin-top: 4px;
  text-align: center;
  font-size: 0.8em;
}

/* Post - Editar y descargar */
.edit-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.edit-notice p {
  margin: 0;
}

.edit-btn {
  text-decoration: none;
  background-color: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9em;
  font-weight: 500;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.edit-btn:hover {
  background-color: rgba(72, 81, 216, 0.08);
  border-color: var(--link-color);
  color: var(--link-color);
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .edit-btn, .download-btn {
    background-color: #333;
    color: rgba(255, 255, 255, 0.87);
  }
  .edit-btn:hover, .download-btn:hover {
    background-color: #444;
  }
}
*/

/* Aviso de caducidad */
.aviso-caducado {
  background-color: #fff1f0;
  color: var(--accent-danger);
  padding: 16px;
  text-align: center;
  font-size: 1em;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--accent-danger);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .aviso-caducado {
    background-color: rgba(255, 107, 107, 0.15);
    color: #ff9999;
  }
}
*/

/* Modal notificaciones */
.download-app-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
}

.download-app-modal__dialog {
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 80%;
  max-width: 340px;
  margin: 15% auto;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  font-family: var(--font-body);
  font-size: 0.95em;
}

.download-app-modal__title {
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.download-app-modal__primary {
  margin: 15px 0;
  background: var(--link-color);
  color: #ffffff;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: block;
  font-weight: 600;
  font-size: 1em;
  letter-spacing: 0.01em;
  transition: opacity 0.15s;
}

.download-app-modal__primary:hover {
  opacity: 0.88;
}

.download-app-modal__close {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9em;
  box-shadow: none;
  transition: background 0.15s, color 0.15s;
}

.download-app-modal__close:hover {
  background: var(--border-color);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* MODO OSCURO TEMPORALMENTE DESHABILITADO
@media (prefers-color-scheme: dark) {
  .download-app-modal__dialog {
    background: #111827 !important;
    color: #e5e7eb !important;
    border: 1px solid #374151;
  }

  .download-app-modal__primary {
    background: #2563eb !important;
    color: #ffffff !important;
  }

  .download-app-modal__close {
    background: #374151 !important;
    color: #e5e7eb !important;
  }
}
*/

/* Animaciones de entrada suave */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.proximos-avisos {
  animation: fade-in-up 0.35s ease both;
  animation-delay: 0.2s;
}

/* ============================================================
   VISOR DE TRÁFICO — Estética mejorada
   ============================================================ */

.aviso-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  background-color: var(--bg-secondary);
  transition: box-shadow 0.2s, transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.aviso-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.aviso-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.aviso-id {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1em;
}

.aviso-time {
  font-size: 0.9em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.aviso-details {
  margin: 12px 0;
  font-family: var(--font-body);
}

.aviso-details p {
  margin: 6px 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.aviso-location {
  color: var(--text-secondary);
  margin: 8px 0;
  padding: 8px;
  background: rgba(72, 81, 216, 0.05);
  border-left: 3px solid var(--link-color);
  border-radius: var(--radius-sm);
}

.download-btn {
  background-color: var(--link-color);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  font-family: var(--font-body);
  transition: background-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.download-btn:hover:not(:disabled) {
  background-color: var(--link-hover);
  box-shadow: var(--shadow-md);
}

.download-btn:disabled {
  background-color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.situacion-group {
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: var(--bg-primary);
  border-left: 4px solid var(--link-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.situacion-group:hover {
  box-shadow: var(--shadow-md);
}

.situacion-header {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--link-color);
  font-family: var(--font-body);
  font-size: 1em;
  letter-spacing: 0.01em;
}

#traffic-viewer {
  font-family: var(--font-body);
}

#loading {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  font-style: italic;
}

#error {
  background-color: #fff1f0;
  color: var(--accent-danger);
  padding: 12px 16px;
  border-left: 4px solid var(--accent-danger);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 500;
}

/* ============================================================
   WIDGET AEMET — Predicción del tiempo
   ============================================================ */

.widget-aemet {
  position: relative;
  padding: 18px;
  display: flex;
  align-items: stretch;
  gap: 20px;
  min-height: 180px;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-primary);
}

.widget-aemet.ready {
  opacity: 1;
  transform: translateY(0);
}

.col-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 70px;
}

.label-when {
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.date-text {
  font-size: 1.1em;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.widget-aemet .sep {
  width: 1px;
  align-self: stretch;
  background: var(--border-color);
  flex-shrink: 0;
}

.col-icon svg {
  width: 72px;
  height: 72px;
  display: block;
}

.sky-desc {
  font-size: 0.9em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  max-width: 120px;
  overflow-wrap: anywhere;
}

.col-sky-temp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.col-temp {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: center;
}

.temp-max {
  font-size: 2.2em;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.temp-sep {
  font-size: 1.1em;
  color: var(--border-color);
  font-weight: 300;
}

.temp-min {
  font-size: 1.4em;
  font-weight: 400;
  color: var(--link-color);
}

.temp-unit {
  font-size: 0.8em;
  color: var(--text-muted);
  align-self: flex-start;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.col-precip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-end;
}

.precip-pct {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--link-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.precip-pct svg {
  width: 16px;
  height: 16px;
}

.precip-hours {
  font-size: 0.8em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1.5;
  text-align: right;
}

.state-msg {
  font-size: 1em;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
  margin: auto;
}

/* Responsive Mobile - Widget AEMET */
@media (max-width: 768px) {
  .widgets-container {
    padding: 12px;
  }

  .widgets-grid {
    gap: 10px;
  }

  .widget {
    flex: 1 1 100%;
    min-width: 0;
  }

  .widget-aemet {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    min-height: auto;
  }

  .widget-aemet .sep {
    width: 100%;
    height: 1px;
  }

  .col-date {
    min-width: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .label-when {
    font-size: 0.75em;
  }

  .date-text {
    font-size: 0.95em;
  }

  .col-sky-temp {
    flex-direction: row;
    gap: 10px;
  }

  .col-icon svg {
    width: 56px;
    height: 56px;
  }

  .col-temp {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
  }

  .temp-max {
    font-size: 1.8em;
  }

  .temp-sep {
    display: none;
  }

  .temp-min {
    font-size: 1.1em;
  }

  .temp-unit {
    margin-top: 0;
    font-size: 0.7em;
  }

  .sky-desc {
    max-width: none;
    font-size: 0.8em;
  }

  .col-precip {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .precip-pct {
    font-size: 1em;
  }

  .precip-pct svg {
    width: 13px;
    height: 13px;
  }

  .precip-hours {
    display: none;
  }
}

@media (max-width: 480px) {
  .widgets-container {
    padding: 10px;
  }

  .widget-aemet {
    padding: 8px;
    gap: 8px;
  }

  .col-date {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .label-when {
    font-size: 0.7em;
  }

  .date-text {
    font-size: 0.9em;
  }

  .col-sky-temp {
    flex-direction: column;
  }

  .col-icon svg {
    width: 48px;
    height: 48px;
  }

  .temp-max {
    font-size: 1.6em;
  }

  .temp-min {
    font-size: 1em;
  }

  .col-precip {
    justify-content: center;
    width: 100%;
  }

  .precip-pct {
    font-size: 0.95em;
  }
}

/* ============================================================
   WIDGET PRÓXIMOS BUSES
   ============================================================ */

.buses-widget {
  font-family: var(--font-body);
}

#status {
  font-size: 0.95em;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

#aviso-atasco {
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-warning);
  border-radius: var(--radius-sm);
  color: #4f260b;
  font-size: 0.95em;
  margin-bottom: 12px;
  animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#arrivals {
  list-style: none;
  padding: 0;
  margin: 0;
}

#arrivals .Box-row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#arrivals .Box-row:last-child {
  border-bottom: none;
}

#arrivals .Box-row:hover {
  background-color: #f9f9f9 !important;
}

.buses-widget .d-flex {
  display: flex;
}

.buses-widget .flex-justify-between {
  justify-content: space-between;
}

.buses-widget .flex-items-center {
  align-items: center;
}

.buses-widget .d-flex strong {
  font-weight: 600;
  font-size: 1em;
  color: var(--text-primary);
}

.buses-widget .d-flex .color-fg-muted {
  color: var(--text-muted);
  font-size: 0.95em;
  margin-left: 8px;
  font-weight: 400;
}

.buses-widget .text-right {
  text-align: right;
  display: flex;
  align-items: center;
  gap: 12px;
}

.buses-widget .Label {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
}

.buses-widget .Label--accent {
  background: var(--link-color);
  color: white;
}

.buses-widget .btn {
  border: 1px solid var(--border-color);
  background: #f9f9f9;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  padding: 6px 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
}

.buses-widget .btn:hover {
  border-color: var(--link-color);
  background: #fff;
  box-shadow: 0 2px 6px rgba(72, 81, 216, 0.12);
}

.buses-widget .btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
}

.buses-widget .btn-outline:hover {
  background: rgba(72, 81, 216, 0.04);
  border-color: var(--link-color);
}

.buses-widget .d-none {
  display: none !important;
}

.buses-widget .mt-2 {
  margin-top: 8px;
}

#link-atascos {
  text-align: center;
  font-size: 0.85em;
  margin-top: 4px;
  animation: slideDown 0.15s ease-out;
}

/* Generic GitHub-style muted text override for better contrast */
.color-fg-muted {
  color: var(--text-muted) !important;
}

#link-atascos a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

#link-atascos a:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ============================================================
   INDICADOR DE ESTADO DE SERVICIOS
   ============================================================ */

.status-indicator {
  display: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #cbd5e1;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.status-indicator.visible {
  display: inline-block;
}

.status-indicator.status-ok {
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

.status-indicator.status-warning {
  background-color: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
}

.status-indicator.status-neutral {
  background-color: #94a3b8;
}

/* Animación de parpadeo (pulse) */
@keyframes pulse-warning {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.status-indicator.pulse {
  animation: pulse-warning 2s infinite;
}

/* Resaltado del enlace cuando hay servicios caídos */
.enlaces-utilidad a#services-status-link.status-alert {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
  transition: all 0.3s ease;
}

.enlaces-utilidad a#services-status-link.status-alert:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}
