/* Evita scroll orizzontale */
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #e1e8ed 100%);
    font-family: 'Montserrat', Arial, sans-serif;
    color: #222;
    min-height: 100vh;
    padding-top: 56px; /* space for fixed navbar */
}

/* Hero section fix per eliminare i banner bianchi su mobile */
header {
    background: url('img/etna-hero.jpg') center/cover no-repeat;
    color: #fff;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    position: relative;
    margin: 0;
    padding: 0;
}

/* Fix per eliminare spazi bianchi sui mobile */
@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }

    header {
        min-height: 50vh;
        margin-top: 0;
        padding-top: 0;
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

.logo {
    width: 90px;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 6px #0006);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    color: #d35400;
    text-align: center;
}

.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #d35400, #f9ca24);
    margin: 0 auto 2rem auto;
    border-radius: 2px;
}

.live-stream {
    border-radius: 18px;
    box-shadow: 0 4px 24px #0002;
    overflow: hidden;
    margin-bottom: 2rem;
}

.curiosity-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px #0001;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.curiosity-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 24px #d3540033;
}

.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px #0001;
    cursor: pointer;
}

.gallery-img:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 24px #d3540033;
}

.footer {
    background: #222;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

/* Hero background using your existing hero image name if present */
.hero-bg {
    background: url('img/etna-hero.jpg') center/cover no-repeat fixed;
}

header .lead {
    text-align: center;
    padding: 0 15px;
}

/* Overlay per immagini */
#img-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#img-overlay img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 30px #0008;
    border-radius: 10px;
    object-fit: contain;
}

#close-overlay {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-overlay:hover {
    background: rgba(255,255,255,0.2);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.8rem;
    }

    header {
        min-height: 50vh;
    }

    .gallery-img {
        height: 150px;
    }

    #img-overlay img {
        max-width: 95%;
        max-height: 80%;
    }

    #close-overlay {
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }

    .curiosity-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .divider {
        width: 60px;
        height: 3px;
    }

    .hero-bg .display-3 {
        font-size: 2rem !important;
    }

    .hero-bg .lead {
        font-size: 1rem;
    }

    /* Spazi aggiuntivi tra sezioni su mobile per curiosità */
    .curiosity-mobile-space {
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }

    body {
        padding-top: 60px;
    }

    .gallery-img {
        height: 120px;
    }

    .curiosity-card {
        padding: 0.75rem;
    }

    .hero-bg .display-3 {
        font-size: 1.75rem !important;
    }

    .hero-bg .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Chart container */
.chart-container {
    position: relative;
    width: 100%;
}

/* Cookie banner migliorato */
#cookie-banner {
    position: fixed !important;
    bottom: 0 !important;
    width: 100% !important;
    background: #222 !important;
    color: #fff !important;
    padding: 1rem !important;
    z-index: 9999 !important;
    text-align: center !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

#cookie-banner button {
    margin: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

#cookie-banner button:hover {
    opacity: 0.9;
}

/* Lightbox override per sicurezza */
.lightboxOverlay {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(4px);
}

.lightbox {
    z-index: 1050 !important;
}

/* Card migliorata */
.card {
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Miglioramenti navigazione mobile */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(33, 37, 41, 0.95);
        margin-top: 0.5rem;
        border-radius: 0.375rem;
        padding: 0.5rem;
    }
}

/* Stili per i video responsive */
.ratio iframe {
    border-radius: 10px;
}

/* Miglioramenti accessibilità */
a:focus, button:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* Miglioramenti per touch device */
@media (hover: none) {
    .gallery-img:hover,
    .curiosity-card:hover,
    .card:hover {
        transform: none;
    }

    .gallery-img:active {
        transform: scale(0.98);
    }
}

/* Fix per Firefox */
@-moz-document url-prefix() {
    #img-overlay {
        backdrop-filter: none;
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Rating con vulcani e euro */
.text-orange {
    color: #ff6b35 !important;
}

/* Animazioni per la galleria */
.fade-in {
    animation: fadeInGallery 0.5s ease-in-out;
}

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

/* Pulse animation per il live indicator */
.pulse-dot {
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Miglioramenti per la pagina "Il Meglio dell'Etna" */
.rating-nature .fas.fa-volcano {
    color: #dc3545;
}

.rating-nature .far.fa-volcano {
    color: #dee2e6;
}

.rating-price .fas.fa-euro-sign {
    color: #28a745;
}

.rating-price .far.fa-euro-sign {
    color: #dee2e6;
}

/* Spazi migliorati per le sezioni su mobile */
@media (max-width: 768px) {
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .curiosity-card {
        margin-bottom: 2rem;
    }
}

/* Fix per oggetti che si adattano meglio */
.object-fit-cover {
    object-fit: cover;
}

/* Migliore gestione delle immagini responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Stili per i badge nelle cards */
.badge {
    font-size: 0.75em;
}

/* Hover effects migliorati */
.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* Social links nel footer */
.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Miglioramenti per la mappa */
.map-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Animazioni per i contatori */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.display-6, .display-4 {
    animation: countUp 0.8s ease-out;
}