:root {
    --bg: #0d2634;
    --header: #042d54;
    --panel: #183f59;
    --panel2: #13364b;
    --text: #d8e2e8;
    --muted: #91a8b4;
    --mint: #c6edce;
    --accent: #ff8a00;
    --green: #35da82;
    --danger: #ff4d6d;
    --line: #28566e;
    --shadow: 0 6px 18px #06141d55;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #e9f0fa;
    font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}

/* =========================================================
   CONTENEDORES PRINCIPALES
   ========================================================= */

.app-shell,
.station-shell {
    position: relative;
    width: min(100%, 480px);
    min-height: 100vh;
    margin: auto;
    background: linear-gradient(180deg, #102536, #0d3441);
    box-shadow: 0 0 25px #1a324033;
}

/* =========================================================
   CABECERA
   ========================================================= */

.app-header,
.station-header {
    height: 72px;
    padding: 15px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--header);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header div {
    display: grid;
}

.app-header strong {
    font-size: 1.18rem;
    color: var(--mint);
}

.app-header small {
    font-weight: 700;
}

.app-header a {
    color: var(--text);
    text-decoration: none;
}

.menu-button {
    border: 0;
    background: transparent;
    color: #ddd;
    font-size: 1.8rem;
    cursor: pointer;
}

/* =========================================================
   MENÚ LATERAL
   ========================================================= */

.side-menu {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    width: min(78vw, 300px);
    background: #211e1e;
    padding: 16px;
    box-shadow: 8px 0 30px #0008;
}

.side-menu[hidden] {
    display: none;
}

.side-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 17px 8px;
    border-bottom: 1px solid #393434;
    font-weight: 700;
}

.side-menu .danger {
    color: var(--danger);
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 18px;
}

.profile img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

/* =========================================================
   ICONOS MENÚ LATERAL
   ========================================================= */
.menu-button {
    display: grid;
    place-items: center;
}

.menu-button__icon {
    width: 28px;
    height: 28px;
}

.side-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.side-menu__icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    color: var(--mint);
}

.side-menu .danger .side-menu__icon {
    color: var(--danger);
}

/* =========================================================
   COMPASS
   ========================================================= */
    .compass .arrow {
      position: absolute;
      width: 12px;
      height: 100px;
      background: transparent;
      border-radius: 6px;
      top: 24.9px;
      left: 48%;
      transform-origin: bottom center;
      transform: rotate(0deg);
    }
    .compass .arrow::after {
    content: '';
    position: absolute;
    width: 30px; /* Adjust the width of your image */
    height: 40px; /* Adjust the height of your image */
    background-image: url('/wa-assets/images/icons/arrow_compass.png'); /* Specify the image path */
    background-size: cover; /* Ensure the image covers the entire element */
    background-position: center; /* Position the image properly */
    top: -35px;
    left: -9px;
}
.windspeed_compass {
width: 100%;
    position: absolute;
    top: 37%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.compass {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 50%;
}

.dial_compass_icon {
	display: flex;
	justify-content: center;
}

/* =========================================================
   ADSENSE
   ========================================================= */

.alert-ad {
    margin-bottom: 20px;
}

/* =========================================================
   CONTENIDO Y BÚSQUEDA
   ========================================================= */

#weather-app,
.station-content,
.form-page {
    padding: 14px;
}

.search-row {
    position: relative;
    display: flex;
    margin: 8px 0 25px;
    border-radius: 17px;
    overflow: visible;
    background: transparent;
	box-shadow: var(--shadow);
}

.search-row input {
    width: 100%;
    padding: 11px;
    border: 0;
    background: transparent;
    color: var(--text);
    outline: 0;
}

.search-row button {
    border: 0;
    background: transparent;
    color: #ccd8df;
    font-size: 1.5rem;
    padding: 0 12px;
}

.autocomplete {
    position: absolute;
    top: 47px;
    left: 0;
    right: 0;
    background: #fff;
    color: #142c3b;
    z-index: 30;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.autocomplete button {
    display: block;
    width: 100%;
    padding: 11px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #ddd;
    background: #fff;
    color: #142c3b;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

/* =========================================================
   CONDICIONES ACTUALES
   ========================================================= */

.current-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 24px;
}

.current-summary img {
    width: 92px;
}

.temperature {
    font-size: 3.3rem;
    line-height: 1;
    color: var(--mint);
}

.current-summary p,
.pws-current p {
    margin: 4px 0;
    color: var(--muted);
}

.search-row input::placeholder {
    color: #d8e2e8;
    opacity: 1;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 5px;
}

.metric-grid article {
	/*background: var(--panel2); */
    padding: 12px;
    border-radius: 6px;
    /* box-shadow: var(--shadow); */
    font-size: 0.88rem;
	display: flex;
}

/* =========================================================
   PRONÓSTICO
   ========================================================= */

.forecast-list {
    display: grid;
    gap: 12px;
    margin: 38px 0;
}

.forecast-card {
    background: var(--panel);
    padding: 10px 14px;
    border-radius: 18px;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 5px;
    align-items: center;
}

.forecast-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.forecast-card small {
    display: block;
    margin-top: 5px;
}

.forecast-card span {
    text-align: center;
    font-size: 0.78rem;
}

.hot {
    color: #ffb000;
}

.rain {
    color: #75d4ba;
}

/* =========================================================
   PANELES Y GRÁFICAS
   ========================================================= */

.panel {
    background: var(--panel);
    padding: 14px;
    border-radius: 15px;
    margin: 14px 0;
    box-shadow: var(--shadow);
}

.panel h3 {
    font-size: 0.92rem;
    margin: 0 0 14px;
}

.panel canvas {
    max-height: 245px;
}

/* =========================================================
   SOL Y LUNA
   ========================================================= */

.astro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: center;
}

.sun-arc,
.moon {
    font-size: 3.4rem;
    color: #ffc400;
}

.astro-grid p {
    font-size: 0.8rem;
}

/* =========================================================
   RADAR Y ALERTAS
   ========================================================= */

#rain-map {
    height: 370px;
    border-radius: 10px;
    overflow: hidden;
}

.alerts-heading {
    color: #8eda95;
    margin-top: 20px;
}

.alert-card {
    display: block;
    background: var(--panel);
    border-left: 4px solid var(--accent);
    padding: 12px;
    border-radius: 10px;
    margin: 9px 0;
    color: var(--text);
    text-decoration: none;
}

.alert-card strong {
    color: #ffc36b;
}

.alert-card p {
    font-size: 0.8rem;
    margin: 5px 0;
}

/* =========================================================
   ESTACIÓN METEOROLÓGICA
   ========================================================= */

.station-header {
    height: 48px;
    font-size: 0.72rem;
}

.station-title {
    text-align: right;
    font-size: 0.72rem;
    margin: 4px 0 12px;
}

.online {
    color: var(--green);
}

.offline {
    color: #aab3b9;
}

.pws-current {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 10px;
}

.pws-current .temperature {
    font-size: 3rem;
}

.mini-metrics {
    display: grid;
    gap: 4px;
}

.mini-metrics span {
    background: var(--panel2);
    padding: 6px;
    border-radius: 5px;
    font-size: 0.7rem;
}

/* =========================================================
   BRÚJULA
   ========================================================= */

.compass-card {
    margin: 14px 0;
    background: var(--panel2);
    border-radius: 12px;
    padding: 10px;
}

.compass-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
}



.compass .north {
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    font-weight: bold;
}

.compass strong {
    font-size: 1.5rem;
    color: var(--mint);
}

.compass strong small {
    font-size: 0.7rem;
}

.compass em {
    font-style: normal;
    font-size: 1rem;
}

.needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 96px;
    background: linear-gradient(
        var(--danger) 50%,
        #d7e1e6 50%
    );
    transform-origin: 50% 0;
    transform: rotate(var(--direction, 0deg));
    clip-path: polygon(
        50% 0,
        100% 100%,
        50% 85%,
        0 100%
    );
}

/* =========================================================
   DATOS DIARIOS
   ========================================================= */

.daily {
    margin: 14px 0;
}

.daily article {
    text-align: center;
    min-height: 82px;
    display: grid;
    place-content: center;
    font-size: 0.7rem;
    margin-bottom: 10px;
    justify-items: center;
    border: solid 1px #c2c2c2;
}

.daily strong {
    display: block;
    font-size: 1rem;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.form-card {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.form-card h2 {
    color: var(--accent);
    font-size: 1rem;
    margin: 0;
}

.form-card label {
    display: grid;
    gap: 7px;
    font-size: 0.75rem;
    font-weight: 700;
}

.form-card input,
.form-card select {
    width: 100%;
    background: #fff;
    color: #172d3a;
    border: 0;
    border-radius: 4px;
    padding: 11px;
}

.button {
    display: inline-block;
    width: max-content;
    border: 0;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 5px;
    font-weight: 800;
    cursor: pointer;
}

/* =========================================================
   MENSAJES
   ========================================================= */

.success,
.warning,
.notice {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.success {
    background: #185839;
}

.warning {
    background: #633c16;
}

.notice {
    font-size: 0.82rem;
}

/* =========================================================
   LISTADOS Y TABLAS
   ========================================================= */

.checkbox-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    background: var(--panel2);
    padding: 9px;
    border-radius: 8px;
}

.checkbox-list input {
    width: auto;
}

.station-table {
    display: grid;
    gap: 6px;
}

.station-table label {
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    background: #22628a;
    padding: 8px;
}

.station-table input {
    width: auto;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state .button {
    margin-top: 14px;
}

/* =========================================================
   PANTALLAS GRANDES
   ========================================================= */

@media (min-width: 780px) {
    .station-shell {
        width: min(100%, 900px);
    }

    .station-content {
        padding: 22px;
    }

    .station-content > .panel {
        max-width: none;
    }

    .station-content:has(#solar-chart) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .station-content:has(#solar-chart) > .station-title,
    .station-content:has(#solar-chart) > .warning,
    .station-content:has(#solar-chart) > .pws-current,
    .station-content:has(#solar-chart) > .compass-card,
    .station-content:has(#solar-chart) > .metric-grid {
        grid-column: 1 / -1;
    }

    .astro-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.push-settings {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
}

.push-settings__copy h2,
.push-settings__copy p {
    margin: 0 0 7px;
}

.push-settings__copy small {
    color: var(--muted);
}

.push-toggle {
    min-width: 105px;
}

.push-toggle.is-active {
    background: var(--green);
    color: #082719;
}

.push-toggle:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 390px) {
    .push-settings {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   AVISOS METEOROLÓGICOS ACTIVOS
   ========================================================= */

.active-alerts-page {
    padding-bottom: 35px;
}

.active-alerts-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.active-alerts-intro > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.active-alerts-intro__count {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--mint);
}

.active-alerts-intro__manage {
    color: var(--mint);
    font-size: 0.82rem;
    text-decoration: none;
}

.active-alerts-region {
    margin-top: 24px;
}

.active-alerts-region__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.active-alerts-region__header h2 {
    margin: 0;
    color: var(--mint);
    font-size: 1.1rem;
}

.active-alerts-region__header > span {
    min-width: 27px;
    padding: 4px 8px;
    border-radius: 20px;
    background: var(--panel2);
    text-align: center;
    font-size: 0.78rem;
}

.active-alert {
    margin-bottom: 12px;
    padding: 15px;
    border-left: 4px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.active-alert--extreme {
    border-left-color: #ff4d6d;
}

.active-alert--severe {
    border-left-color: #ff8a00;
}

.active-alert--moderate {
    border-left-color: #ffc400;
}

.active-alert--minor {
    border-left-color: #35da82;
}

.active-alert__topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.active-alert__severity {
    font-size: 0.76rem;
    font-weight: 800;
}

.active-alert--extreme .active-alert__severity {
    color: #ff7890;
}

.active-alert--severe .active-alert__severity {
    color: #ffad55;
}

.active-alert--moderate .active-alert__severity {
    color: #ffdb65;
}

.active-alert--minor .active-alert__severity {
    color: #74e5a2;
}

.active-alert__event {
    color: var(--muted);
    font-size: 0.76rem;
}

.active-alert h3 {
    margin: 11px 0 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.active-alert__area,
.active-alert__expires {
    margin: 7px 0;
    font-size: 0.8rem;
    line-height: 1.45;
}

.active-alert__area {
    color: var(--muted);
}

.active-alert__details {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid rgba(216, 226, 232, 0.15);
    font-size: 0.8rem;
    line-height: 1.55;
}

.active-alert__details summary {
    color: var(--mint);
    cursor: pointer;
}

.active-alert__instruction {
    padding: 10px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.15);
}

.active-alerts-empty {
    padding: 23px 18px;
}

.active-alerts-empty h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.active-alerts-empty p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.active-alerts-empty__regions {
    color: var(--mint) !important;
}
