/* =========================================================
   PAINEL TV E TELÃO PÚBLICO — ESPELHO FIEL FIGCRAFT (FRAME 4)
   Cores, Medidas, Tipografia e Layout Idênticos ao Mockup
   ========================================================= */

@import url('/static/fonts.css?v=bricolage');
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&display=swap');

:root {
    --tv-bg: #0B0E14;
    --tv-surface: #141822;
    --tv-border: #222736;

    --tv-primary-red: #D72B36;
    --tv-blue-studio: #2563EB;
    --tv-green-lab: #059669;
    --tv-purple-auditorio: #7C3AED;
    --tv-orange-warning: #F59E0B;
    --tv-yellow-eletivas: #FFBC1C;

    --tv-text-white: #FFFFFF;
    --tv-text-muted: #98A2B3;
    --tv-text-dimmed: #667085;
    --tv-text-cyan: #38BDF8;
    --tv-text-slate: #94A3B8;
    --tv-text-eletivas: #FFBC1C;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: var(--tv-bg);
    color: var(--tv-text-white);
    font-family: 'Bricolage Grotesque', 'Bricolage', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tv-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--tv-bg);
}

.tv-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 40px 60px 32px 60px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
    gap: 22px;
}

/* ─── TOPO DO TELÃO (HEADER) ─── */
.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.tv-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tv-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tv-header-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

.tv-brand-divider {
    width: 1px;
    height: 20px;
    background-color: var(--tv-border);
    display: inline-block;
}

.tv-brand-tag {
    font-size: 13px;
    font-weight: 700;
    color: var(--tv-primary-red);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tv-title-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 4px;
}

.tv-course-title {
    font-size: 34px;
    font-weight: 800;
    color: var(--tv-text-white);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-transform: uppercase;
}

.tv-course-sub {
    font-size: 15px;
    font-weight: 400;
    color: var(--tv-text-muted);
    margin-top: 4px;
}

.tv-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.tv-clock {
    font-size: 46px;
    font-weight: 800;
    color: var(--tv-text-white);
    line-height: 1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.tv-date {
    font-size: 15px;
    font-weight: 400;
    color: var(--tv-text-muted);
    margin-top: 6px;
}

/* ─── BARRA DE ABAS HORIZONTAL DE CURSOS ─── */
.tv-tabs-bar {
    width: 100%;
    height: 52px;
    min-height: 52px;
    flex-shrink: 0;
    background-color: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.tv-tabs-bar::-webkit-scrollbar {
    display: none;
}

/* Indicador deslizante (Pill) com efeito suave de arrasto */
.tv-tabs-slider {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
    background-color: var(--tv-primary-red);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    will-change: transform, width, height, background-color;
    transition: transform 0.42s cubic-bezier(0.25, 1, 0.4, 1),
                width 0.42s cubic-bezier(0.25, 1, 0.4, 1),
                height 0.42s cubic-bezier(0.25, 1, 0.4, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease,
                opacity 0.25s ease;
    box-shadow: 0 4px 14px rgba(215, 43, 54, 0.40);
}

.tv-tabs-slider.eletivas-active {
    background-color: var(--tv-yellow-eletivas);
    box-shadow: 0 4px 14px rgba(255, 188, 28, 0.40);
}

.tv-tabs-slider.pos-active {
    background-color: #6b21a8;
    box-shadow: 0 4px 14px rgba(107, 33, 168, 0.40);
}

.tv-tab {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--tv-text-muted);
    padding: 8px 18px;
    border-radius: 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.tv-tab:hover {
    color: var(--tv-text-white);
}

.tv-tab.active {
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: none;
    text-shadow: none;
    background: transparent;
}

.tv-tab-eletivas {
    color: var(--tv-yellow-eletivas);
    border: 1px solid rgba(255, 188, 28, 0.45);
    font-weight: 700;
    margin-left: auto;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.tv-tab-eletivas:hover {
    color: #FFFFFF;
    border-color: var(--tv-yellow-eletivas);
}

.tv-tab-eletivas.active {
    color: #0B0E14;
    border-color: transparent;
    font-weight: 800;
    background: transparent;
}

.tv-tab-pos {
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.45);
    font-weight: 700;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.tv-tab-pos:hover {
    color: #FFFFFF;
    border-color: #c084fc;
}

.tv-tab-pos.active {
    color: #FFFFFF;
    border-color: transparent;
    font-weight: 800;
    background: transparent;
}

/* ─── GRID DE CARDS DE SALAS (3 COLUNAS) ─── */
.tv-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    flex: 1 0 auto;
    align-content: start;
}

/* Transição suave de entrada dos cards / mural: da direita para a esquerda */
@keyframes tvContentSlideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tv-cards-grid > * {
    animation: tvContentSlideInRight 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tv-cards-grid > *:nth-child(1) { animation-delay: 0.02s; }
.tv-cards-grid > *:nth-child(2) { animation-delay: 0.05s; }
.tv-cards-grid > *:nth-child(3) { animation-delay: 0.08s; }
.tv-cards-grid > *:nth-child(4) { animation-delay: 0.11s; }
.tv-cards-grid > *:nth-child(5) { animation-delay: 0.14s; }
.tv-cards-grid > *:nth-child(6) { animation-delay: 0.17s; }

/* Animação suave para o título e subtítulo do curso ao trocar de página */
@keyframes tvTitleSlideInRight {
    from {
        opacity: 0;
        transform: translateX(35px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tv-title-group.animando-titulo .tv-course-title,
.tv-title-group.animando-titulo .tv-course-sub {
    animation: tvTitleSlideInRight 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Transição de saída e fallback para navegadores */
.tv-container.mudando-pagina #tv-cards-grid {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.22s ease-in, transform 0.22s ease-in;
}

/* View Transitions API: navegação contínua fluida da direita para a esquerda */
::view-transition-old(root) {
    animation: 0.28s cubic-bezier(0.4, 0, 1, 1) both tvViewSlideOutLeft;
}
::view-transition-new(root) {
    animation: 0.4s cubic-bezier(0.16, 1, 0.3, 1) both tvViewSlideInRight;
}

@keyframes tvViewSlideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-45px); }
}

@keyframes tvViewSlideInRight {
    from { opacity: 0; transform: translateX(45px); }
    to { opacity: 1; transform: translateX(0); }
}

.tv-card {
    background-color: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 14px;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tv-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

/* Linha superior do card */
.tv-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tv-pill {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tv-pill-red {
    background-color: var(--tv-primary-red);
    color: #FFFFFF;
}

.tv-pill-blue {
    background-color: var(--tv-blue-studio);
    color: #FFFFFF;
}

.tv-pill-green {
    background-color: var(--tv-green-lab);
    color: #FFFFFF;
}

.tv-pill-purple {
    background-color: var(--tv-purple-auditorio);
    color: #FFFFFF;
}

.tv-pill-orange {
    background-color: var(--tv-orange-warning);
    color: #0B0E14;
}

.tv-pill-yellow {
    background-color: var(--tv-yellow-eletivas);
    color: #0B0E14;
}

.tv-pill-gray {
    background-color: #475467;
    color: #FFFFFF;
}

.tv-card-loc {
    font-size: 13px;
    font-weight: 700;
    color: var(--tv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Miolo do card */
.tv-card-content {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
}

.tv-card-disciplina {
    font-size: 20px;
    font-weight: 700;
    color: var(--tv-text-white);
    line-height: 1.25;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tv-card-turma {
    font-size: 14px;
    font-weight: 500;
    color: var(--tv-text-cyan);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-card-prof-horario {
    font-size: 13px;
    font-weight: 400;
    color: var(--tv-text-slate);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mensagem de loading e vazio */
.tv-loading, .tv-empty-msg {
    grid-column: 1 / -1;
    background-color: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 14px;
    padding: 60px 40px;
    text-align: center;
    color: var(--tv-text-muted);
    font-size: 18px;
    font-weight: 500;
}

/* ─── MURAL INSTITUCIONAL & EVENTOS NA TV ─── */
.mural-tv-canvas-wrapper {
    grid-column: 1 / -1;
    width: 100%;
    min-height: calc(100vh - 280px);
    display: flex;
    position: relative;
    box-sizing: border-box;
    padding: 0;
    background: transparent;
}

.mural-tv-canvas {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 280px);
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    background:
        radial-gradient(circle at 10% 10%, rgba(215, 43, 54, 0.14), transparent 45%),
        radial-gradient(circle at 90% 85%, rgba(215, 43, 54, 0.08), transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(145deg, #080B0F 0%, #0D1219 50%, #080A0E 100%);
    background-size: auto, auto, 28px 28px, 28px 28px, auto;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6), 0 16px 48px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    container-type: inline-size;
}

.mural-tv-item {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
}

.mural-tv-item-imagem {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.mural-tv-item img,
.mural-tv-item video {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

.mural-tv-canvas-vazio {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mural-tv-vazio-mensagem {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 20px;
    font-weight: 500;
}

.mural-tv-vazio-icone {
    width: 48px;
    height: 48px;
    stroke: rgba(255, 255, 255, 0.35);
}

/* Conteúdo de texto do mural */
.mural-tv-texto {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--tv-primary-red);
    color: #fff;
    padding: 2.5cqi;
    box-sizing: border-box;
    overflow: hidden;
}

.mural-tv-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 0.5cqi 1.4cqi;
    border-radius: 50px;
    font-size: 1.3cqi;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 1.6cqi;
    text-transform: uppercase;
}

.mural-tv-titulo {
    margin: 0 0 1.2cqi 0;
    font-size: 3.2cqi;
    font-weight: 800;
    line-height: 1.2;
}

.mural-tv-descricao {
    margin: 0 auto;
    font-size: 1.9cqi;
    opacity: 0.9;
    line-height: 1.5;
}

/* ─── RODAPÉ DO TELÃO ─── */
.tv-footer {
    width: 100%;
    height: 52px;
    background-color: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    margin-top: auto;
    flex-shrink: 0;
}

.tv-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 400;
    color: var(--tv-text-muted);
}

.tv-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tv-primary-red);
    flex-shrink: 0;
}

.tv-info-svg {
    display: block;
}

.tv-footer-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.tv-progress-track {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.tv-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--tv-primary-red);
    border-radius: 2px;
    transition: width linear;
}


.tv-institutional {
    font-size: 14px;
    font-weight: 700;
    color: var(--tv-text-white);
    letter-spacing: 0.01em;
}

/* ─── RESPONSIVIDADE PARA TELAS MENORES / NOTEBOOKS ─── */
@media (max-width: 1366px) {
    .tv-container {
        padding: 18px 24px 14px 24px;
        gap: 12px;
    }

    .tv-course-title {
        font-size: 26px;
    }

    .tv-clock {
        font-size: 34px;
    }

    .tv-tabs-bar {
        height: 44px;
        min-height: 44px;
        padding: 0 12px;
        gap: 8px;
    }

    .tv-tab {
        padding: 6px 12px;
        font-size: 12px;
    }

    .tv-cards-grid {
        gap: 12px;
    }

    .tv-card {
        padding: 14px 16px;
        min-height: 130px;
    }

    .tv-pill {
        font-size: 14px;
        padding: 4px 10px;
    }

    .tv-card-disciplina {
        font-size: 16px;
    }

    .tv-footer {
        height: 42px;
        font-size: 12px;
        padding: 0 16px;
    }
}

@media (max-width: 900px) {
    .tv-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .tv-cards-grid {
        grid-template-columns: 1fr;
    }

    .tv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .tv-header-right {
        align-items: flex-start;
        text-align: left;
    }
}

/* ─── SUPORTE A TELÕES ULTRA-HD (QHD 2.5K E 4K UHD NATIVO) ─── */
@media (min-width: 2560px) and (max-width: 3199px) {
    .tv-container {
        max-width: 2560px;
        padding: 52px 80px 40px 80px;
        gap: 28px;
    }

    .tv-brand-tag {
        font-size: 18px;
    }

    .tv-brand-row {
        gap: 20px;
    }

    .tv-logo-box {
        width: 64px;
        height: 64px;
        font-size: 34px;
        border-radius: 14px;
    }

    .tv-course-title {
        font-size: 46px;
    }

    .tv-course-sub {
        font-size: 19px;
        margin-top: 6px;
    }

    .tv-clock {
        font-size: 64px;
    }

    .tv-date {
        font-size: 19px;
        margin-top: 8px;
    }

    .tv-tabs-bar {
        height: 68px;
        min-height: 68px;
        padding: 0 20px;
        gap: 14px;
        border-radius: 14px;
    }

    .tv-tab {
        font-size: 17px;
        padding: 10px 24px;
        border-radius: 10px;
    }

    .tv-cards-grid {
        gap: 32px;
    }

    .tv-card {
        padding: 32px 34px;
        border-radius: 18px;
        min-height: 250px;
    }

    .tv-pill {
        padding: 8px 18px;
        border-radius: 10px;
        font-size: 24px;
    }

    .tv-card-loc {
        font-size: 17px;
    }

    .tv-card-content {
        margin-top: 18px;
    }

    .tv-card-disciplina {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .tv-card-turma {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .tv-card-prof-horario {
        font-size: 17px;
    }

    .tv-footer {
        height: 68px;
        min-height: 68px;
        padding: 0 32px;
        border-radius: 14px;
        font-size: 18px;
    }

    .tv-info-icon {
        font-size: 20px;
    }

    .tv-info-text {
        font-size: 17px;
    }

    .tv-institutional {
        font-size: 18px;
    }

    .tv-dot {
        width: 12px;
        height: 12px;
    }

    .tv-dot.active {
        width: 34px;
        border-radius: 5px;
    }

    .tv-progress-track {
        width: 80px;
        height: 4px;
    }
}

@media (min-width: 3200px) {
    .tv-container {
        max-width: 3840px;
        padding: 72px 100px 52px 100px;
        gap: 40px;
    }

    .tv-brand-tag {
        font-size: 26px;
        letter-spacing: 0.08em;
    }

    .tv-brand-row {
        gap: 24px;
    }

    .tv-header-logo {
        height: 64px;
    }

    .tv-brand-divider {
        height: 38px;
        width: 2px;
    }

    .tv-brand-tag {
        font-size: 24px;
    }

    .tv-course-title {
        font-size: 68px;
    }

    .tv-course-sub {
        font-size: 28px;
        margin-top: 8px;
    }

    .tv-clock {
        font-size: 92px;
    }

    .tv-date {
        font-size: 28px;
        margin-top: 12px;
    }

    .tv-tabs-bar {
        height: 96px;
        min-height: 96px;
        padding: 0 28px;
        gap: 20px;
        border-radius: 18px;
        border-width: 2px;
    }

    .tv-tab {
        font-size: 24px;
        padding: 16px 36px;
        border-radius: 14px;
        letter-spacing: 0.03em;
    }

    .tv-tabs-slider {
        border-radius: 14px;
    }

    .tv-cards-grid {
        gap: 44px;
    }

    .tv-card {
        padding: 44px 48px;
        border-radius: 26px;
        min-height: 360px;
        border-width: 2px;
    }

    .tv-card-header {
        gap: 24px;
    }

    .tv-pill {
        padding: 12px 28px;
        border-radius: 14px;
        font-size: 34px;
    }

    .tv-card-loc {
        font-size: 24px;
    }

    .tv-card-content {
        margin-top: 26px;
    }

    .tv-card-disciplina {
        font-size: 38px;
        line-height: 1.3;
        margin-bottom: 14px;
    }

    .tv-card-turma {
        font-size: 26px;
        margin-bottom: 18px;
    }

    .tv-card-prof-horario {
        font-size: 24px;
    }

    .tv-loading, .tv-empty-msg {
        padding: 120px 80px;
        font-size: 34px;
        border-radius: 26px;
    }

    .tv-footer {
        height: 96px;
        min-height: 96px;
        padding: 0 44px;
        border-radius: 18px;
        border-width: 2px;
    }

    .tv-footer-left {
        gap: 18px;
    }

    .tv-info-icon {
        font-size: 32px;
    }

    .tv-info-text {
        font-size: 24px;
    }

    .tv-footer-right {
        gap: 32px;
    }

    .tv-institutional {
        font-size: 24px;
    }

    .tv-progress-track {
        width: 120px;
        height: 6px;
        border-radius: 3px;
    }

    .mural-tv-canvas-wrapper {
        min-height: calc(100vh - 420px);
    }

    .mural-tv-canvas {
        min-height: calc(100vh - 420px);
        width: 100%;
        border-radius: 24px;
    }

    .mural-tv-vazio-mensagem {
        font-size: 32px;
        gap: 24px;
    }

    .mural-tv-vazio-icone {
        width: 80px;
        height: 80px;
    }
}
