/* ══════════════════════════════════════════════════════════════
   Smart Cookie Consent – Public Banner Styles
══════════════════════════════════════════════════════════════ */

/* ── Variables injectées via PHP ── */
#scc-banner, #scc-modal {
    --scc-banner-bg:         #1a1a2e;
    --scc-banner-text:       #e0e0e0;
    --scc-btn-accept-bg:     #0f3460;
    --scc-btn-accept-text:   #fff;
    --scc-btn-reject-bg:     transparent;
    --scc-btn-reject-text:   #e94560;
    --scc-btn-reject-border: #e94560;
    --scc-btn-settings-bg:   transparent;
    --scc-btn-settings-text: #a0a0a0;
    --scc-font-size:         14px;
    --scc-radius:            8px;
}

/* ── Wrap ── */
#scc-banner-wrap {
    position: fixed;
    z-index: 999999;
    left: 0;
    right: 0;
    animation: scc-slide-in .3s ease;
}

#scc-banner-wrap.scc-pos-bottom { bottom: 0; }
#scc-banner-wrap.scc-pos-top    { top: 0; animation-name: scc-slide-down; }
#scc-banner-wrap.scc-pos-bottom-left  { bottom: 20px; left: 20px; right: auto; max-width: 440px; }
#scc-banner-wrap.scc-pos-bottom-right { bottom: 20px; right: 20px; left: auto; max-width: 440px; }
#scc-banner-wrap.scc-pos-center { top: 50%; left: 50%; transform: translate(-50%, -50%); right: auto; max-width: 540px; animation-name: scc-pop-in; }

@keyframes scc-slide-in   { from { opacity:0; transform: translateY(30px); } to { opacity:1; transform: translateY(0); } }
@keyframes scc-slide-down { from { opacity:0; transform: translateY(-30px);} to { opacity:1; transform: translateY(0); } }
@keyframes scc-pop-in     { from { opacity:0; transform: translate(-50%,-44%) scale(.94); } to { opacity:1; transform: translate(-50%,-50%) scale(1); } }

/* ── Banner ── */
.scc-banner {
    background: var(--scc-banner-bg);
    color: var(--scc-banner-text);
    font-size: var(--scc-font-size);
    box-shadow: 0 -4px 30px rgba(0,0,0,.4);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.scc-pos-bottom .scc-banner,
.scc-pos-top .scc-banner { border-radius: 0; }

.scc-pos-bottom-left .scc-banner,
.scc-pos-bottom-right .scc-banner,
.scc-pos-center .scc-banner { border-radius: var(--scc-radius); box-shadow: 0 8px 40px rgba(0,0,0,.5); }

.scc-layout-bar .scc-banner-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 28px;
    flex-wrap: wrap;
}

.scc-layout-box .scc-banner-inner,
.scc-layout-floating .scc-banner-inner {
    display: block;
    padding: 24px 28px;
}

.scc-layout-box .scc-banner-actions,
.scc-layout-floating .scc-banner-actions {
    margin-top: 14px;
    justify-content: flex-end;
}

.scc-banner-content { flex: 1; min-width: 0; }
.scc-banner-title { margin: 0 0 4px; font-size: calc(var(--scc-font-size) + 2px); font-weight: 700; }
.scc-banner-text  { margin: 0; font-size: var(--scc-font-size); color: var(--scc-banner-text); opacity: .85; }
.scc-privacy-link { color: var(--scc-btn-reject-text); }
.scc-banner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ── Overlay ── */
.scc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: -1;
}

/* ── Buttons ── */
.scc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--scc-radius);
    border: none;
    cursor: pointer;
    font-size: calc(var(--scc-font-size) - 1px);
    font-weight: 600;
    line-height: 1;
    transition: opacity .18s, transform .18s;
    font-family: inherit;
    white-space: nowrap;
}
.scc-btn:hover { opacity: .88; transform: translateY(-1px); }
.scc-btn:active { transform: translateY(0); }

.scc-btn-accept {
    background: var(--scc-btn-accept-bg);
    color: var(--scc-btn-accept-text);
}
.scc-btn-reject {
    background: var(--scc-btn-reject-bg);
    color: var(--scc-btn-reject-text);
    border: 1px solid var(--scc-btn-reject-border);
}
.scc-btn-settings {
    background: var(--scc-btn-settings-bg);
    color: var(--scc-btn-settings-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.scc-btn-save {
    background: var(--scc-btn-accept-bg);
    color: var(--scc-btn-accept-text);
}

/* ── Modal overlay ── */
.scc-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.scc-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(4px);
}

/* ── Modal ── */
.scc-modal {
    position: relative;
    background: var(--scc-banner-bg);
    color: var(--scc-banner-text);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: var(--scc-font-size);
    border-radius: calc(var(--scc-radius) + 4px);
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: scc-pop-modal .25s ease;
}
@keyframes scc-pop-modal { from { opacity:0; transform: scale(.95); } to { opacity:1; transform: scale(1); } }

.scc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 0;
    background: var(--scc-banner-bg);
    z-index: 2;
}
.scc-modal-title { margin: 0; font-size: calc(var(--scc-font-size) + 4px); font-weight: 800; }
.scc-modal-x { background: none; border: none; color: inherit; cursor: pointer; font-size: 18px; opacity: .5; padding: 4px 8px; border-radius: 6px; transition: opacity .15s; }
.scc-modal-x:hover { opacity: 1; background: rgba(255,255,255,.08); }

.scc-modal-body { padding: 20px 28px; flex: 1; overflow-y: auto; }
.scc-modal-intro { opacity: .75; font-size: calc(var(--scc-font-size) - 1px); line-height: 1.6; margin-bottom: 20px; }
.scc-modal-intro a { color: var(--scc-btn-reject-text); }

/* ── Category blocks ── */
.scc-cat-block {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--scc-radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.scc-cat-block-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 18px;
    gap: 14px;
}
.scc-cat-block-info { display: flex; gap: 12px; flex: 1; align-items: flex-start; }
.scc-cat-icon { font-size: 20px; flex-shrink: 0; line-height: 1.2; }
.scc-cat-name { font-weight: 700; font-size: calc(var(--scc-font-size) + 1px); display: block; }
.scc-cat-count { display: inline-block; background: rgba(255,255,255,.12); font-size: 11px; padding: 2px 7px; border-radius: 10px; margin-left: 6px; }
.scc-cat-desc { margin: 4px 0 0; opacity: .7; font-size: calc(var(--scc-font-size) - 2px); line-height: 1.5; }
.scc-always-label { font-size: 11px; font-weight: 700; opacity: .6; white-space: nowrap; border: 1px solid rgba(255,255,255,.2); padding: 4px 10px; border-radius: 20px; flex-shrink: 0; }

/* ── Toggle ── */
.scc-toggle-wrap { display: inline-block; flex-shrink: 0; cursor: pointer; }
.scc-toggle-wrap input { display: none; }
.scc-tog { display: block; width: 44px; height: 24px; background: rgba(255,255,255,.15); border-radius: 12px; position: relative; transition: background .2s; }
.scc-tog::after { content: ''; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.scc-toggle-wrap input:checked + .scc-tog { background: var(--scc-btn-accept-bg); }
.scc-toggle-wrap input:checked + .scc-tog::after { transform: translateX(20px); }

/* ── Cookie detail table ── */
.scc-cookie-list { padding: 0 18px 14px; }
.scc-cookie-detail-table { width: 100%; border-collapse: collapse; font-size: calc(var(--scc-font-size) - 2px); }
.scc-cookie-detail-table th { text-align: left; padding: 6px 10px; opacity: .5; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid rgba(255,255,255,.08); }
.scc-cookie-detail-table td { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.scc-cookie-detail-table tr:last-child td { border-bottom: none; }
.scc-cookie-detail-table code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 4px; font-size: 11px; }

.scc-toggle-list { display: block; background: none; border: none; color: var(--scc-banner-text); opacity: .5; font-size: 12px; cursor: pointer; padding: 0 18px 12px; transition: opacity .15s; }
.scc-toggle-list:hover { opacity: .9; }

/* ── Modal footer ── */
.scc-modal-foot {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 28px 24px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,.08);
    position: sticky;
    bottom: 0;
    background: var(--scc-banner-bg);
}

/* ── Reopen button ── */
.scc-reopen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999990;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1a1a2e;
    border: 2px solid rgba(255,255,255,.15);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    transition: transform .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scc-slide-in .3s ease;
}
.scc-reopen-btn:hover { transform: scale(1.12); }

/* ── Scrollbar modal ── */
.scc-modal::-webkit-scrollbar { width: 5px; }
.scc-modal::-webkit-scrollbar-track { background: transparent; }
.scc-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .scc-layout-bar .scc-banner-inner { flex-direction: column; gap: 12px; padding: 16px; }
    .scc-banner-actions { width: 100%; justify-content: center; }
    .scc-modal { max-height: 95vh; margin: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    .scc-modal-wrap { align-items: flex-end; padding: 0; }
    .scc-modal-foot { flex-direction: column; }
    .scc-modal-foot .scc-btn { width: 100%; }
    #scc-banner-wrap.scc-pos-bottom-left,
    #scc-banner-wrap.scc-pos-bottom-right { left: 0; right: 0; bottom: 0; max-width: 100%; }
}
