/* ==========================================================================
 * Copyright (c) 2026 2DR Engineering S.r.l. - L'Aquila, Italia.
 * Tutti i diritti riservati.
 *
 * Sistema EcoFlame
 * Questo file è parte integrante del sistema EcoFlame. È vietata la
 * riproduzione o l'uso non autorizzato.
 * ========================================================================== */

:root {
    --eco-primary: rgb(5, 140, 133);
    --eco-secondary: rgb(104, 190, 87);
    --eco-accent: rgb(18, 150, 129);
    --eco-gradient: linear-gradient(45deg, var(--eco-primary), var(--eco-secondary));
    --eco-gradient-rev: linear-gradient(45deg, var(--eco-secondary), var(--eco-primary));
}

html, body {
    overflow-x: hidden;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    color: rgb(245, 245, 245);
    margin: 0;
    padding: 0;
}

h2 {
    font-weight: 1000;
    transition: all 1.25s ease;
}

p {
    transition: all 1.50s ease;
}

.section-subtitle {
    font-size: 25px;
}

.feature-title {
    font-size: 25px;
    font-weight: bold;
}

.feature-text {
    font-size: 20px;
}

.wind-direction-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid white;
    margin-right: 8px;
    vertical-align: middle;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

#model h2,
#model p,
#model .icon-box,
#model h5 {
    background: var(--eco-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

#about h2, #model h2 {
    font-size: 60px;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 700;
    animation: fadeInUp 2s;
}

.hero p {
    font-size: 2.3rem;
    opacity: 0.9;
    animation: fadeInUp 2.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar {
    padding: 12px 0;
    transition: opacity 0.5s ease;
    background: transparent;
    opacity: 1;
}

.navbar.scrolled {
    opacity: 0;
    pointer-events: none;
}

.nav-link {
    color: white !important;
    font-weight: 500;
    font-size: 20px;
    margin: 0 10px;
}

.hero {
    position: relative;
    width: 100%;
    height: calc(100dvh + env(safe-area-inset-top) + env(safe-area-inset-bottom));
    margin-top: calc(-1 * env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: unset;
    min-height: unset;
    object-fit: cover;
    transform: none;
    -webkit-transform: none;
    z-index: -1;
    filter: brightness(0.45);
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero video.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: white;
    padding: 0 1rem;
}

.navbar-nav {
    margin-left: auto;
    margin-right: auto;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin: 0.5rem 0;
}

.hero p {
    font-size: clamp(1.2rem, 4vw, 2.3rem);
    margin-bottom: 1rem;
}

.hero img {
    height: auto;
    max-height: clamp(180px, 35vh, 500px);
    max-width: 90%;
    margin-bottom: -20px;
    object-fit: contain;
}

.btn-accent {
    color: white;
    border-radius: 30px;
    padding: 0.7rem 2rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    filter: brightness(1.15);
    transform: translateY(-3px);
}

section {
    padding: clamp(3rem, 8vw, 6rem) 1.5rem;
    position: relative;
    z-index: 2;
    width: 100%;
    overflow-x: hidden;
}

section:nth-child(even) {
    background: #f9f9f9;
    color: #333;
}

.icon-box {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: white;
    transition: all 1.75s ease;
}

footer {
    background: var(--eco-accent);
    color: #eee;
    padding: 2rem 0;
    text-align: center;
}

.gradient-icon {
    background: var(--eco-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-size: 4rem;
}

a.btn.btn-accent.mt-3 {
    background: var(--eco-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

a.btn.btn-accent.mt-3::after {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background: var(--eco-gradient);
    opacity: 1;
    transform: scale(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    margin-top: 4px;
}

a.btn.btn-accent.mt-3:hover::after,
a.btn.btn-accent.mt-3:focus::after {
    transform: scale(1);
}

.wave-divider {
    position: absolute;
    left: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}

.wave-divider svg {
    width: 400%;
    height: 80px;
    will-change: transform;
    transform: translateX(0);
}

.wave-divider .shape-fill {
    fill: currentColor;
}

.wave-top {
    top: -1px;
}

.wave-bottom {
    bottom: 0;
}

.wave-top svg {
    transform: scaleY(1) translateX(0%);
}

.wave-bottom svg {
    transform: scaleY(-1) translateX(0%);
}

#about .wave-bottom {
    color: #f9f9f9;
}

#model .wave-bottom {
    color: var(--eco-secondary);
}

#demo .wave-top {
    color: #f9f9f9;
}

#demo .wave-bottom {
    color: #ffffff;
}

.risk-map-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 248, 248, 0.98) 100%);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid rgba(200, 200, 200, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem 2.5rem;
    background: linear-gradient(90deg, #f5f5f5 0%, #fafafa 100%);
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.risk-indicator, .alarm-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.risk-indicator .label,
.alarm-indicator .label {
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
}

.risk-indicator .value {
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
}

.alarm-absent {
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.alarm-active {
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
    transition: all 0.3s ease;
}

.risk-high {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.risk-low {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.risk-very-low {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
}

.risk-medium {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.risk-critical {
    background: linear-gradient(135deg, #b71c1c, #7f0000);
    color: white;
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.5);
}

@keyframes pulse-danger {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(244, 67, 54, 0.6);
    }
}

.pulse {
    animation: pulse-danger 2s ease-in-out infinite;
}

.map-visualization {
    padding: 0;
    background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
    min-height: 800px;
    position: relative;
}

#leafletMap {
    width: 100%;
    height: 100% !important;
    min-height: 800px !important;
    flex-grow: 1;
    border-radius: 16px;
    z-index: 1;
}

.custom-marker-icon {
    background: none;
    border: none;
    cursor: pointer;
}

.marker-inner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.marker-low {
    background: #4caf50;
}

.marker-medium {
    background: #ff9800;
}

.marker-high {
    background: #f44336;
    animation: markerDangerPulse 1s ease-in-out infinite;
}

.marker-critical {
    background: #b71c1c;
    animation: markerDangerPulse 1s ease-in-out infinite;
}

.marker-very-low {
    background: #2e7d32;
}

.marker-very-high {
    background: #b71c1c;
    animation: markerDangerPulse 1s ease-in-out infinite;
}

.marker-meteo {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.5);
}

.marker-terreno {
    background: linear-gradient(135deg, #8D6E63, #6D4C41);
    box-shadow: 0 3px 10px rgba(141, 110, 99, 0.5);
}

.marker-inner i {
    font-size: 14px;
}

@keyframes markerDangerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 5px 20px rgba(244, 67, 54, 0.6);
    }
}

.project-title {
    text-align: center;
    flex: 1;
}

.project-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.project-location {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    letter-spacing: 0.03em;
}

@keyframes cellTextFlash {
    0% {
        color: inherit;
        font-weight: inherit;
    }
    20% {
        color: var(--eco-secondary);
        font-weight: 700;
    }
    80% {
        color: var(--eco-secondary);
        font-weight: 700;
    }
    100% {
        color: inherit;
        font-weight: inherit;
    }
}

.cell-changed {
    animation: cellTextFlash 1.5s ease-in-out;
}

#windInfoBadge {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1002;
    background: linear-gradient(135deg, #29b6f6ee, #0288d1ee);
    color: white;
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: none;
    min-width: 160px;
    font-family: 'Poppins', sans-serif;
}

#soilInfoBadge {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1002;
    background: linear-gradient(135deg, #8D6E63ee, #8D6E63ff);
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Poppins', sans-serif;
    display: none;
    min-width: 180px;
}


@keyframes popupFlash {
    0%, 100% {
        box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(104, 190, 87, 0.6);
        transform: scale(1.02);
    }
}

.popup-flashing {
    animation: popupFlash 0.8s ease-in-out;
}

.modal-content {
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.btn:disabled {
    cursor: not-allowed;
}

.glass-card {
    position: relative;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.35);
}

.instruction-card {
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid #4ade80;
}

.icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.data-mini-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 600;
}

.data-mini-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
}

.map-wrapper {
    overflow: hidden !important;
    min-height: 800px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.map-overlay-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.interactive-card {
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.interactive-card:hover {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.interactive-card:active {
    transform: translateY(0px);
}

.side-panel-overlay {
    position: absolute !important;
    top: 20px !important;
    bottom: auto !important;
    left: auto !important;
    right: -420px !important;
    transform: none !important;
    width: 380px !important;
    height: auto !important;
    max-height: calc(100% - 40px) !important;
    z-index: 9999 !important;
    border-radius: 20px !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;

    opacity: 0 !important;
    visibility: hidden !important;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s !important;
}

.side-panel-overlay.active {
    right: 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.side-panel-overlay #sidePanelContent {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
}

.side-panel-overlay .side-panel-body {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}


.side-panel-overlay::before {
    display: none !important;
}

.side-panel-overlay.theme-meteo {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.90), rgba(25, 118, 210, 0.90)) !important;
    border: 1px solid rgba(100, 181, 246, 0.4);
    box-shadow: -5px 0 35px rgba(33, 150, 243, 0.35);
}

.side-panel-overlay.theme-terreno {
    background: linear-gradient(135deg, rgba(62, 39, 35, 0.90), rgba(93, 64, 55, 0.90)) !important;
    border: 1px solid rgba(141, 110, 99, 0.4);
    box-shadow: -5px 0 35px rgba(141, 110, 99, 0.35);
}

.side-panel-overlay.theme-aria, .side-panel-overlay.theme-area {
    background: linear-gradient(135deg, rgba(3, 50, 48, 0.90), rgba(28, 65, 35, 0.90)) !important;
    border: 1px solid rgba(104, 190, 87, 0.4);
    box-shadow: -5px 0 35px rgba(5, 140, 133, 0.35);
}

@keyframes cardContinuousGlow {
    0% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 255, 255, 0.8);
        border-color: rgba(255, 255, 255, 1);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
    }
}

@keyframes radarGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9), 0 0 10px rgba(255, 255, 255, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0), 0 0 25px rgba(255, 255, 255, 0.3);
        transform: scale(1.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 10px rgba(255, 255, 255, 0);
        transform: scale(1);
    }
}

.active-card {
    animation: cardContinuousGlow 2s infinite !important;
    transform: translateY(-4px) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid white !important;
}

.active-marker {
    animation: radarGlow 2s infinite !important;
    border-color: #ffffff !important;
    z-index: 9999 !important;
}

.close-panel-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    z-index: 9999 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.expand-panel-btn {
    display: none !important;
}

.close-panel-btn:hover {
    background: rgba(244, 67, 54, 0.8);
    transform: scale(1.1);
}

.side-panel-overlay::-webkit-scrollbar {
    width: 6px;
}

.side-panel-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.popup-data-box {
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-data-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popup-data-value {
    font-weight: 700;
    color: #ffffff;
    font-size: 17px;
}

.card-info-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 15px;
    cursor: help;
    transition: color 0.2s;
    z-index: 2;
}

.card-info-hint:hover {
    color: rgba(255, 255, 255, 0.95);
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.live-badge-dot {
    animation: livePulse 1.5s ease-in-out infinite;
}

#sidePanelContent {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: white;
    font-family: 'Poppins', sans-serif;
}

.side-panel-header {
    position: relative;
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.side-panel-bg-icon {
    position: absolute;
    right: -10px;
    top: -10px;
    font-size: 100px;
    opacity: 0.05;
    transform: rotate(-15deg);
    pointer-events: none;
}

.side-panel-header-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1;
}

.side-panel-icon-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.side-panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.side-panel-subtitle {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.side-panel-alert {
    margin: 15px 20px 0 20px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.alert-critical {
    background: rgba(244, 67, 54, 0.15);
    color: #ffcdd2;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.15);
    color: #ffe0b2;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.side-panel-body {
    padding: 20px;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
}

.side-panel-section-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 600;
}

.side-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.side-panel-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.data-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: background 0.3s;
}

.data-box:hover {
    background: rgba(255, 255, 255, 0.12);
}

.highlight-box {
    align-items: center;
    border-color: rgba(255, 183, 77, 0.3);
}

.highlight-box .data-value {
    color: #ffb74d;
}

.data-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin-bottom: 4px;
}

.data-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.data-value small {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
}

.side-panel-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    border-radius: 0 0 16px 16px;
}

.side-panel-footer span {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes flashUpdate {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px 12px rgba(104, 190, 87, 0.8);
        transform: scale(1.2);
        border-color: #ffffff;
    }
    100% {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
}

.data-updated-flash {
    animation: flashUpdate 1.5s ease-out;
}

.custom-marker-icon {
    background: none;
    border: none;
    cursor: pointer;
    overflow: visible !important;
}

.spider-leg, .spider-center-dot, .spider-base-glow {
    display: none !important;
}

.spider-node {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, z-index 0.1s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.meteo-node {
    transform: translate(-8px, -4px);
    z-index: 6;
}

.terreno-node {
    transform: translate(8px, 4px);
    z-index: 5;
}

.custom-marker-icon:hover .meteo-node {
    transform: translate(-18px, -12px) scale(1.05);
}

.custom-marker-icon:hover .terreno-node {
    transform: translate(18px, 12px) scale(1.05);
}

.meteo-node:hover, .terreno-node:hover {
    z-index: 10 !important;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.premium-input {
    border: 2px solid var(--eco-secondary);
    border-radius: 6px;
    height: 50px;
    color: #334155;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: none;
}

.premium-input:focus {
    border-color: var(--eco-primary);
    box-shadow: 0 0 0 4px rgba(5, 140, 133, 0.15);
    outline: none;
}

input[type="date"].premium-input {
    appearance: none;
    -webkit-appearance: none;
    font-family: 'Poppins', sans-serif;
    color: #334155;
    background-color: white;
}

input[type="date"].premium-input::-webkit-date-and-time-value {
    text-align: left;
}

.premium-input::-webkit-calendar-picker-indicator {
    background-color: rgba(104, 190, 87, 0.15);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--eco-primary);
    transition: background 0.2s;
}

.premium-input::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(5, 140, 133, 0.25);
}

@media (max-width: 768px) {
    .navbar {
        display: none !important;
    }

    #about h2, #model h2 {
        font-size: 38px !important;
    }

    .section-subtitle {
        font-size: 18px !important;
    }

    .feature-title {
        font-size: 20px !important;
    }

    .feature-text {
        font-size: 16px !important;
    }

    .glass-card {
        padding: 15px !important;
    }

    .glass-card h5 {
        font-size: 16px !important;
        margin-bottom: 0 !important;
    }

    .icon-circle {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }

    .side-panel-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .map-visualization {
        min-height: 75vh;
    }

    .map-wrapper {
        display: block !important;
        height: 75vh !important;
        min-height: 550px !important;
        overflow: hidden !important;
        border-radius: 20px !important;
        padding: 6px !important;
        position: relative !important;
        margin-bottom: 20px !important;
    }

    #leafletMap {
        height: 100% !important;
        width: 100% !important;
        border-radius: 14px !important;
    }

    .side-panel-overlay {
        position: absolute !important;
        top: auto !important;
        bottom: -100% !important;
        left: 10px !important;
        right: auto !important;
        width: calc(100% - 20px) !important;
        height: auto !important;
        max-height: 62% !important;
        transform: none !important;
        border-radius: 24px !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
        z-index: 1000 !important;

        transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), max-height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;

        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .side-panel-overlay.active {
        bottom: 10px !important;
    }

    .side-panel-overlay.expanded {
        max-height: calc(100% - 20px) !important;
    }

    .side-panel-overlay::before {
        display: none !important;
    }

    .side-panel-overlay #sidePanelContent {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    .side-panel-overlay .side-panel-header {
        padding: 16px 16px 12px 16px !important;
        border-radius: 24px 24px 0 0 !important;
        flex-shrink: 0 !important;
    }

    .side-panel-overlay .side-panel-body {
        padding: 12px 16px 16px 16px !important;
        overflow-y: auto !important;
        flex-grow: 1 !important;
    }

    .side-panel-overlay .side-panel-footer {
        padding: 10px 16px !important;
        border-radius: 0 0 24px 24px !important;
        flex-shrink: 0 !important;
    }

    .side-panel-overlay .close-panel-btn {
        top: 12px !important;
        right: 12px !important;
        width: 32px !important;
        height: 32px !important;
        z-index: 100 !important;
    }

    .side-panel-overlay .expand-panel-btn {
        display: none !important;
        position: absolute;
        top: 12px !important;
        right: 52px !important;
        width: 32px !important;
        height: 32px !important;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        border-radius: 50%;
        z-index: 100 !important;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .side-panel-overlay.theme-area .expand-panel-btn,
    .side-panel-overlay.theme-meteo .expand-panel-btn,
    .side-panel-overlay.theme-terreno .expand-panel-btn {
        display: flex !important;
    }

    .side-panel-overlay .expand-panel-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .side-panel-title {
        font-size: 16px !important;
    }

    .data-value {
        font-size: 18px !important;
    }

    .side-panel-grid, .side-panel-grid-4 {
        gap: 8px !important;
    }

    .data-box {
        padding: 8px !important;
    }

    .instruction-card.d-block.d-lg-none {
        margin-top: 1.5rem !important;
    }

    .custom-marker-icon:hover .meteo-node {
        transform: translate(-8px, -4px) scale(1) !important;
    }

    .custom-marker-icon:hover .terreno-node {
        transform: translate(8px, 4px) scale(1) !important;
    }

    .card-info-hint {
        display: none !important;
    }

}

@media (max-width: 480px) {
    .risk-header {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        padding: 1rem;
    }
}
