﻿/* =========================
   Base (template)
   ========================= */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

code {
    color: #c02d76;
}

/* =========================
   TV fullscreen / kiosk
   ========================= */
html, body {
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: #000;
}

#app {
    width: 100%;
    height: 100%;
}

/* TV não usa padding do template */
.content {
    padding: 0 !important;
}

/* =========================
   TV Root
   ========================= */
.tv-root {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh; /* fallback */
    height: 100dvh; /* mobile moderno */
    overflow: hidden;
    background: #0b0f14;
    color: #fff;
    font-family: var(--tv-font, system-ui);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    --tv-pad: clamp(12px, 3.5vmin, 60px);
    --tv-gap: clamp(10px, 2.2vmin, 28px);
}

.tv-center {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    opacity: .9;
}

/* =========================
   Produto (fullscreen)
   ========================= */
.tv-product {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--tv-pad);
    gap: var(--tv-gap);
    background-image: var(--tv-bg, none);
    background-size: cover;
    background-position: center;
}

.tv-product-name {
    max-width: min(1200px, 92vw);
    text-align: center;
    font-weight: 800;
    line-height: 1.05;
    color: var(--tv-name, #fff);
    font-size: var(--tv-name-size, 60px);
    font-size: clamp(24px, min(var(--tv-name-size, 60px), 10vmin), 96px);
}

.tv-price-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: clamp(10px, 2.5vmin, 24px);
}

.tv-price-normal {
    font-size: clamp(16px, 4.5vmin, 44px);
    text-decoration: line-through;
    opacity: .65;
}

.tv-price-promo,
.tv-price-final {
    font-weight: 900;
    color: var(--tv-price, #fff);
    /* respeita o profile, mas mantém mínimo e evita exagero em telas pequenas */
    font-size: clamp(22px, var(--tv-price-size, 80px), 600px);
    line-height: 1;
}

/* =========================
   Mídia (img/video)
   ========================= */
.tv-media {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    background: #000;
}


/* =========================
   TV Pair (/pair)
   ========================= */
.pair-root {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(900px 700px at 20% 10%, rgba(124,58,237,.22), transparent 55%), radial-gradient(800px 600px at 80% 20%, rgba(34,197,94,.16), transparent 55%), #05070c;
    color: #eaf0ff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.pair-card {
    width: min(520px, 100%);
    border-radius: 18px;
    background: rgba(15, 26, 48, .70);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    backdrop-filter: blur(10px);
    padding: 18px;
}

.pair-head h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .2px;
}

.pair-head p {
    margin: 8px 0 0;
    opacity: .78;
    font-size: 13px;
}

.pair-form {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.pair-label {
    font-size: 12px;
    opacity: .8;
}

.pair-input {
    width: 100%;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(10,16,28,.60);
    color: #fff;
    outline: none;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .22em;
    text-transform: uppercase;
}

    .pair-input::placeholder {
        color: rgba(234,240,255,.40);
        letter-spacing: normal;
        text-transform: none;
        font-weight: 700;
    }

    .pair-input:focus {
        border-color: rgba(124,58,237,.55);
        box-shadow: 0 0 0 4px rgba(124,58,237,.18);
    }

.pair-btn {
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(124,58,237,.45);
    background: rgba(124,58,237,.92);
    color: #fff;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}

    .pair-btn:hover {
        filter: brightness(1.06);
        box-shadow: 0 12px 28px rgba(0,0,0,.25);
    }

    .pair-btn:active {
        transform: translateY(1px);
    }

.pair-error {
    border: 1px solid rgba(239,68,68,.45);
    background: rgba(239,68,68,.12);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
    color: #ffb4b4;
}

.pair-foot {
    margin-top: 12px;
    font-size: 12px;
    opacity: .65;
}

/* =========================
   Tabela de Preços (DIV GRID) — ÚNICO BLOCO
   ========================= */

.tv-table {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: var(--tv-pad, 24px);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.6vmin, 18px);
    overflow: hidden;
    background: var(--tv-table-bg, #ffffff);
    color: var(--tv-table-text, #111111);
}

.tv-table-title {
    flex: 0 0 auto;
    width: 100%;
    border-radius: clamp(10px, 1.2vmin, 16px);
    padding: clamp(12px, 2.2vmin, 18px) clamp(14px, 2.6vmin, 22px);
    font-size: clamp(20px, 5vmin, 60px);
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--tv-table-title-bg, #b51212);
    color: var(--tv-table-title-color, #ffffff);
}

/* ✅ você quer remover “Página 1/..” do visual */
.tv-table-meta {
    display: none !important;
}

/* Container */
.tv-table-grid {
    flex: 1 1 auto;
    min-height: 0; /* ✅ importantíssimo pra não cortar em telas menores */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: clamp(10px, 1.2vmin, 16px);
    border: 1px solid rgba(0,0,0,.14);
    background: transparent;
    --rows: var(--tv-table-rows, 10);
    --px: clamp(12px, 2.2vmin, 16px);
    --py: clamp(6px, calc(110px / var(--rows)), 14px);
    /* ✅ fonte nunca zera (usa viewport, funciona em modal/preview também) */
    font-size: clamp(12px, calc(56vh / var(--rows)), var(--tv-table-font-size, 34px));
}

/* Browsers modernos: dvh melhora em mobile */
@supports (height: 100dvh) {
    .tv-table-grid {
        font-size: clamp(12px, calc(56dvh / var(--rows)), var(--tv-table-font-size, 34px));
    }
}

/* Cabeçalho */
.tv-table-head {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr minmax(160px, 22%);
    align-items: center;
    padding: var(--py) var(--px);
    background: var(--tv-table-header-bg, #f3f3f3);
    color: var(--tv-table-header-color, #111111);
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0,0,0,.18);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.10);
}

/* Corpo: ✅ exatamente N linhas */
.tv-table-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
}

/* Linha */
.tv-tr {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 22%);
    align-items: center;
    padding: 0 var(--px);
    overflow: hidden;
    border-bottom: 1px solid rgba(0,0,0,.12);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.08);
}

    .tv-tr:last-child {
        border-bottom: none;
        box-shadow: none;
    }

    /* Zebra */
    .tv-tr.even {
        background: var(--tv-table-row-even-bg, #f7cfcf);
    }

/* células */
.tv-th, .tv-td {
    padding: var(--py) 0;
    line-height: 1.05;
    min-width: 0;
}

.tv-right {
    text-align: right;
    white-space: nowrap;
}

.tv-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* filler: mantém altura, não aparece */
.tv-tr.filler {
    opacity: 0;
}


/* =========================
   TV Loading (usado no /player e no index.html)
   ========================= */
.tv-loading {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: radial-gradient(900px 700px at 20% 10%, rgba(124,58,237,.22), transparent 55%), radial-gradient(800px 600px at 80% 20%, rgba(34,197,94,.16), transparent 55%), #000;
    color: #eaf0ff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    z-index: 9999;
}

.tv-loading-card {
    width: min(520px, 92vw);
    border-radius: 18px;
    background: rgba(15, 26, 48, .70);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    backdrop-filter: blur(10px);
    padding: 18px 18px 16px;
    text-align: center;
}

.tv-spinner {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 6px solid rgba(255,255,255,.18);
    border-top-color: rgba(255,255,255,.9);
    margin: 6px auto 12px;
    animation: tvspin .9s linear infinite;
}

@keyframes tvspin {
    to {
        transform: rotate(360deg);
    }
}

.tv-loading-title {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: .2px;
    margin-top: 4px;
}

.tv-loading-sub {
    margin-top: 6px;
    opacity: .78;
    font-size: 13px;
}

/* =========================
   ADMIN - LOADING (WASM startup)
   ========================= */
html, body {
    height: 100%;
}

#app {
    min-height: 100vh;
}

/* overlay sempre acima e sem “sumir” */
.app-loading {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(124,58,237,.18), transparent 60%), radial-gradient(900px 700px at 80% 20%, rgba(34,197,94,.12), transparent 60%), var(--bg);
    color: var(--text);
}

/* ✅ não bloqueia clique DEPOIS que o app carregou (quando o loader some, não importa)
   mas durante o startup é bom bloquear pra evitar clique “no vazio” */
.app-loading {
    pointer-events: all;
}

/* card */
.app-loading-card {
    width: min(560px, calc(100% - 48px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

/* spinner */
.loading-progress {
    width: 64px;
    height: 64px;
    display: block;
    filter: drop-shadow(0 10px 28px rgba(0,0,0,.35));
}

    .loading-progress .lp-track {
        fill: none;
        stroke: rgba(255,255,255,.12);
        stroke-width: 10;
    }

    .loading-progress .lp-bar {
        fill: none;
        stroke: rgba(124,58,237,.90);
        stroke-width: 10;
        stroke-linecap: round;
        stroke-dasharray: 251;
        stroke-dashoffset: 160;
        transform-origin: 50% 50%;
        animation: lp-rotate 1.15s linear infinite, lp-dash 1.35s ease-in-out infinite;
    }

@keyframes lp-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes lp-dash {
    0% {
        stroke-dashoffset: 210;
        opacity: .7;
    }

    50% {
        stroke-dashoffset: 80;
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 210;
        opacity: .85;
    }
}

.loading-text {
    text-align: center;
    line-height: 1.2;
}

.loading-title {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .2px;
}

.loading-sub {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(234,240,255,.70);
}

.loading-dots {
    display: inline-flex;
    gap: 6px;
    height: 10px;
    align-items: center;
}

    .loading-dots span {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: rgba(234,240,255,.65);
        animation: dot 1.05s infinite ease-in-out;
    }

        .loading-dots span:nth-child(2) {
            animation-delay: .15s;
            opacity: .85;
        }

        .loading-dots span:nth-child(3) {
            animation-delay: .30s;
            opacity: .75;
        }

@keyframes dot {
    0%,100% {
        transform: translateY(0);
        opacity: .55;
    }

    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}


/* =========================
   TV Price Animations
   ========================= */
.tv-price-final.anim-pulse,
.tv-price-normal.anim-pulse,
.tv-price-promo.anim-pulse {
    animation: tvPricePulse 1.4s ease-in-out infinite;
}

@keyframes tvPricePulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.035);
        filter: brightness(1.08);
    }
}

.tv-price-final.anim-slideup,
.tv-price-normal.anim-slideup,
.tv-price-promo.anim-slideup {
    animation: tvPriceSlideUp 1.1s cubic-bezier(.2,.8,.2,1) infinite;
}

@keyframes tvPriceSlideUp {
    0%, 100% {
        transform: translateY(0);
        filter: brightness(1);
    }

    50% {
        transform: translateY(-6px);
        filter: brightness(1.08);
    }
}

.tv-price-final.anim-glow,
.tv-price-normal.anim-glow,
.tv-price-promo.anim-glow {
    animation: tvPriceGlow 1.3s ease-in-out infinite;
}

@keyframes tvPriceGlow {
    0%, 100% {
        text-shadow: 0 0 0 rgba(255,255,255,0);
        filter: brightness(1);
    }

    50% {
        text-shadow: 0 0 22px rgba(255,255,255,.45);
        filter: brightness(1.12);
    }
}

/* =========================
   TV Table Animations
   ========================= */

.tv-table.tbl-anim-none {}

/* Slide: container desce/sobe leve */
.tv-table.tbl-anim-slide.out .tv-table-grid,
.tv-table.tbl-anim-slide.out .tv-table-title {
    animation: tblSlideOut .35s ease forwards;
}
.tv-table.tbl-anim-slide.in .tv-table-grid,
.tv-table.tbl-anim-slide.in .tv-table-title {
    animation: tblSlideIn .42s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes tblSlideOut {
    to { transform: translateY(-14px); opacity: 0; }
}
@keyframes tblSlideIn {
    from { transform: translateY(18px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Stagger: linhas entram em cascata com index */
.tv-table.tbl-anim-stagger.in .tv-tr {
    opacity: 0;
    transform: translateY(10px);
    animation: tblRowIn .45s ease forwards;
    animation-delay: calc(var(--row-i, 0) * 55ms);
}

.tv-table.tbl-anim-stagger.out .tv-tr {
    animation: tblRowOut .28s ease forwards;
}

@keyframes tblRowIn {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes tblRowOut {
    to { transform: translateY(-10px); opacity: 0; }
}

/* Wipe: “cortina” revela/encobre */
.tv-table.tbl-anim-wipe .tv-table-grid {
    overflow: hidden;
    position: relative;
}
.tv-table.tbl-anim-wipe.out .tv-table-grid { animation: tblWipeOut .35s ease forwards; }
.tv-table.tbl-anim-wipe.in  .tv-table-grid { animation: tblWipeIn .45s ease forwards; }

@keyframes tblWipeOut {
    to { clip-path: inset(0 0 100% 0); opacity: .9; }
}
@keyframes tblWipeIn {
    from { clip-path: inset(100% 0 0 0); opacity: .9; }
    to   { clip-path: inset(0 0 0 0); opacity: 1; }
}