/**
 * Cookie Banner CSS con Accessibilità Migliorata
 * File: /assets/css/cookie-banner.css
 */

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-top: 3px solid #6D2F66;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 10000;
    display: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

#cookie-banner.hidden {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-content > .cookie-text {
    flex: 1;
    min-width: 300px;
    margin-right: 20px;
}

.cookie-content > .cookie-buttons {
    margin-right: 0;
}

.cookie-text p {
    margin: 0;
    color: #000000;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-text strong {
    color: #6D2F66;
    font-weight: bold;
}

.cookie-text a {
    color: #6D2F66;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s ease;
}

.cookie-text a:hover,
.cookie-text a:focus {
    text-decoration: underline;
    color: #4A1F46;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
    margin-right: 10px;
    margin-bottom: 10px;
}

.cookie-btn:last-child {
    margin-right: 0;
}

/* PULSANTE ACCETTO - COLORI ACCESSIBILI */
.cookie-btn.accept {
    background: #6D2F66;    /* Viola come sfondo */
    color: #FFFFFF;         /* Testo bianco - Contrasto 6.5:1 ✓ */
    border: 2px solid #6D2F66;
}

.cookie-btn.accept:hover,
.cookie-btn.accept:focus {
    background: #89ABD9;    /* Blu chiaro */
    color: #000000;         /* Testo nero per contrasto */
    border-color: #89ABD9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(137, 171, 217, 0.3);
}

/* PULSANTE RIFIUTA */
.cookie-btn.reject {
    background: #000000;
    color: #FFFFFF;
    border: 2px solid #000000;
}

.cookie-btn.reject:hover,
.cookie-btn.reject:focus {
    background: #333333;
    border-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.cookie-btn:focus {
    outline: 3px solid #6D2F66;
    outline-offset: 2px;
}

.cookie-btn:active {
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #cookie-banner {
        padding: 15px;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-content > .cookie-text {
        margin-right: 0;
        margin-bottom: 15px;
        min-width: 250px;
    }

    .cookie-content > .cookie-buttons {
        margin-bottom: 0;
    }

    .cookie-text p {
        font-size: 13px;
    }

    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        margin-right: 0;
    }
}

/* SUPPORTO ALTO CONTRASTO */
@media (prefers-contrast: high) {
    .cookie-btn.accept {
        background: #000000;
        color: #FFFFFF;
        border: 3px solid #000000;
    }
    
    .cookie-btn.reject {
        background: #FFFFFF;
        color: #000000;
        border: 3px solid #000000;
    }
}

/* SUPPORTO DARK MODE */
@media (prefers-color-scheme: dark) {
    #cookie-banner {
        background: #1a1a1a;
        border-top-color: #89ABD9;
    }
    
    .cookie-text p {
        color: #FFFFFF;
    }
    
    .cookie-text strong {
        color: #89ABD9;
    }
    
    .cookie-text a {
        color: #89ABD9;
    }
    
    .cookie-text a:hover,
    .cookie-text a:focus {
        color: #B0C9E8;
    }
}