/* ==========================================================================
   STUDYTOPPER™ OFFICIAL APPLE GLASS BENTO COOKIE CONSENT BANNER & MODAL
   Full GDPR, ePrivacy & Google Consent Mode v2 / AdSense Compliance
   Zero CLS - Zero Performance Penalty - Lightweight & GPU-Accelerated
   ========================================================================== */

#st-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    max-width: 400px;
    width: calc(100% - 48px);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 22px;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    display: none;
    opacity: 0;
    transform: translateY(25px) scale(0.98);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#st-cookie-banner.st-show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.st-cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.st-cookie-blob {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #046132, #000080);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(4, 97, 50, 0.22);
    flex-shrink: 0;
}

.st-cookie-title-wrap h3 {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.st-cookie-title-wrap span {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.st-cookie-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.55;
    margin: 0 0 16px 0;
}

.st-cookie-desc a {
    color: #000080;
    font-weight: 600;
    text-decoration: underline;
}

.st-cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.st-btn-accept-all {
    grid-column: span 2;
    background: linear-gradient(135deg, #046132 0%, #065f46 100%);
    color: #ffffff !important;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(4, 97, 50, 0.28);
    transition: all 0.2s ease;
    text-align: center;
}

.st-btn-accept-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(4, 97, 50, 0.38);
}

.st-btn-essential {
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid #cbd5e1;
    color: #334155 !important;
    padding: 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.st-btn-essential:hover {
    background: #e2e8f0;
    color: #0f172a !important;
}

.st-btn-customize {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(203, 213, 225, 0.85);
    color: #000080 !important;
    padding: 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.st-btn-customize:hover {
    background: #ffffff;
    border-color: #000080;
}

/* ==========================================================================
   MODAL PREFERENCES DRAWER (GDPR / ADSENSE DETAILED CHOICES)
   ========================================================================== */

#st-cookie-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#st-cookie-modal-backdrop.st-modal-show {
    display: flex;
    opacity: 1;
}

.st-cookie-modal-box {
    background: #ffffff;
    max-width: 460px;
    width: 100%;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    animation: stZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stZoomIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.st-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.st-modal-head h4 {
    font-size: 17px;
    font-weight: 800;
    color: #000080;
    margin: 0;
}

.st-modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.st-pref-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.st-pref-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.st-pref-info {
    flex: 1;
}

.st-pref-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-pref-desc {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.4;
}

/* Apple-style Toggle Switch */
.st-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.st-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.st-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.2s;
    border-radius: 22px;
}

.st-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.st-switch input:checked + .st-slider {
    background-color: #046132;
}

.st-switch input:disabled + .st-slider {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #046132;
}

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

.st-btn-save-pref {
    width: 100%;
    background: #000080;
    color: #ffffff !important;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 128, 0.25);
    transition: background 0.15s ease;
}

.st-btn-save-pref:hover {
    background: #070763;
}

/* ==========================================================================
   MOBILE RESPONSIVE COMPACT STYLING (Screen width <= 768px)
   Ultra-compact footprint, bottom 8px, streamlined buttons
   ========================================================================== */
@media (max-width: 768px) {
    #st-cookie-banner {
        bottom: 8px;
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
        padding: 10px 12px;
        border-radius: 14px;
        box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    }

    .st-cookie-header {
        gap: 7px;
        margin-bottom: 5px;
    }

    .st-cookie-blob {
        width: 24px;
        height: 24px;
        font-size: 13px;
        border-radius: 7px;
    }

    .st-cookie-title-wrap h3 {
        font-size: 13.5px;
        font-weight: 800;
        line-height: 1.15;
    }

    .st-cookie-title-wrap span {
        font-size: 9.5px;
    }

    .st-cookie-desc {
        font-size: 11px;
        line-height: 1.35;
        margin: 0 0 8px 0;
        color: #475569;
    }

    .st-cookie-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .st-btn-accept-all {
        grid-column: span 2;
        padding: 7.5px 8px;
        font-size: 12px;
        border-radius: 8px;
    }

    .st-btn-essential {
        padding: 6.5px 6px;
        font-size: 11px;
        border-radius: 7px;
    }

    .st-btn-customize {
        padding: 6.5px 6px;
        font-size: 11px;
        border-radius: 7px;
    }

    /* Modal compact adjustments for mobile */
    .st-cookie-modal-box {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .st-modal-head h4 {
        font-size: 15px;
    }

    .st-pref-card {
        padding: 9px 10px;
    }

    .st-pref-title {
        font-size: 12.5px;
    }

    .st-pref-desc {
        font-size: 10.5px;
    }
}
