/**
 * OPINIONIPRO - Cookie Consent Styles
 * Stili per banner cookie e pannello preferenze
 */

/* =====================================================
   BANNER PRINCIPALE
   ===================================================== */

#cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 999999;
    animation: slideUp 0.4s ease;
    pointer-events: none;
}

#cookie-consent-banner .cookie-consent-modal {
    pointer-events: auto;
}

#cookie-consent-banner.fade-out {
    animation: slideDown 0.3s ease;
}

.cookie-consent-modal {
    background: white;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-consent-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-consent-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cookie-consent-body {
    padding: 24px;
}

.cookie-consent-body p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #374151;
}

.cookie-consent-small {
    font-size: 14px;
    color: #6b7280;
}

.cookie-consent-footer {
    padding: 16px 24px;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cookie-consent-links {
    padding: 12px 24px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

.cookie-consent-links a {
    color: #3b82f6;
    text-decoration: none;
}

.cookie-consent-links a:hover {
    text-decoration: underline;
}

/* =====================================================
   PANNELLO PREFERENZE
   ===================================================== */

#cookie-preferences-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    max-width: 700px;
    width: calc(100% - 40px);
    max-height: 90vh;
}

#cookie-preferences-panel.fade-out {
    animation: fadeOut 0.3s ease;
}

.cookie-preferences-modal {
    background: white;
    width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: zoomIn 0.3s ease;
}

.cookie-preferences-modal .cookie-consent-body {
    overflow-y: auto;
    flex: 1;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cookie-intro {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 14px;
}

/* =====================================================
   CATEGORIE COOKIE
   ===================================================== */

.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-category-header h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.cookie-category-header p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.cookie-category-details {
    padding: 16px;
    font-size: 14px;
    color: #4b5563;
}

.cookie-category-details p {
    margin: 0 0 8px 0;
}

.cookie-examples {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

/* =====================================================
   SWITCH TOGGLE
   ===================================================== */

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 28px;
}

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

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch.disabled .slider {
    cursor: not-allowed;
    background-color: #9ca3af;
}

/* =====================================================
   PULSANTI
   ===================================================== */

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* =====================================================
   ANIMAZIONI
   ===================================================== */

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

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

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

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

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 640px) {
    #cookie-consent-banner {
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .cookie-consent-modal {
        margin: 0;
        border-radius: 12px 12px 0 0;
    }
    
    .cookie-consent-footer {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    #cookie-preferences-panel {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-height: 100vh;
    }
    
    .cookie-preferences-modal {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .switch {
        align-self: flex-end;
    }
}

/* =====================================================
   LINK "GESTIONE COOKIE" IN FOOTER
   ===================================================== */

.open-cookie-preferences {
    cursor: pointer;
    color: #3b82f6;
    text-decoration: underline;
}

.open-cookie-preferences:hover {
    color: #2563eb;
}