/**
 * ============================================================================
 * FEDEMODEL COOKIE BANNER - GLASSMORPHISM DESIGN
 * ============================================================================
 * Design moderno con effetto vetro, animazioni fluide, micro-interazioni
 * Colori brand: #f3bb27 (giallo FedeModel)
 *
 * @version 2.0.0 - Glassmorphism Edition
 * @date 2025-10-19
 * ============================================================================
 */

/* =========================================================================
   BANNER BOTTOM - Glassmorphism Effect
   ========================================================================= */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    /* Glassmorphism */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* Border glow */
    border-top: 1px solid rgba(243, 187, 39, 0.3);
    box-shadow:
        0 -8px 32px rgba(0, 0, 0, 0.1),
        0 -4px 16px rgba(243, 187, 39, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);

    z-index: 9999;
    padding: 24px 20px;

    /* Animation entrance */
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
    animation: bannerGlow 3s ease-in-out infinite;
}

/* Subtle glow animation */
@keyframes bannerGlow {
    0%, 100% {
        box-shadow:
            0 -8px 32px rgba(0, 0, 0, 0.1),
            0 -4px 16px rgba(243, 187, 39, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow:
            0 -8px 32px rgba(0, 0, 0, 0.1),
            0 -4px 16px rgba(243, 187, 39, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
}

.cookie-consent-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.cookie-consent-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex: 1;
    min-width: 300px;
}

/* =========================================================================
   ANIMATED COOKIE ICON
   ========================================================================= */

.cookie-consent-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f3bb27 0%, #d9a520 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;

    /* Glass effect */
    box-shadow:
        0 4px 16px rgba(243, 187, 39, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);

    /* Animation */
    animation: iconPulse 2s ease-in-out infinite;
    position: relative;
}

/* Pulse animation */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 4px 16px rgba(243, 187, 39, 0.4),
            inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 6px 24px rgba(243, 187, 39, 0.6),
            inset 0 2px 4px rgba(255, 255, 255, 0.4);
    }
}

/* Glow ring effect */
.cookie-consent-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, #f3bb27, #d9a520);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(8px);
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.cookie-consent-icon svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* =========================================================================
   TEXT CONTENT
   ========================================================================= */

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    margin: 0 0 8px 0;
    font-size: 19px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    letter-spacing: -0.3px;

    /* Text gradient */
    background: linear-gradient(135deg, #333 0%, #555 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cookie-consent-description {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    font-weight: 400;
}

.cookie-consent-link {
    color: #f3bb27;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(243, 187, 39, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: 1px;
}

.cookie-consent-link:hover {
    color: #d9a520;
    border-bottom-color: #d9a520;
    transform: translateY(-1px);
}

/* =========================================================================
   BUTTONS - Premium Style
   ========================================================================= */

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-consent-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

/* Ripple effect on click */
.cookie-consent-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cookie-consent-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Accept All - Premium Gold */
.cookie-consent-btn-accept {
    background: linear-gradient(135deg, #f3bb27 0%, #d9a520 100%);
    color: #fff;
    box-shadow:
        0 4px 16px rgba(243, 187, 39, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-consent-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 24px rgba(243, 187, 39, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

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

/* Necessary Only - Glass Dark */
.cookie-consent-btn-necessary {
    background: rgba(108, 117, 125, 0.9);
    backdrop-filter: blur(10px);
    color: #fff;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-consent-btn-necessary:hover {
    background: rgba(90, 98, 104, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Customize - Glass Outlined */
.cookie-consent-btn-customize {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    color: #333;
    border: 2px solid rgba(243, 187, 39, 0.4);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cookie-consent-btn-customize:hover {
    background: rgba(243, 187, 39, 0.15);
    border-color: #f3bb27;
    color: #d9a520;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 187, 39, 0.2);
}

/* =========================================================================
   MODAL PREFERENZE - Glass Style
   ========================================================================= */

.cookie-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-consent-modal.show {
    display: flex;
}

.cookie-consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s;
}

.cookie-consent-modal-content {
    position: relative;

    /* Glassmorphism modal */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);

    border-radius: 24px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(243, 187, 39, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);

    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cookie-consent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 28px 20px;
    border-bottom: 1px solid rgba(243, 187, 39, 0.2);
    background: linear-gradient(180deg, rgba(243, 187, 39, 0.05) 0%, transparent 100%);
}

.cookie-consent-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #222;
    letter-spacing: -0.5px;

    background: linear-gradient(135deg, #333 0%, #f3bb27 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cookie-consent-modal-close {
    background: rgba(243, 187, 39, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 187, 39, 0.2);
    cursor: pointer;
    padding: 10px;
    color: #666;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-consent-modal-close:hover {
    background: rgba(243, 187, 39, 0.2);
    color: #d9a520;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(243, 187, 39, 0.3);
}

.cookie-consent-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.cookie-consent-modal-description {
    margin: 0 0 28px 0;
    font-size: 15px;
    color: #555;
    line-height: 1.7;
}

.cookie-consent-modal-footer {
    padding: 20px 28px 28px;
    border-top: 1px solid rgba(243, 187, 39, 0.2);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: linear-gradient(180deg, transparent 0%, rgba(243, 187, 39, 0.03) 100%);
}

/* =========================================================================
   CATEGORIE COOKIE - Card Style
   ========================================================================= */

.cookie-category {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 187, 39, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cookie-category:hover {
    border-color: rgba(243, 187, 39, 0.4);
    box-shadow:
        0 4px 16px rgba(243, 187, 39, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-title {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 700;
    color: #333;
    letter-spacing: -0.2px;
}

.cookie-category-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.cookie-category-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* =========================================================================
   TOGGLE SWITCH - Premium Style
   ========================================================================= */

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(200, 200, 200, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 2px;
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #f3bb27 0%, #d9a520 100%);
    border-color: rgba(243, 187, 39, 0.5);
    box-shadow:
        0 0 20px rgba(243, 187, 39, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.cookie-toggle-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */

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

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

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 12px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .cookie-consent-container {
        flex-direction: column;
        gap: 12px;
    }

    .cookie-consent-content {
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }

    .cookie-consent-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

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

    .cookie-consent-title {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .cookie-consent-description {
        font-size: 12px;
        line-height: 1.4;
    }

    .cookie-consent-actions {
        flex-direction: row;
        width: 100%;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .cookie-consent-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Nascondi testo lungo su mobile per pulsante "Personalizza" */
    .cookie-consent-btn-customize {
        min-width: auto;
    }

    .cookie-consent-modal-content {
        border-radius: 20px;
        max-width: 100%;
    }

    .cookie-consent-modal-header,
    .cookie-consent-modal-body,
    .cookie-consent-modal-footer {
        padding: 20px;
    }

    .cookie-consent-modal-footer {
        flex-direction: column;
    }

    .cookie-category {
        padding: 20px;
    }

    .cookie-category-header {
        flex-direction: column;
    }

    .cookie-category-toggle {
        flex-direction: row;
        align-self: flex-start;
        gap: 12px;
    }
}

/* =========================================================================
   RESPONSIVE EXTRA SMALL (iPhone SE, piccoli schermi)
   ========================================================================= */

@media (max-width: 375px) {
    .cookie-consent-banner {
        padding: 10px;
    }

    .cookie-consent-content {
        gap: 8px;
    }

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

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

    .cookie-consent-title {
        font-size: 14px;
        line-height: 1.2;
    }

    .cookie-consent-description {
        font-size: 11px;
        line-height: 1.3;
    }

    .cookie-consent-actions {
        gap: 6px;
    }

    .cookie-consent-btn {
        padding: 8px 6px;
        font-size: 11px;
        border-radius: 8px;
    }

    /* Abbrevia testi pulsanti su schermi molto piccoli */
    .cookie-consent-btn-customize::after {
        content: 'Scegli';
    }

    .cookie-consent-btn-customize {
        font-size: 0;
        line-height: 0;
    }

    .cookie-consent-btn-customize::after {
        font-size: 11px;
        line-height: normal;
    }
}

/* =========================================================================
   ACCESSIBILITÀ
   ========================================================================= */

.cookie-consent-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.cookie-consent-modal-close:focus {
    outline: 3px solid rgba(243, 187, 39, 0.5);
    outline-offset: 3px;
}

/* Reduce motion per utenti con preferenze accessibilità */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-consent-btn,
    .cookie-toggle-slider,
    .cookie-consent-modal-overlay,
    .cookie-consent-modal-content,
    .cookie-consent-icon {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================================
   DARK MODE SUPPORT (Opzionale)
   ========================================================================= */

@media (prefers-color-scheme: dark) {
    .cookie-consent-banner {
        background: rgba(30, 30, 30, 0.9);
        border-top-color: rgba(243, 187, 39, 0.4);
    }

    .cookie-consent-title {
        background: linear-gradient(135deg, #fff 0%, #f3bb27 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .cookie-consent-description {
        color: #ccc;
    }

    .cookie-consent-modal-content {
        background: rgba(30, 30, 30, 0.95);
    }

    .cookie-category {
        background: rgba(40, 40, 40, 0.6);
        border-color: rgba(243, 187, 39, 0.3);
    }

    .cookie-category-title {
        color: #fff;
    }

    .cookie-category-description {
        color: #ccc;
    }
}
