.maho-meteo-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    padding: 0;
    margin: 0;
    background: #0f172a;
    overflow-y: auto;
    overflow-x: hidden;
}

body.admin-bar .maho-meteo-map {
    top: 32px;
    height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .maho-meteo-map {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

.maho-meteo-map__wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
}

.maho-meteo-map__canvas {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* --- Floating Panel (Glassmorphism) --- */
.maho-meteo-map__panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 340px;
    max-height: calc(100% - 40px);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.maho-meteo-map__panel.is-open {
    transform: translateX(0);
    opacity: 1;
}

.maho-meteo-panel__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    width: 32px;
    height: 32px;
    padding: 0; /* Asegura que no haya padding heredado que lo estire */
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    box-sizing: border-box;
}

.maho-meteo-panel__close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

.maho-meteo-map__panel-content {
    padding: 20px 20px 10px 20px;
    overflow-y: visible;
}

.maho-meteo-station-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.maho-meteo-station-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 700;
}

.maho-source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.maho-source-aemet { background: #3b82f6; } /* Blue */
.maho-source-grafcan { background: #f97316; } /* Orange */
.maho-source-particular { background: #800000; } /* Maroon (Granate) */

.maho-meteo-station-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

/* --- Metrics Grid --- */
.maho-meteo-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.maho-meteo-metric-item {
    background: rgba(255, 255, 255, 0.45);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
}

.maho-meteo-metric-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.maho-meteo-metric-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.maho-meteo-metric-value small {
    font-size: 0.7rem;
    font-weight: 400;
    color: #64748b;
}

/* ============================================================
   Legend Wrapper
   ============================================================ */
.maho-meteo-legend-wrapper {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    pointer-events: none;
}
.maho-meteo-legend-wrapper .maho-meteo-dynamic-legend {
    pointer-events: auto;
    position: static;
    transform: none;
}

/* --- Dynamic Legend --- */
.maho-meteo-dynamic-legend {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 320px;
}

.legend-title {
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.legend-gradient {
    width: 100%;
    height: 18px;
    border-radius: 9px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0px 1px 3px rgba(0,0,0,0.9), 0px 0px 1px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.legend-labels {
    width: 100%;
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* ============================================================
   FAB Speed Dial
   ============================================================ */
.maho-fab-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* --- Main FAB Button (matches top menu format, blue) --- */
.maho-fab-main {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45), 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    flex-shrink: 0;
}
.maho-fab-main:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.6), 0 3px 8px rgba(0,0,0,0.3);
}
.maho-fab-main.is-open {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.maho-fab-icon-open,
.maho-fab-icon-close {
    width: 20px;
    height: 20px;
    position: absolute;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.maho-fab-icon-open  { opacity: 1; transform: scale(1) rotate(0deg); }
.maho-fab-icon-close { opacity: 0; transform: scale(0.4) rotate(-45deg); }
.maho-fab-main.is-open .maho-fab-icon-open  { opacity: 0; transform: scale(0.4) rotate(45deg); }
.maho-fab-main.is-open .maho-fab-icon-close { opacity: 1; transform: scale(1) rotate(0deg); }

/* --- Speed Dial Menu (opens downward, absolute overlay) --- */
.maho-fab-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    z-index: 2000;
    min-width: max-content;
}
.maho-fab-container.is-open .maho-fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- FAB Item Row (label + icon button) --- */
.maho-fab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    position: relative;
    opacity: 0;
    transform: translateY(-6px) scale(0.95);
    transition: opacity 0.20s ease var(--fab-delay, 0s),
                transform 0.20s cubic-bezier(0.34, 1.56, 0.64, 1) var(--fab-delay, 0s);
}
.maho-fab-container.is-open .maho-fab-item {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- FAB Label Chip --- */
.maho-fab-label {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 99px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    user-select: none;
    pointer-events: none;
}

/* --- FAB Item Icon Button --- */
.maho-fab-item-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: normal;
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
    gap: 0;
}
.maho-fab-item-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.maho-fab-item-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.28);
    transform: scale(1.08);
}
.maho-fab-item-btn.is-active,
.maho-fab-item-btn.btn-active {
    background: rgba(59, 130, 246, 0.22);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}
.maho-fab-item-btn .maho-refresh-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}
.maho-fab-item-btn.is-loading .maho-refresh-icon {
    animation: mahoMapRefreshSpin 1s linear infinite;
    color: #38bdf8;
}

@keyframes mahoMapRefreshSpin {
    100% { transform: rotate(360deg); }
}

/* --- FAB Submenu Panel --- */
.maho-fab-submenu {
    position: absolute;
    right: 54px;
    top: 0;
    bottom: auto;
    min-width: 185px;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
    z-index: 2002;
    pointer-events: none;
}
.maho-fab-has-sub.is-open .maho-fab-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}
.maho-fab-submenu::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 14px;
    border-width: 7px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(15, 23, 42, 0.94);
}

/* --- Sub-label (shows active selection) --- */
.maho-fab-label-main {
    display: inline;
}
.maho-fab-label-sub {
    display: inline;
    font-size: 0.7rem;
    color: #60a5fa;
    font-weight: 500;
    margin-left: 4px;
    opacity: 0.9;
}
.maho-fab-label-sub:empty {
    display: none;
}
.maho-fab-label-sub::before {
    content: '›';
    margin-right: 2px;
    opacity: 0.7;
}

/* --- Layer Buttons (inside submenus) --- */
.maho-layer-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: normal;
    min-height: auto;
    height: auto;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    white-space: nowrap;
}
.maho-layer-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.maho-layer-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}
.maho-layer-btn.is-active {
    background: rgba(59, 130, 246, 0.22);
    color: #3b82f6;
    box-shadow: none;
}

/* When Avisos FAB button carries both classes, FAB circle style wins */
.maho-fab-item-btn.maho-layer-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    white-space: normal;
}
.maho-fab-item-btn.maho-layer-btn.is-active {
    background: rgba(59, 130, 246, 0.22);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}
@media screen and (max-width: 768px) {
    .maho-fab-item-btn.maho-layer-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}

/* --- Mobile Adjustments --- */
@media screen and (max-width: 768px) {
    .maho-fab-main {
        width: 40px;
        height: 40px;
    }
    .maho-fab-icon-open,
    .maho-fab-icon-close {
        width: 18px;
        height: 18px;
    }
    .maho-fab-item-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    .maho-fab-submenu {
        right: 50px;
        min-width: 160px;
    }
    .maho-fab-label {
        font-size: 0.72rem;
        padding: 4px 10px;
    }
    .maho-meteo-legend-wrapper {
        bottom: 16px;
    }
    .maho-meteo-dynamic-legend {
        width: 280px;
        padding: 8px 15px;
    }
    .legend-title {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    .maho-fab-item-btn.maho-layer-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}

/* --- Markers (Polished) --- */
.maho-meteo-wind-icon {
    background: transparent;
    border: none;
}

.maho-meteo-marker__temp-circle {
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.station-source-label {
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: none;
    padding: 2px 4px;
    font-size: 8px;
    font-weight: 800;
}

/* --- Inline Charts --- */
#maho-meteo-charts-container {
    padding: 0 20px 20px 20px;
}

.maho-meteo-chart-wrapper {
    position: relative;
    height: 160px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* --- Timeline Control Integrado en Leyenda --- */
.maho-meteo-timeline-control {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #fff;
    box-sizing: border-box;
}

/* Compact single-row layout */
.maho-tl-main-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.maho-tl-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.maho-tl-date-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.maho-meteo-timeline-control::after {
    display: none;
}

.maho-meteo-timeline-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}
.maho-meteo-timeline-loading b {
    color: #3b82f6;
    margin-left: 4px;
    font-weight: 700;
}

.maho-meteo-timeline-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
}
.maho-meteo-timeline-btn svg {
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.maho-meteo-timeline-btn:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.6);
}

/* Play button — slightly larger and more prominent */
.maho-tl-play-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
.maho-tl-play-btn:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.6);
}

/* Small nav buttons */
.maho-tl-nav-btn {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    background: rgba(255,255,255,0.12);
    box-shadow: none;
}
.maho-tl-nav-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: scale(1.1);
    box-shadow: none;
}

.maho-meteo-timeline-slider-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
    margin: 0 5px;
    gap: 8px;
}

/* Used by compact layout */
.maho-tl-track {
    flex: 1;
    min-width: 0;
}

.maho-meteo-timeline-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    margin: 0;
}
.maho-meteo-timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
    transition: transform 0.15s;
}
.maho-meteo-timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.maho-meteo-timeline-ticks {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 1px;
}
.maho-meteo-timeline-ticks span {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}
.maho-meteo-timeline-tick {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

.maho-meteo-timeline-label {
    min-width: 60px;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    text-align: center;
}

/* --- Mobile Breakpoint --- */
@media (max-width: 600px) {
    .maho-meteo-map__wrapper {
        height: 100%;
    }
    
    .maho-meteo-map__panel {
        top: auto;
        bottom: 0px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
        z-index: 2500; /* Siempre encima de todo en móvil */
    }

    .maho-meteo-map__panel.is-open {
        transform: translateY(0);
    }
    
    .maho-meteo-map__legend {
        bottom: auto;
        top: 10px;
        left: 10px;
        transform: none;
        border-radius: 8px;
        align-items: flex-start;
        padding: 6px;
    }
    .maho-meteo-legend-scale {
        width: 100px;
    }

    /* --- Mobile Bottom Bar & Timeline Adjustments --- */
    .maho-meteo-bottom-control-bar {
        width: 95vw;
        bottom: calc(env(safe-area-inset-bottom, 12px) + 50px);
    }
    
    .maho-meteo-bottom-bar-inner {
        flex-wrap: wrap;
        border-radius: 16px;
        justify-content: center;
        padding: 10px;
        gap: 8px;
    }

    .maho-meteo-bar-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .maho-meteo-bar-divider {
        display: none;
    }

    .maho-layer-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        color: #cbd5e1; /* Mejorado contraste para móvil */
    }

    .maho-meteo-timeline-control {
        padding: 0;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .maho-meteo-timeline-ticks {
        display: none;
    }

    .maho-tl-date-label {
        display: none; /* saves space on mobile; date shown elsewhere or omitted */
    }

    .maho-meteo-timeline-control::after {
        display: none;
    }

    .maho-meteo-dynamic-legend {
        width: 100%;
        max-width: 100%;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(100% + 10px);
    }
}

/* --- Wind Oscillation Animation --- */
@keyframes mahoWindFlutter {
    0% { transform: rotate(-2deg); }
    30% { transform: rotate(3deg); }
    60% { transform: rotate(-1deg); }
    100% { transform: rotate(2deg); }
}

/* --- Rain Drop Animation --- */
@keyframes mahoRainFall {
    0% { transform: translateY(-2px); opacity: 0; }
    20% { opacity: 1; }
    80% { transform: translateY(4px); opacity: 0; }
    100% { transform: translateY(4px); opacity: 0; }
}
.maho-rain-drops line {
    animation: mahoRainFall 1.2s linear infinite;
}
.maho-rain-drops line:nth-child(1) { animation-delay: 0s; }
.maho-rain-drops line:nth-child(2) { animation-delay: 0.4s; }
.maho-rain-drops line:nth-child(3) { animation-delay: 0.8s; }

/* --- AEMET Avisos Markers --- */
.maho-warning-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.maho-warning-pulse {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
    position: relative;
    border: 2.5px solid rgba(255,255,255,0.9);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 500;
}

.maho-warning-pulse:hover {
    transform: scale(1.15);
    z-index: 1500;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
}

.maho-warning-pulse::after {
    content: '';
    position: absolute;
    top: -2.5px;
    left: -2.5px;
    right: -2.5px;
    bottom: -2.5px;
    border-radius: 50%;
    animation: mahoPulse 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    pointer-events: none;
}

@keyframes mahoPulse {
    0% { transform: scale(1); opacity: 0.85; }
    60% { transform: scale(2.4); opacity: 0; }
    100% { transform: scale(2.4); opacity: 0; }
}

.maho-warning-yellow { background: #eab308; }
.maho-warning-yellow::after { border: 3px solid #eab308; }

.maho-warning-orange { background: #f97316; }
.maho-warning-orange::after { border: 3px solid #f97316; }

.maho-warning-red { background: #ef4444; }
.maho-warning-red::after { border: 3px solid #ef4444; }

.maho-warning-icon {
    width: 20px;
    height: 20px;
    stroke: white;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

.maho-warning-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.maho-warning-marker:hover {
    transform: scale(1.15);
    z-index: 2000;
}

.maho-alert-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    border-radius: 12px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    border: 2.5px solid white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    z-index: 11;
}

/* Coastal Alerts: Moving Waves */
.maho-coastal-marker {
    border-radius: 8px !important; /* Slightly more square/wave-like base if desired, or keep circle */
}

.maho-wave-svg {
    width: 22px;
    height: 22px;
    animation: mahoWaveMove 1.8s ease-in-out infinite;
}

@keyframes mahoWaveMove {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

.maho-coastal-marker::after {
    border-radius: 8px !important;
    animation: mahoWavePulse 2.5s ease-out infinite !important;
}

@keyframes mahoWavePulse {
}

/* Custom Popup for Alerts - Premium Dark Theme */
.maho-alert-popup-container .leaflet-popup-content-wrapper {
    background: #0f172a !important; /* Deep Navy */
    color: #f8fafc !important;
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    overflow: hidden;
}

.maho-alert-popup-container .leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

.maho-alert-popup {
    padding: 16px 20px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 1));
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.maho-alert-popup-container .leaflet-popup-tip {
    background: #0f172a !important;
    border: 1px solid rgba(255,255,255,0.1);
}

.maho-alert-popup-container .leaflet-popup-close-button {
    color: #94a3b8 !important;
    padding: 12px 12px 0 0 !important;
}
.maho-alert-popup h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 800;
    color: #f8fafc;
}
.maho-alert-severity {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.maho-alert-time {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.maho-alert-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: #cbd5e1;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

/* --- User Actions Top Right --- */
.maho-meteo-top-right-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    pointer-events: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Botón Info adicional */
.maho-info-btn {
    background: rgba(30, 41, 59, 0.75);
}
.maho-info-btn:hover {
    background: rgba(51, 65, 85, 0.95);
}

.maho-user-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}

.maho-user-action-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Estado desconectado (llamar a la acción) */
.maho-user-action-btn.maho-btn-highlight {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.9), rgba(56, 189, 248, 0.9));
    border-color: rgba(255,255,255,0.2);
}

.maho-user-action-btn.maho-btn-highlight:hover {
    background: linear-gradient(135deg, rgba(2, 132, 199, 1), rgba(14, 165, 233, 1));
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.maho-user-action-icon {
    width: 18px;
    height: 18px;
}

.maho-user-action-plus {
    display: none; /* Solo visible en móvil */
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
    margin-right: -4px;
}

/* Responsive de acciones superiores */
@media (max-width: 600px) {
    .maho-meteo-top-right-actions {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .maho-user-action-btn {
        padding: 8px 12px;
        border-radius: 12px;
        gap: 6px;
    }
    
    .maho-user-action-text {
        display: none; /* Ocultar texto en móvil */
    }
    
    .maho-user-action-icon {
        width: 20px;
        height: 20px;
    }
    
    .maho-user-action-plus {
        display: block; /* Mostrar icono de sumar en botón destacado */
    }
}

/* ============================================================
   UV Index Panel
   ============================================================ */
.maho-uv-panel {
    position: absolute;
    bottom: 52px;
    left: 14px;
    z-index: 1000;
    background: rgba(10, 18, 35, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px 16px 12px;
    width: 200px;
    color: #f8fafc;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    display: none;
    animation: mahoFadeInUp 0.35s ease-out;
}
.maho-uv-panel.is-visible { display: block; }

.maho-uv-panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 11px;
}
.maho-uv-time {
    margin-left: auto;
    font-size: 0.6rem;
    color: #334155;
}

/* Main value + badge */
.maho-uv-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}
.maho-uv-value {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    min-width: 58px;
    color: #f1f5f9;
    transition: color 0.4s;
}
.maho-uv-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    color: #0f172a;
    background: #facc15;
    transition: background 0.4s, color 0.4s;
    white-space: nowrap;
}

/* Spinner while loading */
.maho-uv-spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: mahoSpin 0.8s linear infinite;
}
@keyframes mahoSpin { to { transform: rotate(360deg); } }

/* Color scale */
.maho-uv-scale-wrap { margin-bottom: 10px; }
.maho-uv-scale-bar {
    display: flex;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 0;
}
.maho-uv-seg { flex: 1; border-radius: 2px; }
.maho-uv-marker-row {
    position: relative;
    height: 8px;
    margin-bottom: 2px;
}
.maho-uv-marker {
    position: absolute;
    top: 1px;
    width: 10px; height: 10px;
    background: #fff;
    border: 2px solid rgba(15,23,42,0.9);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.6s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}
.maho-uv-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.56rem;
    color: #475569;
    padding: 0 1px;
}

/* Advice */
.maho-uv-advice {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border-left: 3px solid #334155;
    transition: border-color 0.4s;
}
.maho-uv-advice:empty { display: none; }

/* Footer */
.maho-uv-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.62rem;
    color: #475569;
}
.maho-uv-footer strong { color: #94a3b8; }
.maho-uv-src { color: #1e3a5f; font-size: 0.58rem; }

@media screen and (max-width: 480px) {
    .maho-uv-panel { bottom: 56px; left: 8px; width: 180px; }
}

/* ============================================================
   Ranking Modal — Máximos y Mínimos del Día
   ============================================================ */
.maho-ranking-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.maho-ranking-modal.is-visible { display: flex; }

.maho-ranking-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.maho-ranking-dialog {
    position: relative;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 24px 48px rgba(0,0,0,0.55);
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #f8fafc;
    z-index: 1;
    animation: mahoFadeInUp 0.3s ease-out;
}
.maho-ranking-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    line-height: 1;
    padding: 0;
}
.maho-ranking-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

.maho-ranking-header {
    padding: 20px 20px 0;
}
.maho-ranking-title {
    margin: 0 30px 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.maho-ranking-date {
    font-size: 0.72rem;
    color: #475569;
    margin: 0 0 14px 0;
    text-transform: capitalize;
}

/* --- Tabs --- */
.maho-ranking-tabs {
    display: flex;
    gap: 6px;
    padding: 0 16px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 2px;
}
.maho-ranking-tabs::-webkit-scrollbar { display: none; }
.maho-ranking-tab {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #64748b;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
}
.maho-ranking-tab:hover { border-color: rgba(255,255,255,0.2); color: #94a3b8; }
.maho-ranking-tab.is-active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* --- Ranking List --- */
.maho-ranking-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px 16px;
}
.maho-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.maho-ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 9px 12px;
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}
.maho-ranking-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(59,130,246,0.25); }

.maho-ranking-goto {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255,255,255,0.15);
    transition: color 0.2s, transform 0.2s;
    margin-left: 2px;
}
.maho-ranking-item:hover .maho-ranking-goto {
    color: #60a5fa;
    transform: translateX(3px);
}
.maho-ranking-item.rank-1 { border-color: rgba(234,179,8,0.35); background: rgba(234,179,8,0.07); }
.maho-ranking-item.rank-2 { border-color: rgba(148,163,184,0.3); background: rgba(148,163,184,0.05); }
.maho-ranking-item.rank-3 { border-color: rgba(180,120,60,0.3); background: rgba(180,120,60,0.06); }

.maho-ranking-pos {
    font-size: 1.1rem;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
    color: #475569;
    font-weight: 700;
    line-height: 1;
}
.rank-1 .maho-ranking-pos { color: #eab308; }
.rank-2 .maho-ranking-pos { color: #94a3b8; }
.rank-3 .maho-ranking-pos { color: #b47840; }

.maho-ranking-info {
    flex: 1;
    min-width: 0;
}
.maho-ranking-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.maho-ranking-value {
    font-size: 1.05rem;
    font-weight: 700;
    flex-shrink: 0;
    text-align: right;
    min-width: 60px;
}
.maho-ranking-value small {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 1px;
    font-weight: 600;
}
.maho-ranking-empty {
    text-align: center;
    color: #475569;
    padding: 48px 20px;
    font-size: 0.85rem;
}

@media screen and (max-width: 480px) {
    .maho-ranking-dialog { max-height: 94vh; border-radius: 12px; }
    .maho-ranking-tab { font-size: 0.68rem; padding: 4px 10px; }
    .maho-ranking-name { font-size: 0.78rem; }
    .maho-ranking-value { font-size: 0.95rem; }
}

/* --- Share button inside Ranking modal --- */
.maho-ranking-share-btn {
    position: absolute;
    top: 12px;
    right: 52px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #60a5fa;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    padding: 0;
}
.maho-ranking-share-btn:hover { background: rgba(59, 130, 246, 0.26); color: #93c5fd; }

/* ============================================================
   Share Modal — Compartir Rankings
   ============================================================ */
.maho-share-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.maho-share-modal.is-visible { display: flex; }

.maho-share-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.maho-share-dialog {
    position: relative;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 24px 48px rgba(0,0,0,0.6);
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #f8fafc;
    z-index: 1;
    animation: mahoFadeInUp 0.3s ease-out;
}

.maho-share-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    gap: 8px;
}
.maho-share-dialog-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f1f5f9;
    flex: 1;
    text-align: center;
}
.maho-share-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.maho-share-back-btn:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }

.maho-share-close-btn {
    background: rgba(255,255,255,0.06);
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    font-family: inherit;
}
.maho-share-close-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* --- Link copy box --- */
.maho-share-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.maho-share-link-input {
    flex: 1;
    min-width: 0;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-family: inherit;
    padding: 7px 10px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
}
.maho-share-link-input:focus { border-color: rgba(59,130,246,0.4); color: #cbd5e1; }
.maho-share-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    color: #60a5fa;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.maho-share-copy-btn:hover { background: rgba(59,130,246,0.26); color: #93c5fd; }
.maho-share-copy-btn.is-copied {
    background: rgba(16,185,129,0.18);
    border-color: rgba(16,185,129,0.4);
    color: #34d399;
}

/* --- Share Tabs --- */
.maho-share-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.maho-share-tabs::-webkit-scrollbar { display: none; }
.maho-share-tab {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #64748b;
    padding: 4px 11px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
}
.maho-share-tab:hover { border-color: rgba(255,255,255,0.2); color: #94a3b8; }
.maho-share-tab.is-active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* --- Canvas Preview --- */
.maho-share-preview-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    background: rgba(0,0,0,0.22);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.maho-share-preview-wrap::-webkit-scrollbar { width: 4px; }
.maho-share-preview-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
#maho-share-canvas {
    display: block;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}

/* --- Share Action Buttons --- */
.maho-share-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.maho-share-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
}
.maho-share-dl-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: #e2e8f0;
}
.maho-share-dl-btn:hover { background: rgba(255,255,255,0.13); }
.maho-share-native-btn {
    background: #3b82f6;
    color: #fff;
}
.maho-share-native-btn:hover { background: #2563eb; }

@media screen and (max-width: 480px) {
    .maho-share-dialog { border-radius: 12px; }
    .maho-share-action-btn { font-size: 0.78rem; padding: 10px 10px; }
}

/* --- Info Modal --- */
.maho-meteo-info-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.maho-meteo-info-modal.is-visible {
    display: flex;
}
.maho-info-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.maho-info-dialog {
    position: relative;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    color: #f8fafc;
    z-index: 1;
    animation: mahoFadeInUp 0.3s ease-out;
}
.maho-info-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}
.maho-info-close:hover {
    color: #ffffff;
}
.maho-info-title {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}
.maho-info-section {
    margin-bottom: 20px;
}
.maho-info-section h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #38bdf8;
}
.maho-info-section p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
}
.maho-info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}
.maho-info-list li {
    font-size: 0.92rem;
    color: #cbd5e1;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.maho-legend-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
@keyframes mahoFadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- New Unified Menu (Top-Right) --- */
.maho-meteo-top-right-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.maho-menu-container {
    position: relative;
    display: inline-block;
}

.maho-menu-btn {
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.maho-menu-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.maho-menu-btn svg {
    width: 24px;
    height: 24px;
}

.maho-notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background-color: #ef4444;
    border: 2px solid #0f172a;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    display: none; /* Controlled by JS */
}

.maho-notification-dot.is-pulsing {
    animation: mahoPulseRed 1.8s infinite;
}

@keyframes mahoPulseRed {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.maho-menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    padding: 8px;
    z-index: 4001;
    overflow: hidden;
    transform-origin: top right;
}

.maho-menu-dropdown.is-open {
    display: flex;
    animation: mahoFadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mahoFadeInDown {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.maho-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.maho-menu-item:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #38bdf8;
    padding-left: 20px;
}

.maho-menu-item svg {
    width: 18px;
    height: 18px;
    color: currentColor;
    opacity: 0.8;
}

.maho-menu-item-highlight {
    background: rgba(37, 99, 235, 0.1);
    color: #38bdf8;
}
 
.maho-menu-item-logout {
    color: rgba(239, 68, 68, 0.9);
}

.maho-menu-item-logout:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

.maho-menu-item__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.maho-menu-item__hint {
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
    line-height: 1;
}

.maho-menu-item--restricted {
    opacity: 0.8;
}

.maho-menu-item--restricted:hover .maho-menu-item__hint {
    color: #94a3b8;
}

/* Adjust Leaflet zoom position to avoid menu */
.maho-meteo-map .leaflet-top.leaflet-left {
    top: 75px !important;
}

@media screen and (max-width: 600px) {
    .maho-meteo-top-right-actions {
        top: 15px;
        right: 15px;
    }
}
/* WRF Variable Switcher */
.maho-wrf-var-picker {
    width: 100%;
    margin-bottom: 12px;
}
.maho-wrf-var-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.maho-wrf-var-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.maho-wrf-var-btn.is-active {
    background: #3b82f6;
    border-color: #60a5fa;
    color: #fff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}
@media (max-width: 480px) {
    .maho-wrf-var-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* --- Reproductor Dinámico (Weather Player) --- */
.maho-meteo-animator {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    /* (4) Completamente transparente: solo glassmorphism sin fondo oscuro */
    background: transparent;
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid rgba(99, 179, 255, 0.25);
    border-radius: 20px;
    padding: 10px 15px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    color: #fff;
    animation: mahoFadeInUp 0.3s ease-out;
}

.animator-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.animator-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}

.animator-play-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.animator-play-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.animator-play-btn.is-playing svg {
    margin-left: 0;
}

.animator-timeline {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.animator-timeline-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.animator-timeline-progress {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s linear;
}

.animator-timestamp {
    font-size: 11px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

@media (max-width: 600px) {
    .maho-meteo-animator {
        bottom: 120px;
    }
}

/* (3) Color azul-cián visible pero suave para los tiles de isobaras DWD */
.maho-dwd-isobars-frame {
    filter: hue-rotate(200deg) saturate(1.4) brightness(1.6) contrast(0.9) drop-shadow(0 0 3px rgba(80, 190, 255, 0.45));
    transition: opacity 0.4s ease;
}

/* Badge "+" para indicar frames futuros en el reproductor */
.animator-future-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    margin-right: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}

