/**
 * Stili per il componente CookieConsentBanner
 * Personalizzazione del banner Iubenda e componente Blazor
 */

/* ============================================
   Cookie Consent Banner - Componente Blazor
   ============================================ */

.cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    z-index: 999998;
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-banner.position-top {
    top: 20px;
    bottom: auto;
    transform: translateY(-150%);
}

.cookie-consent-banner.position-top.show {
    transform: translateY(0);
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cookie-consent-text {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.cookie-consent-icon {
    font-size: 1.5rem;
    color: #0073CE;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-consent-text h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.cookie-consent-text p {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0;
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-consent-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid #e9ecef;
}

.consent-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.consent-item:last-child {
    border-bottom: none;
}

.consent-item .form-check-label {
    cursor: pointer;
}

.consent-item small {
    font-size: 0.75rem;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .cookie-consent-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 14px 16px;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-consent-actions {
        justify-content: flex-end;
        margin-top: 12px;
    }
    
    .cookie-consent-text p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        border-radius: 0;
        left: 0;
        right: 0;
        bottom: 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .cookie-consent-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .cookie-consent-actions .btn {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ============================================
   Override Iubenda Banner (se necessario)
   ============================================ */

/* Nascondi il banner Iubenda di default se usi quello custom */
#iubenda-cs-banner {
    /* display: none !important; */ /* Scommenta per usare solo il banner Blazor */
}

/* Personalizzazione colori Iubenda */
.iubenda-cs-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.iubenda-cs-content {
    border-radius: 12px !important;
}

.iubenda-cs-rationale {
    color: #4D4D4D !important;
}

/* Bottoni Iubenda */
.iubenda-cs-opt-group button {
    border-radius: 6px !important;
    font-weight: 500 !important;
}

.iubenda-cs-accept-btn {
    background-color: #0073CE !important;
}

.iubenda-cs-reject-btn {
    background-color: #6c757d !important;
}

/* ============================================
   Animazioni
   ============================================ */

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-banner.animate-in {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.cookie-consent-banner.position-top.animate-in {
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   Dark mode support (opzionale)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .cookie-consent-banner {
        background: #1a1a1a;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .cookie-consent-text h5 {
        color: #ffffff;
    }
    
    .cookie-consent-text p {
        color: #b0b0b0;
    }
    
    .cookie-consent-details {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .consent-item {
        border-color: #3a3a3a;
    }
}

/* ============================================
   Focus accessibility
   ============================================ */

.cookie-consent-banner button:focus-visible,
.cookie-consent-banner .form-check-input:focus-visible {
    outline: 2px solid #0073CE;
    outline-offset: 2px;
}

/* ============================================
   Stato disabilitato per checkbox necessari
   ============================================ */

.form-check-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-check-input:disabled + .form-check-label {
    opacity: 0.8;
}
