/**
 * Syrus Cookie Consent — Banner Styles
 *
 * Utilizza CSS custom properties (--scc-*) iniettate dal PHP
 * per permettere personalizzazione colori dal pannello admin.
 */

/* ===== OVERLAY ===== */
#scc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    display: none;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

#scc-overlay.scc-visible {
    display: block;
    animation: sccFadeIn 0.3s ease;
}

/* ===== BANNER ===== */
#scc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    display: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#scc-banner.scc-visible {
    display: block;
    transform: translateY(0);
}

/* Animazione ingresso */
@keyframes sccFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sccSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

#scc-banner.scc-animate {
    animation: sccSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== CONTAINER ===== */
#scc-banner .scc-container {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    padding: 24px 28px;
}

/* ===== HEADER ===== */
#scc-banner .scc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

#scc-banner .scc-header svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#scc-banner .scc-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

/* ===== TEXT ===== */
#scc-banner .scc-text {
    color: #555;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}

#scc-banner .scc-text a {
    color: var(--scc-primary, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}

#scc-banner .scc-text a:hover {
    text-decoration: none;
}

/* ===== TOGGLES ===== */
#scc-banner .scc-toggles {
    display: none;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

#scc-banner .scc-toggles.scc-active {
    display: flex;
}

#scc-banner .scc-toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    user-select: none;
    transition: background 0.2s;
}

#scc-banner .scc-toggle-item:hover {
    background: #ebebeb;
}

#scc-banner .scc-toggle-item.scc-disabled {
    opacity: 0.6;
}

#scc-banner .scc-toggle-item.scc-disabled:hover {
    background: #f5f5f5;
}

/* ===== SWITCH TOGGLE ===== */
#scc-banner .scc-switch {
    position: relative;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
}

#scc-banner .scc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

#scc-banner .scc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: background-color 0.3s ease;
    border-radius: 20px;
}

#scc-banner .scc-slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#scc-banner .scc-switch input:checked + .scc-slider {
    background-color: var(--scc-primary, #2563eb);
}

#scc-banner .scc-switch input:checked + .scc-slider::before {
    transform: translateX(18px);
}

#scc-banner .scc-switch input:disabled + .scc-slider {
    background-color: var(--scc-primary, #2563eb);
    cursor: default;
    opacity: 0.7;
}

#scc-banner .scc-switch input:focus-visible + .scc-slider {
    outline: 2px solid var(--scc-primary, #2563eb);
    outline-offset: 2px;
}

/* ===== BUTTONS ===== */
#scc-banner .scc-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#scc-banner .scc-btn {
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
}

#scc-banner .scc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#scc-banner .scc-btn:active {
    transform: translateY(0);
}

#scc-banner .scc-btn:focus-visible {
    outline: 2px solid var(--scc-primary, #2563eb);
    outline-offset: 2px;
}

/* Accept */
#scc-banner .scc-btn-accept {
    background: var(--scc-accept, #2563eb);
    color: #fff;
}

#scc-banner .scc-btn-accept:hover {
    background: var(--scc-accept-hover, #1d4ed8);
}

/* Reject */
#scc-banner .scc-btn-reject {
    background: #f3f4f6;
    color: #374151;
}

#scc-banner .scc-btn-reject:hover {
    background: #e5e7eb;
}

/* Customize */
#scc-banner .scc-btn-customize {
    background: transparent;
    color: var(--scc-primary, #2563eb);
    padding: 10px 16px;
}

#scc-banner .scc-btn-customize:hover {
    background: rgba(37, 99, 235, 0.06);
}

/* Save */
#scc-banner .scc-btn-save {
    background: var(--scc-save, #059669);
    color: #fff;
    display: none;
}

#scc-banner .scc-btn-save.scc-active {
    display: inline-block;
}

#scc-banner .scc-btn-save:hover {
    background: var(--scc-save-hover, #047857);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    #scc-banner .scc-container {
        padding: 18px 16px;
        border-radius: 12px 12px 0 0;
    }

    #scc-banner .scc-buttons {
        flex-direction: column;
    }

    #scc-banner .scc-btn {
        width: 100%;
        text-align: center;
    }

    #scc-banner .scc-toggles {
        flex-direction: column;
    }

    #scc-banner .scc-title {
        font-size: 15px;
    }

    #scc-banner .scc-text {
        font-size: 12px;
    }
}

/* ===== PRINT: nascondi il banner ===== */
@media print {
    #scc-banner,
    #scc-overlay {
        display: none !important;
    }
}
