/*
 * Tobalt Sausainiai v1.1.0 — Modern Tobalt-branded banner overrides for orestbida v3.
 * Author: Tobalt — https://tobalt.lt
 *
 * orestbida v3 exposes its appearance via CSS custom properties on #cc-main.
 * We inject per-install values inline via Frontend::theme_css(); this file
 * defines the modern visual layer: layout, equal-outline buttons (EDPB §86),
 * slide-up entry animation, and the floating reopen pill.
 *
 * Selector note: orestbida v3.1.0 buttons use BEM-style `.cm__btn` (consent modal)
 * and `.pm__btn` (preferences modal) classes — confirmed via Playwright DOM probe.
 * Earlier source-mine of minified UMD missed these because the class string is
 * built at runtime from concatenation, not present as a literal in the minified file.
 * Buttons carry `data-role="all|necessary|show|save"` for action discrimination.
 */

/* ── Banner container ─────────────────────────────────────────── */
#cc-main {
    font-family: var(--tobalt-sausainiai-font, inherit);
}
#cc-main .cm {
    max-width: 400px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.25);
    background: var(--cc-bg);
    color: var(--cc-text);
    animation: tobalt-sausainiai-slide-up 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tobalt-sausainiai-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Preferences modal: matching radius + shadow ─────────────── */
#cc-main .pm {
    border-radius: 12px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.30);
}

/* ── Equal-outline buttons (EDPB §86 compliance) ──────────────
   Both Accept and Reject buttons share identical visual weight:
   same border thickness, padding, font, min-width. Only color hue differs. */
#cc-main .cm__btn,
#cc-main .pm__btn {
    background: transparent;
    border: 2px solid;
    padding: 10px 20px;
    border-radius: var(--cc-btn-border-radius, 8px);
    font-weight: 600;
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    line-height: 1.4;
}

/* Accept All — primary-color outline */
#cc-main .cm__btn[data-role="all"],
#cc-main .pm__btn[data-role="all"] {
    border-color: var(--cc-primary-color);
    background: transparent;
    color: var(--cc-primary-color);
}
#cc-main .cm__btn[data-role="all"]:hover,
#cc-main .pm__btn[data-role="all"]:hover {
    background: var(--cc-primary-color);
    color: var(--cc-bg);
}

/* Reject All — secondary-color outline, EQUAL weight to Accept */
#cc-main .cm__btn[data-role="necessary"],
#cc-main .pm__btn[data-role="necessary"] {
    border-color: var(--cc-secondary-color);
    background: transparent;
    color: var(--cc-secondary-color);
}
#cc-main .cm__btn[data-role="necessary"]:hover,
#cc-main .pm__btn[data-role="necessary"]:hover {
    background: var(--cc-secondary-color);
    color: var(--cc-bg);
}

/* Save preferences — primary fill (only inside preferences modal) */
#cc-main .pm__btn[data-role="save"] {
    border-color: var(--cc-primary-color);
    background: var(--cc-primary-color);
    color: var(--cc-bg);
}
#cc-main .pm__btn[data-role="save"]:hover {
    background: transparent;
    color: var(--cc-primary-color);
}

/* Tertiary action — "Tvarkyti nustatymus" as text link */
#cc-main .cm__btn[data-role="show"] {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--cc-text);
    text-decoration: underline;
    font-weight: 400;
    font-size: 13px;
    min-width: 0;
    text-align: left;
}
#cc-main .cm__btn[data-role="show"]:hover {
    color: var(--cc-primary-color);
}

/* Title row */
#cc-main .cm__title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Description text */
#cc-main .cm__desc {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ── Logo (optional, admin-uploaded) ──────────────────────── */
.tobalt-sausainiai-logo {
    max-height: 32px;
    margin-right: 12px;
    vertical-align: middle;
}

/* ── Drawer-peek (icon-only, anchored to viewport bottom edge) ──
   Tomas verbatim: "Just image, no text please." */
.tobalt-sausainiai-reopen {
    position: fixed;
    bottom: 0;
    left: 20px;
    z-index: 999998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px 4px 14px;
    border-radius: 12px 12px 0 0;
    background: var(--cc-bg, #ffffff);
    border: 1px solid var(--cc-secondary-color, #6b7280);
    border-bottom: none;
    color: var(--cc-text, #222222);
    font-family: var(--tobalt-sausainiai-font, inherit);
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: box-shadow 150ms ease, transform 150ms ease;
    user-select: none;
}
.tobalt-sausainiai-reopen:hover {
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.20);
    transform: translateY(-2px);
}
.tobalt-sausainiai-reopen:focus-visible {
    outline: 2px solid var(--cc-primary-color, #0073aa);
    outline-offset: 2px;
}
.tobalt-sausainiai-reopen[hidden] {
    display: none !important;
}

/* ── Mobile responsive ──────────────────────────────────── */
@media (max-width: 480px) {
    #cc-main .cm {
        max-width: calc(100vw - 32px);
        margin: 0 16px;
    }
}
