/* LGPD Frontend Styles v1.2.2 */

/* ─── Banner ─────────────────────────────────────────────────────────────── */
.csl-lgpd-popup {
    position: fixed;
    z-index: 9999998;
    background: #fff;
    color: #333;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    border-radius: 14px;
    padding: 22px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    width: 440px;
    max-width: 92vw;
}

.csl-lgpd-pos-bottom.csl-lgpd-align-left {
    bottom: 20px;
    left: 20px;
}

.csl-lgpd-pos-bottom.csl-lgpd-align-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.csl-lgpd-pos-bottom.csl-lgpd-align-right {
    bottom: 20px;
    right: 20px;
}

.csl-lgpd-pos-top.csl-lgpd-align-left {
    top: 20px;
    left: 20px;
}

.csl-lgpd-pos-top.csl-lgpd-align-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.csl-lgpd-pos-top.csl-lgpd-align-right {
    top: 20px;
    right: 20px;
}

.csl-lgpd-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #111 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.csl-btn {
    border: none;
    padding: 10px 14px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: opacity 0.15s;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    white-space: nowrap;
}

.csl-btn:hover {
    opacity: 0.88;
}

/* ─── Preferences Modal Overlay ──────────────────────────────────────────── */
#csl-lgpd-pref-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999999;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    padding: 16px;
    box-sizing: border-box;
}

#csl-lgpd-pref-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    animation: cslModalIn 0.22s ease;
}

@keyframes cslModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Modal Header */
.csl-pref-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ebebeb;
    flex-shrink: 0;
}

.csl-pref-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csl-pref-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #888;
    padding: 0 4px;
    transition: color 0.15s;
}

.csl-pref-modal-close:hover {
    color: #222;
}

/* Modal Body — scrollável */
.csl-pref-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.csl-pref-modal-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.5;
    margin: 0 0 14px;
}

/* Modal Footer */
.csl-pref-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #ebebeb;
    flex-shrink: 0;
}

.csl-pref-save-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s;
    background: #1a1a1a;
    color: #fff;
}

.csl-pref-save-btn:hover {
    opacity: 0.88;
}

/* ─── Category rows ──────────────────────────────────────────────────────── */
.csl-cat-row {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.csl-cat-row:last-child {
    margin-bottom: 0;
}

.csl-cat-row:has(.csl-cat-checkbox:checked) {
    border-color: #2c7be5;
}

.csl-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    background: #fafafa;
}

.csl-cat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csl-cat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.csl-cat-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.csl-cat-desc {
    font-size: 11px;
    color: #999;
}

/* Expand button */
.csl-cat-expand {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    color: #666;
    padding: 3px 9px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.csl-cat-expand:hover {
    background: #e8edf5;
    color: #2c7be5;
    border-color: #2c7be5;
}

.csl-cat-count {
    font-size: 11px;
}

.csl-expand-arrow {
    font-size: 9px;
}

/* Cookie list */
.csl-cat-cookies {
    padding: 8px 12px 10px;
    background: #fff;
    border-top: 1px solid #f2f2f2;
}

.csl-cookie-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.csl-cookie-entry:last-child {
    border-bottom: none;
}

.csl-cookie-name {
    font-family: 'Courier New', monospace;
    font-size: 11.5px;
    font-weight: 700;
    color: #1a1a1a;
}

.csl-cookie-meta {
    font-size: 10.5px;
    color: #9a9a9a;
    font-style: italic;
}

.csl-no-cookies {
    font-size: 11px;
    color: #bbb;
    font-style: italic;
    display: block;
    padding: 4px 0;
}

/* ─── Toggle Switch ──────────────────────────────────────────────────────── */
.csl-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.csl-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.csl-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d0d0d0;
    border-radius: 34px;
    transition: 0.25s;
}

.csl-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.csl-switch input:checked+.csl-slider {
    background: #2c7be5;
}

.csl-switch input:checked+.csl-slider:before {
    transform: translateX(16px);
}

.csl-switch input:disabled+.csl-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.csl-switch input:disabled:checked+.csl-slider {
    background: #6fa8e5;
}

/* ─── Floating Button ────────────────────────────────────────────────────── */
.csl-lgpd-float-btn {
    position: fixed;
    z-index: 9999997;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

/* Position combinations */
.csl-float-bottom-left {
    bottom: 20px;
    left: 20px;
}

.csl-float-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.csl-float-bottom-right {
    bottom: 20px;
    right: 20px;
}

.csl-float-top-left {
    top: 20px;
    left: 20px;
}

.csl-float-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.csl-float-top-right {
    top: 20px;
    right: 20px;
}

.csl-lgpd-float-btn:hover {
    transform: scale(1.1) rotate(18deg);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

/* center variants — override hover transform to keep centering */
.csl-float-bottom-center:hover,
.csl-float-top-center:hover {
    transform: translateX(-50%) scale(1.1) rotate(18deg);
}

.csl-lgpd-float-btn::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    /* padrão: botão à direita → tooltip alinha pela direita */
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* Botão à esquerda: tooltip abre para a direita */
.csl-float-bottom-left::before,
.csl-float-top-left::before {
    right: auto;
    left: 0;
}

/* Botão ao centro: tooltip centralizado */
.csl-float-bottom-center::before,
.csl-float-top-center::before {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* Botão no topo: tooltip abre para BAIXO (evita sair da tela pelo topo) */
.csl-float-top-left::before,
.csl-float-top-center::before,
.csl-float-top-right::before {
    bottom: auto;
    top: calc(100% + 8px);
}

.csl-lgpd-float-btn:hover::before {
    opacity: 1;
}

@media (max-width: 520px) {
    .csl-lgpd-popup {
        width: auto;
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        transform: none;
        padding: 16px;
    }

    .csl-lgpd-float-btn {
        bottom: 12px;
    }
    
    .csl-float-bottom-left, .csl-float-top-left { left: 12px; right: auto; }
    .csl-float-bottom-right, .csl-float-top-right { right: 12px; left: auto; }
    .csl-float-bottom-center, .csl-float-top-center { left: 50%; transform: translateX(-50%); }


    #csl-lgpd-pref-modal {
        max-height: 94vh;
        border-radius: 10px;
    }
}