/* ========================================
    LEGENDS: THERMOMETER AND WIND DIAL
    ======================================== */

/* Generic scalar legend (temperature, rain, etc.) */
.scalar-legend {
    pointer-events: auto;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    z-index: 1000;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 16px;
    display: none;
    border-radius: 2em;
    margin: 10px 5px;
}

.scalar-legend.active {
    display: block;
}

.scalar-thermometer {
    position: relative;
}

.scalar-tube-container {
    position: relative;
}

.scalar-tube {
    position: relative;
    height: 1em;
    width: 17em;
    background: transparent;
    border-radius: 1em;
    overflow: visible;
    border: 1px solid #5e5e5e;

}

/* Thermometer bulb - styles specific per variable 
#temp-legend .scalar-tube::before {
    box-sizing: border-box;  
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
    height: 1em;
    border-radius: 50%;
    box-shadow: inset 5px 0px 4px 0px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

#rain-legend .scalar-tube::before {
    box-sizing: border-box;
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
    height: 1em;
    border-radius: 50%;
    z-index: 3;
}

#humidity-legend .scalar-tube::before {
    box-sizing: border-box;
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: 2px solid #4682B4;
    background: #4682B4;
    box-shadow: inset 5px 0px 4px 0px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

#wind-scalar-legend .scalar-tube::before {
    box-sizing: border-box;
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
    height: 1em;
    border-radius: 50%;
    box-shadow: inset 5px 0px 4px 0px rgba(0, 0, 0, 0.2);
    z-index: 3;
}*/

.scalar-tube-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 0;
    border-radius: 0.5em;
}

.scalar-bulb-label {
    position: absolute;
    left: -0.75em;
    width: 1.75em;
    height: 1.75em;
    display: flex;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 0.05em 0.15em rgba(0, 0, 0, 0.6), 0 0 0.25em rgba(0, 0, 0, 0.4);
    z-index: 10;
    pointer-events: none;
}

/* Shadow adjustment for the rain label */
#rain-legend .scalar-bulb-label {
    font-size: 12px;
    text-shadow: 0 0.05em 0.15em rgba(0, 0, 0, 0.2), 0 0 0.25em rgba(0, 0, 0, 0.1);
}

.scalar-scale {
    position: absolute;
    width: 100%;
    height: 1em;
    z-index: 2;

}

.scalar-tick {
    position: absolute;
    text-align: center;
    font-size: 12px;
    color: #ffffffff;
    transform: translateX(-50%);
}

.scalar-indicator {
    position: absolute;
    top: -0.25em;
    left: 50%;
    width: 0.125em;
    height: 1.5em;
    background: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);
    box-shadow: 0 0 0.25em rgba(0, 0, 0, 0.4), 0 0 0.5em rgba(0, 0, 0, 0.4);
    transform: translateX(-0.0625em);
    transition: left 0.15s ease-out;
    pointer-events: none;
    border-radius: 0.0625em;
    z-index: 20;
}

.scalar-indicator::before {
    content: '';
    position: absolute;
    top: 1.35em;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.25em solid transparent;
    border-right: 0.25em solid transparent;
    border-bottom: 0.5em solid #ffffff;
    filter: drop-shadow(0 0.125em 0.25em rgba(0,0,0,0.4));
}

.scalar-indicator-value {
    position: absolute;
    top: -1.5em;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    color: white;
    padding: 0.25em 0.5em;
    border-radius: 0.25em;
    font-size: 0.75em;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* Minimal wind dial */
.wind-legend {
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    width: 8.3em;
    height: 8.3em;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 16px;
    display: none;
    z-index: 1000;
    pointer-events: none;
    margin: 0 5px;
}

.wind-legend.active {
    display: block;
}

.wind-dial {
    position: relative;
    width: 100%;
    height: 100%;
}

.wind-dial-circle {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6em;
    height: 6em;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0.4em 1em 3px rgb(0 0 0 / 31%);
    border: 0.125em solid rgb(255 255 255 / 0%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);


    /* --- GLASSMORPHISM --- */

    /* 1. Subtle gradient background (simulates volume) */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.05)
    );

    /* 2. Real background blur */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); /* Para Safari */

    /* 3. Asymmetric borders to simulate light (Top and Left lighter) */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);

    /* 4. Soft, deep shadow */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.wind-cardinal {
    position: absolute;
    font-size: 0.6em;
    letter-spacing: 0.05em;
    color: #ffffffd0;
    font-weight: 600;
    text-transform: uppercase;
}

.wind-cardinal-n { top: 0.4em; left: 50%; transform: translate(-50%, 0); }
.wind-cardinal-s { bottom: 0.4em; left: 50%; transform: translate(-50%, 0); }
.wind-cardinal-e { right: 0.4em; top: 50%; transform: translate(0, -50%); }
.wind-cardinal-w { left: 0.4em; top: 50%; transform: translate(0, -50%); }

.wind-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff;
}

.wind-value-number {
    font-size: 1.5em;
}

.wind-value-unit {
    display: block;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.wind-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8.3em;
    height: 8.3em;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease-out;
}

.wind-ring path {
    transition: d 0.3s ease-out, stroke 0.3s ease-out, fill 0.3s ease-out, stroke-width 0.3s ease-out;
}

#wind-ring-arc {
    fill: none;
}

/* Media Queries: Responsive para móviles */
@media (max-width: 700px) {
    /* Hide circular wind dial on mobile */
    .wind-legend {
        display: none !important;
    }
    
    /* Legends stacked vertically on mobile */
    .scalar-legend{
        margin: 5px auto;
        width: 100%;
    }
    
    .scalar-tube {
        width: 100%;
    }
}

    /* Hide wind scalar thermometer on desktop (>700px) */
@media (min-width: 701px) {
    #wind-scalar-legend {
        display: none !important;
    }
}
