/* assets/css/cookie-manager.css */
/* Stili per il sistema di gestione cookie */

/* === BANNER COOKIE === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 3px solid #ff7f2a;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-banner-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.95;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-banner-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-banner-actions .btn-primary {
    background: #ff7f2a;
    color: white;
}

.cookie-banner-actions .btn-primary:hover {
    background: #e6691e;
    transform: translateY(-1px);
}

.cookie-banner-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-banner-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cookie-banner-actions .btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.cookie-banner-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* === RESPONSIVE BANNER === */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-banner-actions .btn {
        padding: 0.875rem 1rem;
    }
}

/* === MODAL COOKIE SETTINGS === */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal.hidden {
    display: none;
}

.cookie-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cookie-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.cookie-modal-header h2 {
    margin: 0;
    color: #1e3a8a;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

.cookie-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-body p {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* === CATEGORIE COOKIE === */
.cookie-categories {
    margin-bottom: 2rem;
}

.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.cookie-category-header {
    padding: 1.5rem;
    background: #f9fafb;
}

.cookie-category-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category-title h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-category-description {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* === TOGGLE SWITCH === */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.cookie-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .toggle-slider {
    background-color: #ff7f2a;
}

.cookie-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle.disabled input + .toggle-slider {
    background-color: #22c55e;
}

.cookie-toggle.disabled input + .toggle-slider:before {
    transform: translateX(24px);
}

/* === INFO SECTION === */
.cookie-info {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #ff7f2a;
}

.cookie-info h4 {
    margin: 0 0 1rem 0;
    color: #1e3a8a;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-info p {
    margin-bottom: 1rem;
    color: #4b5563;
}

.cookie-info ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #4b5563;
}

.cookie-info li {
    margin-bottom: 0.5rem;
}

/* === MODAL FOOTER === */
.cookie-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.cookie-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-modal-footer .btn-primary {
    background: #ff7f2a;
    color: white;
}

.cookie-modal-footer .btn-primary:hover {
    background: #e6691e;
}

.cookie-modal-footer .btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.cookie-modal-footer .btn-secondary:hover {
    background: #d1d5db;
}

/* === RESPONSIVE MODAL === */
@media (max-width: 768px) {
    .cookie-modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .cookie-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .cookie-modal-body {
        padding: 1.5rem;
    }
    
    .cookie-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }
    
    .cookie-category-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cookie-toggle {
        align-self: flex-end;
    }
}

/* === LINK PRIVACY/COOKIE POLICY === */
.cookie-policy-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e3a8a;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
}

.cookie-policy-link:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

/* === ANIMAZIONI === */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookie-banner.show {
    animation: slideInUp 0.3s ease-out;
}

.cookie-modal:not(.hidden) {
    animation: fadeIn 0.2s ease-out;
}

/* === PULSANTE COOKIE INTELLIGENTE === */

/* Area invisibile per trigger hover nell'angolo */
.cookie-smart-area {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    z-index: 9997;
    pointer-events: auto;
}

/* Pulsante cookie che appare al bisogno */
.cookie-smart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e3a8a;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    
    /* Stato iniziale: piccolo e nascosto */
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Animazioni */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100px);
    opacity: 0;
    pointer-events: none;
}

.cookie-smart-button .cookie-text {
    opacity: 0;
    margin-left: 8px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

/* Stati del pulsante */
.cookie-smart-button.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.cookie-smart-button.expanded {
    width: auto;
    padding: 0.7rem 1rem;
    border-radius: 25px;
}

.cookie-smart-button.expanded .cookie-text {
    opacity: 1;
}

/* Hover effects */
.cookie-smart-button:hover {
    background: #1e40af;
    transform: translateX(0) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Animazione di pulsazione per attirare attenzione */
@keyframes pulse-cookie {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(0) scale(1.05); }
}

.cookie-smart-button.pulse {
    animation: pulse-cookie 2s ease-in-out 3;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-smart-area {
        width: 60px;
        height: 60px;
    }
    
    .cookie-smart-button {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}