/* =========================================================
   BLOOOW — COMPACT CARD BADGES + HEADER CONTROLS
   Loaded last so these rules intentionally win over legacy UI layers.
========================================================= */

/* ---------------------------------------------------------
   LISTING CARD BADGES
   Icon-only by design: no language-specific visible copy and no
   extra card clutter on narrow mobile layouts.
--------------------------------------------------------- */
.marketplace-card .listing-card-badge {
    position: absolute;
    z-index: 6;
    width: 27px;
    height: 27px;
    min-width: 27px;
    min-height: 27px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    isolation: isolate;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.marketplace-card .listing-card-badge::after {
    content: "";
    position: absolute;
    inset: 2px;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
}

.marketplace-card .listing-card-badge-icon,
.marketplace-card .listing-card-badge .verified-check,
.marketplace-card .listing-card-badge .status-icon {
    width: 15px;
    height: 15px;
    min-width: 0;
    min-height: 0;
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    transform: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Verified: familiar BLOOOW blue, using a shield-check rather than a text pill. */
.marketplace-card .listing-card-badge-verified,
.marketplace-card .listing-verified.listing-card-badge-verified,
.marketplace-card .status-badge.status-badge-verified.listing-card-badge {
    top: 8px;
    right: 8px;
    left: auto;
    border: 1px solid rgba(255, 255, 255, .88);
    background: color-mix(in srgb, var(--blue) 90%, transparent);
    color: #fff;
    box-shadow:
        0 5px 14px rgba(0, 0, 0, .24),
        0 0 0 1px rgba(0, 0, 0, .06);
}

.marketplace-card .listing-card-badge-verified .listing-card-badge-icon {
    width: 16px;
    height: 16px;
}

/* Spotlight / promoted: attach a compact ribbon tab to the card corner rather
   than floating a separate circle. This feels cleaner on both desktop and mobile. */
.marketplace-card .listing-card-badge-boosted,
.marketplace-card .listing-spotlight.listing-card-badge {
    top: -1px;
    left: -1px;
    right: auto;
    width: 24px;
    height: 30px;
    min-width: 24px;
    min-height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-top-left-radius: 18px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 0;
    background:
        linear-gradient(180deg, #ff4a52 0%, #d91f2d 58%, #b91322 100%);
    color: #fff;
    box-shadow:
        0 10px 18px rgba(0, 0, 0, .22),
        inset 0 1px 0 rgba(255, 255, 255, .26);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.marketplace-card .listing-card-badge-boosted::after,
.marketplace-card .listing-spotlight.listing-card-badge::after {
    inset: auto 0 0 0;
    height: 8px;
    border-radius: 0;
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    background: rgba(0, 0, 0, .16);
}

.marketplace-card .listing-card-badge-boosted .listing-card-badge-icon {
    width: 12px;
    height: 12px;
    margin-top: -5px;
    fill: currentColor;
    stroke: none;
}

.marketplace-card .listing-card-badge-spark {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18));
}

.marketplace-card .listing-card-badge-featured,
.marketplace-card .status-badge.status-badge-featured.listing-card-badge {
    top: 8px;
    right: 8px;
    left: auto;
    border: 1px solid color-mix(in srgb, var(--text) 50%, transparent);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    color: var(--text);
    box-shadow:
        0 5px 14px rgba(0, 0, 0, .20),
        0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent);
}

.marketplace-card .listing-card-badge-boosted .listing-card-badge-icon,
.marketplace-card .listing-card-badge-featured .listing-card-badge-icon {
    width: 13px;
    height: 13px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.4;
}


.marketplace-card:hover .listing-card-badge,
.marketplace-card:focus-visible .listing-card-badge {
    transform: translateY(-1px);
}

.marketplace-card:hover .listing-card-badge-boosted,
.marketplace-card:focus-visible .listing-card-badge-boosted {
    filter: saturate(1.06) brightness(1.02);
}

.marketplace-card:hover .listing-card-badge-verified,
.marketplace-card:focus-visible .listing-card-badge-verified {
    background: var(--blue-strong);
}

/* The subtle promotion outline remains, but the card no longer gets a loud red badge. */
.marketplace-card.spotlight-card {
    box-shadow:
        0 0 0 1px rgba(201, 29, 37, .24),
        0 12px 28px rgba(0, 0, 0, .08);
}

.marketplace-card.spotlight-card:hover,
.marketplace-card.spotlight-card:focus-visible {
    box-shadow:
        0 0 0 1px rgba(201, 29, 37, .46),
        0 16px 34px rgba(0, 0, 0, .14);
}

/* ---------------------------------------------------------
   THEME CONTROL
   Rich pill-style switch with a sliding knob. Compact enough for mobile,
   but visually aligned with the language pill.
--------------------------------------------------------- */
.blooow-header-actions .blooow-theme-toggle {
    position: relative;
    width: 58px;
    height: 36px;
    min-width: 58px;
    flex: 0 0 58px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0)),
        color-mix(in srgb, var(--surface) 96%, transparent);
    color: var(--text);
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 8px 18px rgba(0, 0, 0, .16);
    cursor: pointer;
    transition:
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease,
        transform 150ms ease;
}

.blooow-header-actions .blooow-theme-toggle::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 22% 24%, rgba(255, 255, 255, .16), transparent 28%),
        linear-gradient(90deg, rgba(69, 112, 255, .16), rgba(255, 199, 84, .14));
    opacity: .82;
    transition: opacity 180ms ease, background 180ms ease;
    pointer-events: none;
}

.blooow-header-actions .blooow-theme-toggle:hover,
.blooow-header-actions .blooow-theme-toggle:focus-visible {
    border-color: var(--blue-line);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 0 0 4px var(--blue-soft),
        0 10px 22px rgba(0, 0, 0, .18);
}

.blooow-header-actions .blooow-theme-toggle:active {
    transform: translateY(1px);
}

.blooow-theme-icon-stage {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    display: block;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .72), rgba(255, 255, 255, .18) 36%, rgba(255, 255, 255, 0) 37%),
        linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(235, 240, 255, .92));
    box-shadow:
        0 2px 5px rgba(0, 0, 0, .14),
        inset 0 1px 0 rgba(255, 255, 255, .78);
    transform: translateX(0);
    transition:
        transform 200ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

.blooow-header-actions .blooow-theme-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 180ms ease, transform 200ms ease, color 180ms ease;
}

:root[data-theme="dark"] .blooow-header-actions .blooow-theme-toggle {
    color: #f7fbff;
}

:root[data-theme="dark"] .blooow-header-actions .blooow-theme-toggle::before {
    background:
        radial-gradient(circle at 22% 24%, rgba(255, 255, 255, .14), transparent 28%),
        linear-gradient(90deg, rgba(66, 96, 196, .34), rgba(29, 39, 82, .42));
}

:root[data-theme="dark"] .blooow-header-actions .blooow-theme-icon-stage {
    transform: translateX(24px);
    background:
        radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 34%),
        linear-gradient(180deg, #f2f4fb, #d9e2ff);
}

:root[data-theme="dark"] .blooow-header-actions .blooow-theme-sun {
    opacity: 0;
    transform: scale(.68) rotate(-18deg);
    color: #ffbd45;
}

:root[data-theme="dark"] .blooow-header-actions .blooow-theme-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    color: #375eea;
}

:root[data-theme="light"] .blooow-header-actions .blooow-theme-toggle {
    color: #111827;
}

:root[data-theme="light"] .blooow-header-actions .blooow-theme-toggle::before {
    background:
        radial-gradient(circle at 24% 24%, rgba(255, 255, 255, .58), transparent 28%),
        linear-gradient(90deg, rgba(255, 203, 84, .34), rgba(255, 232, 160, .40));
}

:root[data-theme="light"] .blooow-header-actions .blooow-theme-icon-stage {
    transform: translateX(0);
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .74), rgba(255, 255, 255, .2) 34%, rgba(255, 255, 255, 0) 35%),
        linear-gradient(180deg, #ffffff, #fff2b7);
}

:root[data-theme="light"] .blooow-header-actions .blooow-theme-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    color: #d98900;
}

:root[data-theme="light"] .blooow-header-actions .blooow-theme-moon {
    opacity: 0;
    transform: scale(.68) rotate(18deg);
    color: #375eea;
}

/* ---------------------------------------------------------
   LANGUAGE CONTROL
--------------------------------------------------------- */
.blooow-header-actions {
    gap: 7px;
}

.blooow-language-trigger {
    height: 36px;
    min-width: 68px;
    padding: 0 10px;
    gap: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    color: var(--text);
    box-shadow: none;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .02em;
    transition:
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease;
}

.blooow-language-trigger:hover,
.blooow-language-trigger:focus-visible,
.blooow-language-switcher[open] .blooow-language-trigger {
    border-color: var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue-strong);
    box-shadow: 0 0 0 4px var(--blue-soft);
}

.blooow-language-globe {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .86;
}

.blooow-language-current {
    min-width: 20px;
    text-align: center;
    white-space: nowrap;
}

.blooow-language-chevron {
    width: 9px;
    height: 6px;
    flex: 0 0 9px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .6;
    transition: transform 150ms ease;
}

.blooow-language-switcher[open] .blooow-language-chevron {
    transform: rotate(180deg);
}

.blooow-language-menu {
    top: calc(100% + 10px);
    width: 174px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}

.blooow-language-menu button {
    width: 100%;
    min-height: 40px;
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.blooow-language-menu button:hover,
.blooow-language-menu button:focus-visible {
    background: color-mix(in srgb, var(--text) 7%, transparent);
}

.blooow-language-menu button.is-current,
.blooow-language-menu button:disabled {
    background: var(--blue-soft);
    color: var(--blue-strong);
    cursor: default;
    opacity: 1;
}

.blooow-language-option-code {
    color: var(--muted-strong);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .02em;
}

.blooow-language-option-name {
    min-width: 0;
    font-size: .77rem;
    font-weight: 720;
    white-space: nowrap;
}

.blooow-language-option-check {
    justify-self: end;
    color: var(--blue-strong);
    font-size: .72rem;
    font-weight: 950;
}

html[lang="si"] .blooow-language-trigger,
html[lang="ta"] .blooow-language-trigger,
html[lang="si"] .blooow-language-menu button,
html[lang="ta"] .blooow-language-menu button {
    letter-spacing: 0;
}

@media (max-width: 640px) {
    .marketplace-card .listing-card-badge {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }

    .marketplace-card .listing-card-badge-verified,
    .marketplace-card .listing-card-badge-featured {
        top: 7px;
        right: 7px;
    }

    .marketplace-card .listing-card-badge-boosted,
    .marketplace-card .listing-spotlight.listing-card-badge {
        top: -1px;
        left: -1px;
        width: 21px;
        height: 27px;
        min-width: 21px;
        min-height: 27px;
    }

    .marketplace-card .listing-card-badge-verified .listing-card-badge-icon {
        width: 14px;
        height: 14px;
    }

    .marketplace-card .listing-card-badge-boosted .listing-card-badge-icon,
    .marketplace-card .listing-card-badge-featured .listing-card-badge-icon {
        width: 11px;
        height: 11px;
    }

    .marketplace-card .listing-card-badge-boosted .listing-card-badge-icon {
        margin-top: -5px;
    }

    .blooow-header-actions {
        gap: 5px;
    }

    .blooow-language-trigger {
        min-width: 58px;
        height: 34px;
        padding-inline: 8px;
        gap: 5px;
        font-size: .64rem;
    }

    .blooow-language-globe {
        width: 14px;
        height: 14px;
        flex-basis: 14px;
    }

    .blooow-language-chevron {
        display: none;
    }

    .blooow-header-actions .blooow-theme-toggle {
        width: 54px;
        height: 34px;
        min-width: 54px;
        flex-basis: 54px;
        padding: 3px;
    }

    .blooow-theme-icon-stage {
        width: 26px;
        height: 26px;
    }

    .blooow-header-actions .blooow-theme-icon {
        width: 14px;
        height: 14px;
    }

    :root[data-theme="dark"] .blooow-header-actions .blooow-theme-icon-stage {
        transform: translateX(20px);
    }

    .blooow-language-menu {
        width: 164px;
        right: -39px;
    }
}

@media (max-width: 420px) {
    .blooow-language-trigger {
        min-width: 54px;
        padding-inline: 7px;
    }

    .blooow-language-globe {
        width: 13px;
        height: 13px;
        flex-basis: 13px;
    }

    .blooow-language-menu {
        right: -36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .marketplace-card .listing-card-badge,
    .blooow-header-actions .blooow-theme-toggle,
    .blooow-header-actions .blooow-theme-icon,
    .blooow-language-trigger,
    .blooow-language-chevron {
        transition: none;
    }
}
