/* ======== IMPOSTAZIONI GLOBALI E VARIABILI ======== */
:root {
    --background-color: #101419;
    --primary-glow: #ffee00; /* Giallo elettrico */
    --secondary-glow: #00f2ff; /* Ciano per info */
    --text-color: #e6f1ff;
    --text-muted: #8892b0;
    --border-color: rgba(255, 238, 0, 0.2);
    --info-border-color: rgba(0, 242, 255, 0.2);
    
    --font-display: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-display);
    background-color: var(--background-color);
    color: var(--text-color);
}

/* ======== SFONDO CON IMMAGINE E ANIMAZIONE ======== */
.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Assicurati che l'immagine 'sfondo.jpg' sia nella stessa cartella */
    background-image: linear-gradient(rgba(16, 20, 25, 0.85), rgba(16, 20, 25, 0.95)), url('sfondo.jpg?v=1');
    
    background-size: 110%; 
    background-position: center;
    background-repeat: no-repeat;
    animation: slow-zoom 40s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animazione di zoom lento per lo sfondo */
@keyframes slow-zoom {
    0% {
        background-size: 110%;
    }
    100% {
        background-size: 100%;
    }
}


/* ======== HEADER ======== */
.main-header-link {
    text-decoration: none;
}
.main-header {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    background: rgba(16, 20, 25, 0.5);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    z-index: 10;
    transition: all 0.3s ease;
}
.main-header:hover {
    background: rgba(16, 20, 25, 0.8);
    border-color: var(--primary-glow);
}

.logo { height: 60px; }

.title-container h1 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--text-color);
}
.title-container span {
    font-family: var(--font-mono);
    color: var(--primary-glow);
    font-size: 1rem;
}

/* ======== PUNTI INTERATTIVI (RISCHI E INFO) ======== */
.risk-point, .info-point { position: absolute; }

.risk-button, .info-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.risk-button {
    border: 2px solid var(--primary-glow);
    background: rgba(255, 238, 0, 0.1);
    color: var(--primary-glow);
    animation: pulse-yellow 2s infinite;
}

.risk-button:hover {
    background: var(--primary-glow);
    color: var(--background-color);
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--primary-glow);
}

.info-button {
    border: 2px solid var(--secondary-glow);
    background: rgba(0, 242, 255, 0.1);
    color: var(--secondary-glow);
    animation: pulse-cyan 2.2s infinite;
}

.info-button:hover {
    background: var(--secondary-glow);
    color: var(--background-color);
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--secondary-glow);
}


@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(255, 238, 0, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 238, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 238, 0, 0); }
}

@keyframes pulse-cyan {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(0, 242, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0); }
}


/* ======== FINESTRA INFO RISCHI ======== */
.info-card {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translate(120%, -50%);
    width: 350px;
    background: rgba(16, 20, 25, 0.8);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100;
}

.info-card.show { transform: translate(0, -50%); }

.close-card {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}
.close-card:hover { color: var(--text-color); }

#card-content h2 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-glow);
}

#card-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-video {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: none;
    background-color: var(--primary-glow);
    color: var(--background-color);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-video:hover {
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.05);
}

/* ======== OVERLAY INFO GENERALI ======== */
.info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 20, 25, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.info-overlay.show {
    opacity: 1;
    visibility: visible;
}

.info-panel {
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 3rem;
    border: 1px solid var(--info-border-color);
    border-radius: 12px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s;
}

.info-overlay.show .info-panel {
    transform: scale(1);
}

.close-info {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
}
.close-info:hover { color: var(--text-color); }

.info-panel h2 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--secondary-glow);
    margin-bottom: 2rem;
    text-align: center;
}

.info-content h3 {
    font-family: var(--font-mono);
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--info-border-color);
}

.info-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ======== OVERLAY VIDEO ======== */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.video-overlay.show {
    opacity: 1;
    visibility: visible;
}

.video-wrapper {
    position: relative;
    width: 80%;
    max-width: 960px;
    aspect-ratio: 16/9;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
}

.close-video {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 3rem;
    cursor: pointer;
}
