/*
 * PAINEL DE AULAS — SENAC ARAPONGAS
 * Autor: Caio Cesar — Instrutor Web Dev
 * Cores: Laranja #F7941D (Pantone 144C) | Azul #004C99 (Pantone 288C)
 */

/* ═══════════════════════════════════════════════════════════════
   VARIÁVEIS DE MARCA SENAC
═══════════════════════════════════════════════════════════════ */
:root {
    --orange:        #F7941D;   /* Pantone 144 C        */
    --orange-light:  #FBC483;   /* Pantone 144 C @ 55%  */
    --blue:          #004C99;   /* Pantone 288 C        */
    --blue-light:    #0066cc;
    --blue-glow:     rgba(0, 76, 153, 0.35);
    --orange-glow:   rgba(247, 148, 30, 0.30);
    --bg:            #030c18;
    --bg-panel:      rgba(4, 18, 40, 0.88);
    --bg-card:       rgba(5, 20, 48, 0.90);
    --border:        rgba(255, 255, 255, 0.06);
    --border-accent: rgba(0, 76, 153, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: #f0f4ff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ═══════════════════════════════════════════════════════════════
   FUNDO DECORATIVO
═══════════════════════════════════════════════════════════════ */
.bg-layer {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 10% 0%,   rgba(247, 148, 30, 0.055) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 100%,  rgba(0, 76, 153, 0.07)    0%, transparent 60%),
        linear-gradient(rgba(0, 76, 153, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 76, 153, 0.025) 1px, transparent 1px);
    background-size: auto, auto, 52px 52px, 52px 52px;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
═══════════════════════════════════════════════════════════════ */
.layout {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    height: 100vh; width: 100vw;
    /* Anti burn-in: pixel shift usa esta propriedade */
    transition: transform 2s ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.header {
    height: 88px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: linear-gradient(180deg, #030c18 0%, rgba(3, 12, 24, 0.96) 100%);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Linha gradiente laranja→azul na base do header */
.header::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg,
        var(--orange) 0%,
        var(--orange-light) 30%,
        var(--blue-light) 70%,
        var(--blue) 100%
    );
}

/* ─── Logo ─── */
.logo-wrap {
    display: flex; align-items: center;
    background: #fff;
    padding: 5px 12px;
    border-radius: 8px; height: 58px;
    box-shadow: 0 0 22px rgba(247, 148, 30, 0.22), 0 0 44px rgba(0, 76, 153, 0.12);
}
.logo-img {
    height: 40px; width: auto; display: block; object-fit: contain;
}
.logo-fallback {
    display: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 900; font-size: 1.55rem;
    letter-spacing: 3px; color: var(--orange); text-transform: uppercase;
}

/* ─── Separador header ─── */
.header-sep {
    width: 1px; height: 44px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin: 0 1.5rem;
}

/* ─── Título do header ─── */
.header-title h1 {
    font-size: 1.3rem; font-weight: 800;
    letter-spacing: 0.08em; text-transform: uppercase; color: #e8f0ff;
}
.header-title h2 {
    font-size: 0.68rem; font-weight: 500;
    letter-spacing: 0.25em; text-transform: uppercase; margin-top: 3px;
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ─── Lado direito do header ─── */
.header-right { display: flex; align-items: center; gap: 1.25rem; }

.sync-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
}
.sync-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #334155; transition: background 0.4s, box-shadow 0.4s;
}
.sync-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    animation: blinkDot 2.5s infinite;
}
.sync-dot.error { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
@keyframes blinkDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.sync-text {
    font-size: 0.63rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: #334155; transition: color 0.4s;
}
.sync-text.online { color: #22c55e; }
.sync-text.error  { color: #ef4444; }

/* ─── Relógio ─── */
.clock-block { text-align: right; }
.clock-time {
    font-size: 3rem; font-weight: 900; line-height: 1;
    letter-spacing: -2px; color: #fff;
    text-shadow: 0 0 36px rgba(0, 76, 153, 0.4);
}
.clock-colon { animation: colonBlink 1s step-end infinite; }
@keyframes colonBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
.clock-date {
    font-size: 0.72rem; font-weight: 500; color: #475569;
    text-align: right; margin-top: 2px; letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════
   GRADE PRINCIPAL
═══════════════════════════════════════════════════════════════ */
.main-board {
    flex: 1;
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem;
    overflow: hidden;
    min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════
   COLUNAS DE TURNO
═══════════════════════════════════════════════════════════════ */
.shift-col {
    flex: 1; display: flex; flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-accent);
    border-radius: 13px; overflow: hidden;
    opacity: 0; transform: translateY(18px);
    animation: colReveal 0.6s ease forwards;
}
@keyframes colReveal { to { opacity: 1; transform: none; } }

.shift-header {
    display: flex; align-items: center; gap: 10px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.shift-icon  { font-size: 1.6rem; line-height: 1; }
.shift-title { font-size: 1.15rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.18em; }
.shift-badge {
    margin-left: auto;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em;
    padding: 2px 9px; border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
    color: #475569; white-space: nowrap;
}

/* Cores por turno */
.col-manha .shift-header { background: linear-gradient(135deg, rgba(247,148,30,0.07) 0%, transparent 70%); border-bottom-color: rgba(247,148,30,0.15); }
.col-manha .shift-title  { color: var(--orange); }
.col-manha .tv-card::before { background: linear-gradient(180deg, var(--orange), var(--orange-light)); }

.col-tarde .shift-header { background: linear-gradient(135deg, rgba(251,191,36,0.06) 0%, transparent 70%); border-bottom-color: rgba(251,191,36,0.12); }
.col-tarde .shift-title  { color: #fbbf24; }
.col-tarde .tv-card::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }

.col-noite .shift-header { background: linear-gradient(135deg, rgba(0,76,153,0.1) 0%, transparent 70%); border-bottom-color: rgba(0,76,153,0.2); }
.col-noite .shift-title  { color: #60a5fa; }
.col-noite .tv-card::before { background: linear-gradient(180deg, var(--blue-light), var(--blue)); }

.shift-body {
    flex: 1; overflow-y: auto;
    padding: 0.7rem;
    display: flex; flex-direction: column; gap: 0.55rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-accent) transparent;
}
.shift-body::-webkit-scrollbar { width: 3px; }
.shift-body::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════════
   CARDS DE AULA
═══════════════════════════════════════════════════════════════ */
.tv-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 0.9rem 0.8rem 1.1rem;
    position: relative; overflow: hidden;
    transition: border-color 0.4s, box-shadow 0.4s, background 0.4s;
}
/* Faixa colorida lateral esquerda */
.tv-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    border-radius: 10px 0 0 10px;
}
.tv-card.live-now {
    background: rgba(34, 197, 94, 0.035);
    border-color: rgba(34, 197, 94, 0.28);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.07);
}
.tv-card.live-now::before {
    background: linear-gradient(180deg, #22c55e, #16a34a) !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.card-title {
    font-size: 0.93rem; font-weight: 700; color: #e8f0ff;
    line-height: 1.3; padding-right: 4.5rem; margin-bottom: 0.25rem;
}
.card-instructor {
    font-size: 0.73rem; font-weight: 500; color: #7aa8e0;
    display: flex; align-items: center; gap: 4px; margin-bottom: 0.55rem;
}
.card-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.4rem;
    background: rgba(0, 12, 32, 0.5);
    border: 1px solid rgba(0, 76, 153, 0.1);
    border-radius: 7px; padding: 0.45rem 0.6rem;
}
.meta-item  { display: flex; flex-direction: column; gap: 1px; }
.meta-item.full { grid-column: 1 / -1; }
.meta-label { font-size: 0.56rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.13em; color: #2d4a6b; }
.meta-value { font-size: 0.74rem; font-weight: 600; color: #94a3b8; }
.dias-pill  {
    display: inline-block; margin-top: 2px;
    background: rgba(0, 76, 153, 0.15);
    border: 1px solid rgba(0, 76, 153, 0.25);
    color: #7aa8e0; font-size: 0.68rem; font-weight: 600;
    padding: 1px 7px; border-radius: 999px;
}

/* Badge "Ao Vivo" */
.live-badge {
    position: absolute; top: 0.65rem; right: 0.65rem;
    background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff;
    font-size: 0.55rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 999px;
    display: flex; align-items: center; gap: 4px;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    animation: glowLive 2s ease-in-out infinite;
}
.live-dot {
    width: 5px; height: 5px; border-radius: 50%; background: #fff;
    animation: scaleDot 1s ease-in-out infinite;
}
@keyframes glowLive { 50% { box-shadow: 0 0 22px rgba(34, 197, 94, 0.85); } }
@keyframes scaleDot { 50% { transform: scale(1.7); opacity: 0.4; } }

/* Estado vazio */
.empty-state {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 7px; padding: 2rem; text-align: center;
}
.empty-icon { font-size: 1.8rem; filter: grayscale(1) brightness(0.35); }
.empty-text { font-size: 0.74rem; font-weight: 600; color: #1e3a5f; letter-spacing: 0.04em; }

/* ═══════════════════════════════════════════════════════════════
   PAINEL SLIDESHOW (barra lateral)
═══════════════════════════════════════════════════════════════ */
.slide-panel {
    width: 295px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-accent);
    border-radius: 13px; overflow: hidden; position: relative;
    opacity: 0; transform: translateX(18px);
    animation: colReveal 0.6s 0.3s ease forwards;
}

.slide-panel-header {
    display: flex; align-items: center; gap: 8px; padding: 0.7rem 0.9rem;
    background: linear-gradient(90deg, rgba(0,76,153,0.18) 0%, rgba(247,148,30,0.08) 100%);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.slide-panel-title {
    font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2em;
    background: linear-gradient(90deg, var(--orange), var(--blue-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.slide-counter { margin-left: auto; font-size: 0.62rem; font-weight: 700; color: #334155; letter-spacing: 0.05em; }

.slide-viewport { flex: 1; position: relative; overflow: hidden; background: #010a18; }
.slide-item     { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.slide-item.active { opacity: 1; z-index: 1; }
.slide-img      { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-item::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(2,10,28,0.65) 68%, rgba(2,10,28,0.95) 100%);
}
.slide-caption  { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; padding: 0.875rem 0.875rem 1rem; }
.slide-caption-title { font-size: 0.85rem; font-weight: 700; color: #f0f4ff; line-height: 1.3; margin-bottom: 2px; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.slide-caption-desc  { font-size: 0.68rem; font-weight: 400; color: #94a3b8; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }

/* Placeholder enquanto aguarda imagens */
.slide-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; }
.ph-icon { font-size: 2.2rem; filter: brightness(0.4); }
.ph-text { font-size: 0.72rem; font-weight: 600; color: #1e3a5f; text-align: center; max-width: 80%; letter-spacing: 0.04em; }

/* Dots de navegação */
.slide-dots {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 7px 0; flex-shrink: 0;
    background: rgba(0, 0, 0, 0.35); border-top: 1px solid var(--border);
}
.dot {
    width: 6px; height: 6px; border-radius: 50%; background: #1e3a5f;
    cursor: pointer; transition: background 0.3s, width 0.3s;
}
.dot.active { background: linear-gradient(90deg, var(--orange), var(--blue-light)); width: 16px; border-radius: 3px; }

/* Barra de progresso do slide */
.slide-progress {
    position: absolute; bottom: 0; left: 0;
    height: 2px; width: 0%;
    background: linear-gradient(90deg, var(--orange), var(--blue-light));
    z-index: 10; transition: width linear;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER — MARQUEE DE AVISOS
═══════════════════════════════════════════════════════════════ */
.footer {
    height: 48px; flex-shrink: 0;
    display: flex; align-items: stretch;
    background: #020b1c;
    border-top: 1px solid var(--border);
    position: relative;
}
.footer::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, var(--orange), var(--blue));
}
.footer-label {
    flex-shrink: 0; display: flex; align-items: center; gap: 7px;
    padding: 0 1.4rem 0 0.875rem;
    background: linear-gradient(135deg, var(--orange) 0%, #d97c00 100%);
    font-size: 0.65rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
    color: #fff; white-space: nowrap;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
    box-shadow: 6px 0 18px rgba(247, 148, 30, 0.3);
}
.footer-marquee-wrap {
    flex: 1; overflow: hidden; position: relative;
    display: flex; align-items: center;
}
.footer-marquee-wrap::before,
.footer-marquee-wrap::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 44px; z-index: 2; pointer-events: none;
}
.footer-marquee-wrap::before { left: 0;  background: linear-gradient(to right, #020b1c, transparent); }
.footer-marquee-wrap::after  { right: 0; background: linear-gradient(to left, #020b1c, transparent); }
.marquee-track { display: inline-block; white-space: nowrap; animation: scrollTicker 45s linear infinite; }
@keyframes scrollTicker { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }
.marquee-track .aviso { font-size: 0.85rem; font-weight: 500; color: #c8d9f0; }
.marquee-track .sep   { color: var(--orange); margin: 0 1.1rem; font-weight: 800; }

/* ═══════════════════════════════════════════════════════════════
   ANTI BURN-IN
   1. Pixel Shift — desloca o layout 1-3 px a cada 3 min (.layout transition acima)
   2. Dimmer suave — overlay escurece 8% por 4 s a cada 20 min
═══════════════════════════════════════════════════════════════ */
#dimmer {
    position: fixed; inset: 0; z-index: 9990;
    pointer-events: none;
    background: #000;
    opacity: 0;
    transition: opacity 3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN OVERLAY — FIREBASE AUTH
═══════════════════════════════════════════════════════════════ */
#login-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 8, 20, 0.97);
    backdrop-filter: blur(6px);
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: 0 0 60px rgba(0, 76, 153, 0.25), 0 0 0 1px rgba(247, 148, 30, 0.08);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo img {
    height: 52px;
    margin-bottom: 14px;
    filter: brightness(1.1);
}
.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.login-logo p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
}

.login-field {
    margin-bottom: 18px;
}
.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 7px;
}
.login-field input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-field input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glow);
}
.login-field input::placeholder {
    color: rgba(255,255,255,0.20);
}

.login-error {
    display: none;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.40);
    color: #ff7b86;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

#login-btn {
    width: 100%;
    background: var(--orange);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 13px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
#login-btn:hover:not(:disabled) {
    background: #e8830a;
    box-shadow: 0 0 18px var(--orange-glow);
}
#login-btn:active:not(:disabled) {
    transform: scale(0.98);
}
#login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
