
/* ===============================
   GRID CONTAINER
================================= */
.cards_container {
    display: grid;
    /* Su Desktop: riempimento automatico */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 4px; /* Ridotto per guadagnare spazio prezioso */
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* ===============================
   LINK WRAPPER
================================= */

.card-link {
    display: block;
    text-decoration: none;
    border-radius: 15px;
    color: inherit;
}

.card-link-button {
    padding: 0px;
    width: 100%;
    border-radius: 15px;
    border: none;
    color: inherit;
}

/* ===============================
   CARD BASE
================================= */

.card {
    position: relative;
    width: 100%;
    aspect-ratio: 15 / 25;
    border-radius: 15px;
    background-color: #d9d9d9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    cursor: pointer;
    
/* --- AGGIUNTE PER ALLINEAMENTO --- */
    display: flex;
    flex-direction: column;    /* Dispone gli elementi (titolo, meteo, stelle) in verticale */
    justify-content: space-between;   /* Centra verticalmente */
    align-items: center;       /* Centra orizzontalmente */
    text-align: center;        /* Centra il testo all'interno degli elementi */
    gap: 15px;                 /* Aggiunge spazio uniforme tra i vari blocchi */
}


.card div[id^="map_"] {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important; /* Molto basso */
    pointer-events: none;  /* Fondamentale: permette di cliccare la card e non la mappa */
}

/* ===============================
   TITOLO IN ALTO (leggero)
================================= */

.titolo_alto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 8px;
    z-index: 10;
    color: white;
}

/* Piccolo sfondo soft solo dietro il titolo */
.titolo_alto::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.55),
        rgba(0,0,0,0)
    );
    z-index: -1;
}

/* ===============================
   PANNELLO BASSO GLASS
================================= */

.poster_info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 5px 5px;
    z-index: 10;

    /* GLASS */
    background-color: rgba(155, 160, 180, 0.2);
    backdrop-filter: blur(8px) saturate(130%) contrast(110%);
    -webkit-backdrop-filter: blur(18px) saturate(130%) contrast(110%);

    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.25),
        inset -2px -4px 8px rgba(0, 30, 80, 0.25);

    border-top: 1px solid rgba(255, 255, 255, 0.4);
}

/* ===============================
   TESTI
================================= */

.card_content h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.1;
}

.card_content p {
    margin: 1px 0 0 0;
    font-size: 0.75rem;
    opacity: 0.85;
}

.stars {
    margin-top: 1px;
    font-size: 0.75rem;
    color: #ffd700;
    letter-spacing: 1px;
}

.distance {
    font-size: 0.7rem;
    opacity: 0.85;
    color: white;
}


/* ===============================
   Per ICONE WEATHER
================================= */
.weather_filter select{
    padding:4px;
    border-radius:6px;
    font-size:13px;
}

.card_weather{
position: absolute;
    bottom: 35px;
    left: 50%; /* Sposta il bordo sinistro al centro */
    transform: translateX(-50%); /* Lo sposta indietro della metà della sua larghezza */
    width: 80%;

    background-color: rgba(155, 160, 180, 0.25);
    backdrop-filter: blur(6px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.25),
        inset -1px -2px 6px rgba(0, 30, 80, 0.2);
    
    border-top: 1px solid rgba(255,255,255,0.4);
    border-left: 1px solid rgba(255,255,255,0.2);
    
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 13px;
    backdrop-filter: blur(2px);
    z-index: 11;

    /* Per centrare il contenuto interno (icona/temp e vento) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.weather_icon_temp{
    display: flex;
    flex-direction:row;
    text-align: center;
}

.weather_icon{
    font-size:22px;
    line-height:20px;
}

.weather_temp{
    font-weight:bold;
    font-size:14px;
}

.weather_wind{
    font-size:11px;
    color:#444;
}




/* ===============================
   WARNING BOX
================================= */
.location-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px;
    margin: 20px auto;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef2f3;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    animation: fadeIn 0.5s ease-out;
}

.location-card-icon {
    font-size: 40px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

/* Animazione dell'onda */
.wave-emoji {
    display: inline-block;
    animation: wave-float 3s ease-in-out infinite;
}

.location-card-content h3 {
    color: #005a8d;
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.location-card-content p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-geo {
    background: linear-gradient(135deg, #00b4db, #0083b0);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 180, 219, 0.3);
}

.btn-geo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 219, 0.4);
}

.btn-geo:active {
    transform: translateY(0);
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wave-float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(5deg); }
}





/* ===============================
   BOX CARD VUOTE GRIGIE in attesa del caricamento
================================= */
/* ===============================
   SKELETON CARD (Liquid Glass)
================================ */
.skeleton-card {
    width: 100%;
    height: 250px;
    /* Base vetro semitrasparente */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    /* Profondità */
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* L'effetto Shimmer (Riflesso di luce che scorre) */
.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    /* Un raggio di luce bianca pura */
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer-liquid 1.8s infinite ease-in-out;
}

@keyframes shimmer-liquid {
    100% { transform: translateX(100%); }
}

/* ===============================
   LOCATION WARNING (Info Bubble)
================================ */
.location-warning {
    grid-column: 1 / -1;
    text-align: center;
    padding: 15px 25px;
    margin: 20px auto;
    max-width: 90%;
    
    /* Stile Goccia/Bolla d'acqua */
    background: rgba(28, 167, 166, 0.2); /* Un tocco di acquamarina */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    
    /* Testo leggibile */
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    
    /* Animazione leggera di pulsazione per l'attesa */
    animation: breath 2s infinite ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.location-warning small {
    display: block;
    margin-top: 10px;
    
    /* 1. Colore Oro/Ambra più profondo */
    color: #DEFEFF; 
    
    /* 2. Grassetto per aiutare la lettura */
    font-weight: 700;
    font-size: 0.88rem;
    
    /* 3. Un po' di respiro tra le lettere */
    letter-spacing: 0.3px;
}

@keyframes breath {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}




/* ===============================
   MOBILE
================================= */

@media (max-width: 600px) {
.cards_container {
        /* Ignora il calcolo dei pixel e forza 3 frazioni uguali */
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 3px !important;
        padding: 3px !important;
    }

    .card {
        aspect-ratio: 13 / 23;
    }
}