/**
 * ConsentX Pro v2.0.0 — Complete CSS Bundle
 */

/* ── Reset inside wrapper ── */
#consentx-wrapper,
#consentx-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Animations ── */
@keyframes cx-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes cx-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes cx-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* ── Main Wrapper ── */
#consentx-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    font-size: 14px;
    color: var(--cx-text, #1a1a2e);
    z-index: 999999;
    animation: cx-slide-up .35s ease;
    backdrop-filter: var(--cx-blur, none);
    -webkit-backdrop-filter: var(--cx-blur, none);
    background: var(--cx-bg, rgba(255,255,255,0.9));
    box-shadow: var(--cx-shadow, 0 8px 32px rgba(0,0,0,0.18));
    border: var(--cx-border, 1px solid rgba(255,255,255,0.6));
}

/* ── Panel ── */
.cx-panel {
    padding: 20px 24px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.2) transparent;
}
.cx-panel::-webkit-scrollbar { width: 4px; }
.cx-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 4px; }

/* ── Header ── */
.cx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cx-logo {
    font-size: 24px;
    line-height: 1;
}
.cx-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--cx-subtext, #666);
    opacity: .7;
    padding: 4px 8px;
    border-radius: 6px;
    transition: opacity .2s, background .2s;
    line-height: 1;
}
.cx-close:hover { opacity: 1; background: rgba(0,0,0,.07); }

/* ── Text ── */
.cx-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--cx-text, #1a1a2e);
    margin-bottom: 8px;
}
.cx-desc {
    font-size: 13px;
    color: var(--cx-subtext, #555);
    line-height: 1.6;
    margin-bottom: 16px;
}
.cx-privacy-link {
    color: var(--cx-primary, #5c6bc0);
    text-decoration: underline;
}
.cx-footer {
    margin-top: 14px;
    font-size: 10px;
    color: var(--cx-subtext, #888);
    opacity: .6;
    text-align: center;
    letter-spacing: .3px;
}

/* ── Categories ── */
.cx-cats {
    margin-bottom: 16px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    overflow: hidden;
}
.cx-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    transition: background .15s;
}
.cx-cat-row:last-child { border-bottom: none; }
.cx-cat-row:hover { background: rgba(0,0,0,.025); }
.cx-cat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.cx-cat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cx-text, #1a1a2e);
}
.cx-cat-desc {
    font-size: 11px;
    color: var(--cx-subtext, #888);
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Toggle Switch ── */
.cx-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.cx-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.cx-switch-track {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.15);
    border-radius: 22px;
    transition: background .25s;
    cursor: pointer;
}
.cx-switch-track::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.cx-switch input:checked + .cx-switch-track { background: var(--cx-primary, #5c6bc0); }
.cx-switch input:checked + .cx-switch-track::before { transform: translateX(18px); }
.cx-switch input:disabled + .cx-switch-track {
    background: var(--cx-primary, #5c6bc0);
    opacity: .5;
    cursor: not-allowed;
}

/* ── Buttons ── */
.cx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.cx-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    white-space: nowrap;
    line-height: 1.2;
    font-family: inherit;
}
.cx-btn:hover { transform: translateY(-1px); }
.cx-btn:active { transform: translateY(0); }
.cx-primary {
    background: var(--cx-primary, #5c6bc0);
    color: #fff;
    box-shadow: 0 3px 10px rgba(92,107,192,.35);
}
.cx-primary:hover {
    background: var(--cx-primary-hover, #3949ab);
    box-shadow: 0 5px 14px rgba(92,107,192,.45);
}
.cx-secondary {
    background: rgba(0,0,0,.06);
    color: var(--cx-text, #333);
}
.cx-secondary:hover { background: rgba(0,0,0,.1); }
.cx-ghost {
    background: transparent;
    color: var(--cx-subtext, #666);
    border: 1px solid rgba(0,0,0,.15);
}
.cx-ghost:hover { background: rgba(0,0,0,.04); }

/* ── Utility ── */
.cx-hidden { display: none !important; }

/* ── Floating Widget ── */
#consentx-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cx-primary, #5c6bc0);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    animation: cx-fade-in .3s ease;
}
#consentx-widget:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

/* ── Undo Toast ── */
#cx-undo-toast {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: #2d2d2d;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    animation: cx-slide-up .3s ease;
    max-width: 320px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    #consentx-wrapper {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 14px 14px 0 0 !important;
        transform: none !important;
    }
    .cx-btn { min-width: 80px; font-size: 12px; padding: 9px 12px; }
}

/* ── Overlay for center popup ── */
#consentx-wrapper.cx-has-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: -1;
    animation: cx-fade-in .3s;
}

/* ── Admin dashboard compact notice ── */
.cx-banner-preview-note {
    background: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    margin: 16px 0;
}
