/**
 * Leone Legnami - Stili per il consenso ai cookie GDPR
 */

/* Stili generali per i popup dei cookie */
.cookie-dialog {
    position: fixed;
    width: 100%;
    max-width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    font-size: 14px;
}

.cookie-dialog.active {
    display: block;
}

/* Banner dei cookie (in basso) */
#cookie-banner {
    bottom: 0;
    left: 0;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-banner-text {
    flex: 1;
    min-width: 280px;
}

.cookie-banner-text h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: white;
}

.cookie-banner-text p {
    margin: 0 0 10px 0;
    line-height: 1.4;
}

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

/* Popup delle impostazioni dei cookie (centrato) */
#cookie-settings {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-settings-header {
    margin-bottom: 20px;
}

.cookie-settings-header h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    color: white;
}

.cookie-settings-content {
    margin-bottom: 20px;
}

.cookie-category {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-category:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

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

.cookie-category-title {
    font-weight: bold;
    font-size: 16px;
    margin: 0;
    color: white;
}

.cookie-category-description {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* Interruttori per le impostazioni dei cookie */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

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

input:checked + .cookie-slider {
    background-color: var(--secondary-color);
}

input:disabled + .cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Pulsanti */
.cookie-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cookie-button:hover {
    background-color: #9d794a;
}

.cookie-button.outline {
    background-color: transparent;
    border: 1px solid white;
}

.cookie-button.outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Notifica di conferma */
#cookie-confirmation {
    bottom: 20px;
    right: 20px;
    max-width: 300px;
    padding: 15px;
    border-radius: 8px;
    background-color: #4CAF50;
    transition: opacity 0.3s;
}

#cookie-confirmation.active {
    display: block;
    animation: fadeIn 0.5s, fadeOut 0.5s 2.5s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes fadeOut {
    from {opacity: 1;}
    to {opacity: 0;}
}

/* Link per aprire le impostazioni dei cookie */
.reopen-cookie-settings {
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

/* Overlay per bloccare le interazioni con la pagina */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

#cookie-settings.active + .cookie-overlay {
    display: block;
}

/* Stili responsivi */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    #cookie-settings {
        width: 95%;
        max-height: 80vh;
    }
}
