/* ==========================================================================
   MACFaaast - Lightweight Open Source Cookie Consent System (GDPR & Garante Privacy)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Bottom Banner
   -------------------------------------------------------------------------- */
#mf-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(9, 27, 46, 0.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
    z-index: 999998;
    color: #f1f5f9;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 22px 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s ease,
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

#mf-cookie-banner.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mf-cb-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    box-sizing: border-box;
}

.mf-cb-content {
    flex: 1 1 auto;
}

.mf-cb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mf-cb-icon {
    width: 22px;
    height: 22px;
    color: #38bdf8;
    flex-shrink: 0;
}

.mf-cb-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    margin: 0;
}

.mf-cb-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: #cbd5e1;
    margin: 0;
}

.mf-cb-text a {
    color: #38bdf8;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.mf-cb-text a:hover {
    color: #7dd3fc;
}

.mf-cb-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mf-cb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    outline: none;
    line-height: 1.2;
}

.mf-cb-btn-accept {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.mf-cb-btn-accept:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.55);
    transform: translateY(-1px);
    color: #ffffff;
}

.mf-cb-btn-reject {
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.mf-cb-btn-reject:hover {
    background: rgba(51, 65, 85, 0.95);
    color: #ffffff;
    border-color: rgba(203, 213, 225, 0.5);
    transform: translateY(-1px);
}

.mf-cb-btn-settings {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.mf-cb-btn-settings:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

/* --------------------------------------------------------------------------
   2. Preferences Modal & Backdrop
   -------------------------------------------------------------------------- */
#mf-cookie-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

#mf-cookie-backdrop.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: block !important;
}

#mf-cookie-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    width: 92%;
    max-width: 660px;
    max-height: 88vh;
    background: #091b2e;
    background: linear-gradient(180deg, #0b223a 0%, #071524 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(56, 189, 248, 0.15);
    z-index: 1000000;
    color: #f8fafc;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s ease,
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

#mf-cookie-modal.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
    pointer-events: auto !important;
    display: flex !important;
}

/* Modal Header */
.mf-cm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px 18px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.mf-cm-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mf-cm-title-wrap svg {
    width: 24px;
    height: 24px;
    color: #38bdf8;
    flex-shrink: 0;
}

.mf-cm-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.3px;
}

.mf-cm-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
}

.mf-cm-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Modal Body */
.mf-cm-body {
    padding: 20px 26px;
    overflow-y: auto;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.mf-cm-body::-webkit-scrollbar {
    width: 6px;
}
.mf-cm-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 3px;
}

.mf-cm-intro {
    font-size: 13.5px;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0 0 20px 0;
}

/* Category Cards */
.mf-cm-cat-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mf-cm-cat-item {
    background: rgba(15, 34, 57, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.mf-cm-cat-item:hover {
    background: rgba(15, 34, 57, 0.85);
    border-color: rgba(56, 189, 248, 0.2);
}

.mf-cm-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.mf-cm-cat-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mf-cm-cat-badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.mf-cm-cat-desc {
    font-size: 12.5px;
    line-height: 1.55;
    color: #94a3b8;
    margin: 0;
}

/* Modern iOS Style Toggle Switch */
.mf-cm-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.mf-cm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.mf-cm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.mf-cm-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mf-cm-toggle input:checked + .mf-cm-slider {
    background-color: #0284c7;
    border-color: #38bdf8;
}

.mf-cm-toggle input:checked + .mf-cm-slider:before {
    transform: translateX(20px);
}

.mf-cm-toggle input:disabled + .mf-cm-slider {
    opacity: 0.75;
    cursor: not-allowed;
    background-color: #1e3a5f;
    border-color: rgba(56, 189, 248, 0.4);
}

/* Modal Footer */
.mf-cm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 26px 22px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   3. Mobile Responsive Styles
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .mf-cb-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .mf-cb-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .mf-cb-btn {
        width: 100%;
        text-align: center;
    }

    #mf-cookie-modal {
        width: 94%;
        max-height: 90vh;
    }

    .mf-cm-header {
        padding: 16px 20px;
    }

    .mf-cm-body {
        padding: 16px 20px;
    }

    .mf-cm-footer {
        padding: 16px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .mf-cm-footer .mf-cb-btn {
        width: 100%;
    }
}
