/* Cookie Banner Styles */
.cookie-banner {
    display: none; /* Nascosto di default, verrà mostrato tramite JavaScript */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000; /* Sfondo nero come richiesto */
    color: white;
    z-index: 9999; /* Sopra ogni altro elemento */
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.cookie-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cookie-banner-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color, #00008e);
}

.cookie-banner-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.cookie-banner-close:hover {
    opacity: 0.7;
}

.cookie-banner-text p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-banner-text p strong {
    color: var(--primary-color, #00008e);
    font-weight: 600;
}

.cookie-banner-text p:last-child {
    margin-bottom: 20px;
}

/* Stili per gli switch di consenso */
.cookie-consent-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.cookie-switch-group {
    margin-bottom: 10px;
}

.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    cursor: pointer;
    margin: 0;
}

.switch-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.switch-container {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; /* Colore inattivo */
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch-checkbox:checked + .switch-slider {
    background-color: var(--primary-color, #00008e); /* Colore attivo - blu del brand */
}

.switch-checkbox:checked + .switch-slider:before {
    transform: translateX(26px);
}

/* Stile per switch disabilitato ma attivo (necessari) */
.switch-checkbox:disabled + .switch-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-banner-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Stili per il pulsante Accetta (btn-primary) */
.cookie-banner .btn-primary {
    background-color: var(--primary-color, #00008e);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cookie-banner .btn-primary:hover, 
.cookie-banner .btn-primary:focus {
    background-color: var(--primary-color, #00008e);
    box-shadow: 0 0 15px rgba(0, 0, 142, 0.5);
    transform: scale(1.05);
}

/* Stili per il pulsante Impostazioni (btn-outline-primary) */
.cookie-banner .btn-outline-primary {
    background-color: transparent;
    color: #fff; /* Colore del testo visibile */
    border: 2px solid var(--primary-color, #00008e);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cookie-banner .btn-outline-primary:hover,
.cookie-banner .btn-outline-primary:focus {
    background-color: rgba(0, 0, 142, 0.15);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 142, 0.3);
    transform: scale(1.05);
}

/* Classe hover-scale */
.cookie-banner .hover-scale {
    transition: transform 0.3s ease;
}

.cookie-banner .hover-scale:hover {
    transform: scale(1.05);
}

/* Stili responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 15px;
    }
    
    .cookie-banner-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .cookie-banner .btn-primary,
    .cookie-banner .btn-outline-primary {
        width: 100%;
    }
    
    /* Rendere gli switch responsive */
    .cookie-consent-switches {
        flex-direction: column;
        gap: 10px;
    }
    
    .cookie-switch-group {
        width: 100%;
    }
    
    .switch-label {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Migliorare la dimensione dei pulsanti per il tocco */
    .cookie-banner .btn-primary,
    .cookie-banner .btn-outline-primary {
        padding: 12px 20px; /* Più alto per facilitare il tocco */
        margin-bottom: 5px; /* Spazio aggiuntivo tra i pulsanti */
    }
}

/* Stili per la versione mobile del chatbot - evita sovrapposizioni */
@media (max-width: 576px) {
    .cookie-banner {
        padding-bottom: 60px; /* Spazio per evitare sovrapposizione con il chatbot */
    }
    
    .cookie-banner-content {
        padding-bottom: 20px;
    }
    
    /* Migliorare la leggibilità su schermi molto piccoli */
    .cookie-banner-text p {
        font-size: 0.85rem;
    }
    
    .switch-text {
        font-size: 0.85rem;
    }
    
    /* Ottimizzare gli switch per il tocco */
    .switch-container {
        width: 60px; /* Leggermente più largo */
        height: 28px; /* Leggermente più alto */
    }
    
    .switch-slider:before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }
    
    .switch-checkbox:checked + .switch-slider:before {
        transform: translateX(32px);
    }
}

/* Media query per schermi molto piccoli */
@media (max-width: 360px) {
    .cookie-banner-text p {
        font-size: 0.8rem;
    }
    
    .switch-text {
        font-size: 0.8rem;
    }
    
    .cookie-banner-content {
        padding: 10px;
    }
    
    .cookie-banner-header h5 {
        font-size: 1rem;
    }
    
    .cookie-banner-close {
        font-size: 1rem;
    }
    
    /* Aumentare ulteriormente la dimensione degli switch per schermi molto piccoli */
    .switch-container {
        width: 64px;
        height: 30px;
    }
    
    .switch-slider:before {
        height: 22px;
        width: 22px;
    }
    
    .switch-checkbox:checked + .switch-slider:before {
        transform: translateX(34px);
    }
}
