/*
    Shared styling for the theme gallery, its cards, the preview frame and the current-theme tile.
    Not scoped per-component (::deep would be needed everywhere) — these classes are all prefixed and
    only used by the Components/Themes set. Linked from App.razor alongside the other site CSS.
*/

/* ── Theme card ─────────────────────────────────────────────────────────────────────────────── */
.tc-card {
    width: 110px;
    cursor: pointer;
    border-radius: 12px;
    padding: 4px;
    border: 2px solid transparent;
    transition: border-color .15s ease, transform .15s ease;
}
.tc-card:hover { transform: translateY(-2px); }
.tc-card:focus-visible { outline: 2px solid #e08a63; outline-offset: 2px; }
.tc-card.selected { border-color: #e0b463; }

.tc-thumb {
    position: relative;
    height: 64px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tc-thumb svg {
    width: 26px; height: 26px;
    fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.5;
    stroke-linecap: round; stroke-linejoin: round;
}
.tc-emoji { font-size: 24px; line-height: 1; }

.tc-badge {
    position: absolute;
    left: 4px; right: 4px; bottom: 4px;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    padding: 2px 0;
    border-radius: 6px;
    background: rgba(224, 160, 60, .92);
    color: #2a1c05;
}

.tc-label {
    margin-top: 6px;
    font-size: 12px;
    text-align: center;
    line-height: 1.25;
}
.tc-card.needs-setup .tc-thumb { opacity: .78; }

/* ── Preview frame ──────────────────────────────────────────────────────────────────────────── */
.tpf-stage {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    flex: none;
}
.tpf-frame {
    position: absolute;
    top: 0; left: 0;
    border: 0;
    transform-origin: top left;
    /* The preview is for looking at, not clicking into. */
    pointer-events: none;
}
.tpf-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%; padding: 12px;
    font-size: 12px; text-align: center; color: #9b8a76;
}

/* ── Gallery dialog ─────────────────────────────────────────────────────────────────────────── */
.tg-root {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-height: 60vh;
}
.tg-browse { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tg-detail {
    flex: 0 0 340px;
    position: sticky; top: 0;
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(0,0,0,.04);
}

.tg-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tg-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.tg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-chip {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(128,128,128,.35);
    cursor: pointer;
    user-select: none;
}
.tg-chip.on { border-color: #e0b463; background: rgba(224,180,99,.16); font-weight: 600; }

.tg-results { max-height: 58vh; overflow-y: auto; padding-right: 6px; }
.tg-cat { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.tg-cat span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.tg-rule { flex: 1; height: 1px; background: rgba(128,128,128,.25); }
.tg-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tg-empty { font-size: 13px; opacity: .7; padding: 24px 0; }

.tg-detail-empty { font-size: 13px; opacity: .7; text-align: center; padding: 40px 12px; }
.tg-detail-head { display: flex; flex-direction: column; gap: 4px; }
.tg-detail-title { font-size: 17px; font-weight: 700; }
.tg-detail-desc { font-size: 12px; opacity: .75; line-height: 1.4; }
.tg-detail-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; }

.tg-gap, .ct-gap {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(224,160,60,.14);
    color: #8a5f14;
}
.tg-gap a, .ct-gap a { color: inherit; font-weight: 700; }

/* ── Current-theme tile ─────────────────────────────────────────────────────────────────────── */
.ct-card { display: flex; flex-direction: column; gap: 16px; }
.ct-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ct-preview { flex: none; }
.ct-none {
    display: flex; align-items: center; justify-content: center;
    width: 150px; height: 266px;
    border-radius: 12px;
    background: rgba(128,128,128,.14);
    font-size: 12px; opacity: .7;
}
.ct-meta { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ct-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.ct-title { font-size: 20px; font-weight: 700; }
.ct-desc { font-size: 13px; opacity: .75; line-height: 1.45; }
.ct-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.ct-link { font-size: 13px; font-weight: 600; text-decoration: none; }

.ct-options { border-top: 1px solid rgba(128,128,128,.2); padding-top: 14px; }
.ct-options-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    opacity: .65; margin-bottom: 10px;
}

/* ── Options panel ──────────────────────────────────────────────────────────────────────────── */
.top-panel { display: flex; flex-direction: column; gap: 16px; }
.top-field { display: flex; flex-direction: column; }
.top-field > label { font-size: 12px; font-weight: 600; margin-bottom: 6px; opacity: .8; }
.top-hint { font-size: 11px; opacity: .6; margin-top: 4px; }
.top-note { font-size: 13px; color: #7d6852; margin: 0 0 8px; line-height: 1.45; }
.top-warn { font-size: 12px; color: #c0392b; margin: 0; }
.top-link { font-size: 13px; font-weight: 600; text-decoration: none; }
.top-cta {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    border: 1px solid #e08a63; background: rgba(224,138,99,.1); color: #a35630;
    border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 700;
    align-self: flex-start;
}
.top-cta:hover { background: rgba(224,138,99,.18); }
.top-date {
    width: 100%; padding: 8px 12px; border-radius: 8px;
    border: 1px solid rgba(128,128,128,.3);
    background: rgba(128,128,128,.06);
    font-size: 14px;
}

@media (max-width: 900px) {
    .tg-root { flex-direction: column; }
    .tg-detail { flex: 1 1 auto; width: 100%; position: static; }
    .tg-results { max-height: none; }
}
