/* Resets Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0f172a; /* Slate 900 */
    color: #f8fafc; /* Slate 50 */
    line-height: 1.6;
}

/* ================== ESTILOS DA TV ================== */
body.modo-tv {
    overflow: hidden; /* Remove barras de rolagem */
    cursor: none; /* Esconde o ponteiro do mouse */
    background-color: #000;
}

.conteiner-tv {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #000;
}

.midia-tv {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Garante que a mídia não distorça */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    position: absolute;
}

.midia-tv.ativa {
    opacity: 1;
}

/* ================== ESTILOS DO ADMIN ================== */
.conteiner-admin {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155; /* Slate 700 */
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #38bdf8; /* Sky 400 */
}

.cabecalho-usuario {
    font-size: 0.9rem;
    color: #94a3b8; /* Slate 400 */
}

.cartao {
    background-color: #1e293b; /* Slate 800 */
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.cartao h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #e2e8f0; /* Slate 200 */
}

/* Formulários */
.grupo-formulario {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #cbd5e1; /* Slate 300 */
}

input[type="text"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #475569; /* Slate 600 */
    background-color: #0f172a; /* Slate 900 */
    color: #f8fafc; /* Slate 50 */
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px #38bdf8;
}

.botao {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #0ea5e9; /* Sky 500 */
    color: white;
    font-weight: 600;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.botao:hover {
    background-color: #0284c7; /* Sky 600 */
}

.botao.perigo {
    background-color: #ef4444; /* Red 500 */
}

.botao.perigo:hover {
    background-color: #dc2626; /* Red 600 */
}

.botao.secundario {
    background-color: #475569; /* Slate 600 */
}

.botao.secundario:hover {
    background-color: #334155; /* Slate 700 */
}

/* Tabela de Conteúdos */
.tabela-conteudos {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tabela-conteudos th,
.tabela-conteudos td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.tabela-conteudos th {
    font-weight: 600;
    color: #94a3b8;
    background-color: #0f172a;
}

.tabela-conteudos tr:hover {
    background-color: #1a2234; /* Um pouco mais claro que o Slate 800 ao passar o mouse */
}

.miniatura {
    max-width: 100px;
    max-height: 60px;
    border-radius: 0.25rem;
    object-fit: cover;
}

.acoes {
    display: flex;
    gap: 0.5rem;
}

.status {
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.ativo {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80; /* Green 400 */
}

.status.inativo {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171; /* Red 400 */
}

/* ================== LAYOUTS DA TV ================== */
/* Elementos globais dos widgets */
.barra-superior, .barra-lateral {
    display: none; /* Escondido no Modelo 0 */
    background-color: #1e293b;
    color: white;
    z-index: 10;
}

.logo-instituicao {
    font-weight: 900;
    font-size: 1.5rem;
    color: #38bdf8;
    padding: 1rem;
    text-align: center;
}

.texto-rolagem {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
}

.texto-rolagem span {
    display: inline-block;
    padding-left: 100%;
    animation: rolagem-marquee 20s linear infinite;
}

@keyframes rolagem-marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

.widget-relogio, .widget-clima, .widget-avisos {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #334155;
}

.widget-relogio { font-size: 2rem; font-weight: bold; }
.widget-clima { font-size: 1.5rem; color: #fbbf24; }

/* MODELO 0: Tela Cheia */
body.modelo-0 .conteiner-tv {
    width: 100vw; height: 100vh;
}

/* MODELO 1: Barra Superior Horizontal */
body.modelo-1 {
    display: flex;
    flex-direction: column;
    height: 100vh;
}
body.modelo-1 .barra-superior {
    display: flex;
    height: 80px;
    border-bottom: 4px solid #38bdf8;
}
body.modelo-1 .logo-instituicao { width: 250px; border-left: 2px solid #334155; }
body.modelo-1 .conteiner-tv { flex: 1; position: relative; }

/* MODELO 2: Barra Lateral Direita */
body.modelo-2 {
    display: flex;
    flex-direction: row;
    height: 100vh;
}
body.modelo-2 .barra-lateral {
    display: flex;
    flex-direction: column;
    width: 350px;
    height: 100vh;
    border-left: 4px solid #38bdf8;
}
body.modelo-2 .conteiner-tv { flex: 1; position: relative; }