/* ============================================
   COOKIE CONSENT - APPLE STYLE
   Matching PeppeLab Portfolio Design
   ============================================ */

/* Overlay */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.cookie-consent-overlay.show {
    opacity: 1;
}

/* Modal */
.cookie-consent-modal {
    position: relative;
    max-width: 500px;
    width: 90%;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.cookie-consent-overlay.show .cookie-consent-modal {
    transform: scale(1) translateY(0);
}

/* Close Button */
.cookie-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f7;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e73;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 10;
}

.cookie-close-btn:hover {
    background: #e8e8ed;
    color: #1d1d1f;
    transform: scale(1.05);
}

.cookie-close-btn svg {
    width: 18px;
    height: 18px;
}

/* Cookie Icon */
.cookie-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    border-radius: 50%;
    color: #6e6e73;
}

.cookie-icon svg {
    width: 32px;
    height: 32px;
}

/* Typography */
.cookie-consent-modal h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    color: #1d1d1f;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.cookie-consent-modal p {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    color: #6e6e73;
    font-size: 15px;
    line-height: 1.47;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.022em;
}

/* Cookie Status Badge */
.cookie-status {
    text-align: center;
    padding: 10px 16px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.022em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.cookie-status.accepted {
    background: #e8e8ed;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.cookie-status.rejected {
    background: #f5f5f7;
    color: #6e6e73;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.cookie-status.pending {
    background: #f5f5f7;
    color: #6e6e73;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Details Section */
.cookie-details {
    margin-bottom: 24px;
}

.cookie-details details {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.cookie-details details:hover {
    background: #ebebf0;
}

.cookie-details summary {
    color: #1d1d1f;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    letter-spacing: -0.022em;
}

.cookie-details details[open] summary {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cookie-info {
    padding-top: 4px;
}

.cookie-info p {
    font-size: 13px;
    margin: 8px 0;
    text-align: left;
    color: #6e6e73;
}

.cookie-info ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.cookie-info li {
    color: #6e6e73;
    font-size: 13px;
    padding: 6px 0 6px 24px;
    position: relative;
    line-height: 1.47;
}

.cookie-info li:before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #1d1d1f;
    font-size: 16px;
}

.cookie-info a {
    color: #1d1d1f;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    font-weight: 500;
}

.cookie-info a:hover {
    color: #6e6e73;
    text-decoration: underline;
}

/* Action Buttons */
.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.cookie-btn {
    border: none;
    border-radius: 980px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    outline: none;
    letter-spacing: -0.022em;
}

/* Reject button - minimized and less visible */
.cookie-reject {
    background: transparent;
    color: #b0b0b3;
    border: none;
    padding: 8px 16px;
    min-height: 32px;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.6;
    order: 2;
    width: auto;
    align-self: center;
}

.cookie-reject:hover {
    background: transparent;
    color: #9c9c9f;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Accept button - prominent and highly visible */
.cookie-accept {
    background: linear-gradient(135deg, #1d1d1f 0%, #000000 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    padding: 16px 48px;
    min-height: 52px;
    font-size: 17px;
    font-weight: 600;
    order: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: subtle-pulse 3s ease-in-out infinite;
}

.cookie-accept::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.cookie-accept:hover {
    background: linear-gradient(135deg, #000000 0%, #1d1d1f 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    animation: none;
}

.cookie-accept:hover::before {
    transform: translate(-50%, -50%) scale(2);
}

/* Subtle pulsing animation for Accept button */
@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }
    50% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    }
}

.cookie-btn:active {
    transform: translateY(0);
}

/* Notification Toast */
.cookie-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: #ffffff;
    border-radius: 12px;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    letter-spacing: -0.022em;
}

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

.cookie-notification.success {
    border-left: 4px solid #1d1d1f;
}

.cookie-notification.info {
    border-left: 4px solid #6e6e73;
}

/* Footer Button Style */
.footer-link-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
}

.footer-link-btn:hover {
    color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-consent-modal {
        max-width: 360px; /* Ridotto da 500px */
        width: 85%; /* Ridotto da 90% per più spazio ai bordi */
        padding: 28px 20px; /* Ridotto padding */
        margin: 0 20px; /* Più margin ai lati */
        border-radius: 16px; /* Leggermente più piccolo */
    }

    /* Cookie Icon - più piccolo */
    .cookie-icon {
        width: 48px; /* Ridotto da 56px */
        height: 48px;
        margin-bottom: 20px; /* Ridotto da 24px */
    }

    .cookie-icon svg {
        width: 28px; /* Ridotto da 32px */
        height: 28px;
    }

    /* Close Button - area touch più grande */
    .cookie-close-btn {
        top: 12px;
        right: 12px;
        width: 44px; /* Aumentato da 36px per touch */
        height: 44px;
        min-width: 44px; /* iOS touch target */
        min-height: 44px;
    }

    .cookie-close-btn svg {
        width: 20px; /* Leggermente più grande per visibilità */
        height: 20px;
    }

    /* Typography - ridotta */
    .cookie-consent-modal h3 {
        font-size: 22px; /* Ridotto da 28px */
        margin-bottom: 10px;
    }

    .cookie-consent-modal p {
        font-size: 14px; /* Ridotto da 15px */
        margin-bottom: 20px;
        line-height: 1.45;
    }

    /* Cookie Status Badge */
    .cookie-status {
        padding: 8px 14px; /* Ridotto */
        margin: 14px 0;
        font-size: 13px;
    }

    /* Details Section */
    .cookie-details {
        margin-bottom: 20px;
    }

    .cookie-details details {
        padding: 14px; /* Ridotto da 16px */
    }

    .cookie-details summary {
        font-size: 13px; /* Ridotto da 14px */
    }

    .cookie-info p {
        font-size: 12px; /* Ridotto da 13px */
    }

    .cookie-info li {
        font-size: 12px;
        padding: 5px 0 5px 20px;
    }

    /* Action Buttons - già in verticale, manteniamo priorità Accept */
    .cookie-actions {
        flex-direction: column;
        gap: 8px;
    }

    /* Accept button - ancora più prominente su mobile */
    .cookie-accept {
        width: 100%;
        padding: 16px 40px;
        min-height: 54px; /* iOS touch target ottimizzato */
        font-size: 18px; /* Ancora più grande per leggibilità */
        font-weight: 600;
    }

    /* Reject button - ancora più piccolo su mobile */
    .cookie-reject {
        width: auto;
        padding: 8px 16px;
        min-height: 36px;
        font-size: 11px;
        opacity: 0.5;
    }

    /* Notification Toast */
    .cookie-notification {
        left: 20px; /* Più margin */
        right: 20px;
        bottom: 20px;
        padding: 14px 20px;
        font-size: 13px;
    }
}

/* Extra small mobile - ulteriormente ridotto */
@media (max-width: 380px) {
    .cookie-consent-modal {
        width: 88%; /* Ancora più contenuto */
        padding: 24px 18px;
        max-width: 320px;
    }

    .cookie-consent-modal h3 {
        font-size: 20px;
    }

    .cookie-consent-modal p {
        font-size: 13px;
    }

    .cookie-accept {
        font-size: 17px;
        padding: 15px 36px;
        min-height: 52px;
    }

    .cookie-reject {
        font-size: 10px;
        padding: 6px 14px;
        opacity: 0.5;
    }
}

/* Accessibility */
.cookie-btn:focus-visible,
.cookie-close-btn:focus-visible {
    outline: 4px solid rgba(29, 29, 31, 0.3);
    outline-offset: 2px;
}

.cookie-details summary:focus-visible {
    outline: 4px solid rgba(29, 29, 31, 0.3);
    outline-offset: 2px;
    border-radius: 8px;
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-overlay,
    .cookie-consent-modal,
    .cookie-notification,
    .cookie-btn,
    .cookie-close-btn,
    .cookie-accept {
        transition: none;
        animation: none;
    }
}