/* ==========================================================================
   COOKIE BANNER - MODERN DESIGN
   ========================================================================== */

/* Animazione di entrata */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.cookie-banner-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 800px;
    
    /* Effetto Glassmorphism coerente col sito */
    background: var(--bg-translucent);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    
    z-index: 99999;
    font-family: inherit;
    color: var(--text-main);
    
    /* Nascondi di default, gestito via JS, ma quando attivo anima */
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cookie-banner-content {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Flexbox per schermi grandi: testo a sx, bottoni a dx */
@media (min-width: 768px) {
    .cookie-banner-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.cookie-text-wrapper {
    flex: 1;
}

.cookie-banner-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-banner-content h3::before {
    content: "🍪";
    font-size: 1.25rem;
}

.cookie-banner-content p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.cookie-banner-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border-bottom: 1px dashed var(--primary);
}

.cookie-banner-content a:hover {
    color: var(--primary-light);
    border-bottom-style: solid;
}

.cookie-banner-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-cookie {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.btn-cookie-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.btn-cookie-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3);
}

.btn-cookie-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-cookie-secondary:hover {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Modali per la privacy policy */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-window {
    background: var(--bg-surface);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-backdrop.active .modal-window {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Testo Modale GDPR */
.gdpr-document h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.gdpr-document h3:first-child {
    margin-top: 0;
}
.gdpr-document p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Responsività */
@media (max-width: 767px) {
    .cookie-banner-container {
        bottom: 16px;
        width: calc(100% - 32px);
    }
    
    @keyframes slideUpFade {
        from {
            opacity: 0;
            transform: translate(-50%, 10px);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0);
        }
    }

    .cookie-banner-content {
        padding: 20px;
    }

    .cookie-banner-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-cookie {
        width: 100%;
        text-align: center;
        padding: 14px;
    }
}
