/* ==========================================
   COOKIE CONSENT BANNER STYLES - KINDORYA
   ========================================== */

/* Overlay per i modals (solo quando aperti) */
#cookie-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    z-index: 99998;
    animation: fadeIn 0.3s ease;
}

#cookie-overlay.active {
    display: block;
}

/* Banner principale */
#cookie-consent-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    padding: 25px;
    animation: slideUp 0.4s ease;
}

#cookie-consent-banner.active {
    display: block;
}

.cookie-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.cookie-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h3 {
    color: #1e3c72;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

.cookie-text p {
    color: #555;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 0;
}

.cookie-text a {
    color: #ff8c42;
    text-decoration: underline;
    cursor: pointer;
}

.cookie-text a:hover {
    color: #1e3c72;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    background: #e0e0e0;
    color: #333;
}

.cookie-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   SETTINGS MODAL
   ========================================== */

#cookie-settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

#cookie-settings-modal.active {
    display: block;
}

.modal-header {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.modal-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 14px;
    opacity: 0.9;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.cookie-category {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.cookie-category:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-header h3 {
    color: #1e3c72;
    font-size: 18px;
    font-weight: 600;
}

.category-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.category-examples {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    margin-top: 10px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 55px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(27px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #4CAF50;
    opacity: 0.7;
    cursor: not-allowed;
}

.toggle-switch.required .toggle-slider {
    background-color: #4CAF50;
    cursor: not-allowed;
}

.required-label {
    background: #4CAF50;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==========================================
   PRIVACY POLICY MODAL
   ========================================== */

#privacy-policy-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100001;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

#privacy-policy-modal.active {
    display: block;
}

.privacy-content {
    padding: 30px;
}

.privacy-content h2 {
    color: #1e3c72;
    font-size: 28px;
    margin-bottom: 20px;
}

.privacy-content h3 {
    color: #1e3c72;
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 15px;
}

.privacy-content p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.privacy-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.privacy-content li {
    color: #555;
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Cookie Settings Link (fisso in basso a destra) */
#cookie-settings-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1e3c72;
    font-weight: 600;
    transition: all 0.3s;
}

#cookie-settings-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: #ff8c42;
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(100%);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-icon {
        font-size: 36px;
    }

    .cookie-buttons {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        min-width: 100px;
    }

    #cookie-settings-modal,
    #privacy-policy-modal {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 20px;
        padding-right: 40px;
    }

    .modal-body,
    .privacy-content {
        padding: 20px;
    }

    #cookie-settings-link {
        bottom: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 12px;
    }
}