/* ============================================================
   painel-chamadas.css — painel da sala de espera
   Tela de exibição em TV: tipografia grande, fundo escuro e
   nenhuma navegação. É a única tela do sistema que foge do
   layout padrão, e isso é proposital.
   ============================================================ */
/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a4e 40%, #24243e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
}

/* ==========================================
   TOP BAR
   ========================================== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.topbar-unidade {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.topbar-right {
    text-align: right;
}

.topbar-clock {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

.topbar-date {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* ==========================================
   MAIN LAYOUT
   ========================================== */
.painel-main {
    display: grid;
    grid-template-columns: 70% 30%;
    height: calc(100vh - 90px);
}

/* ==========================================
   LEFT: CURRENT CALL
   ========================================== */
.painel-current {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.call-card {
    text-align: center;
    width: 100%;
    max-width: 900px;
}

.call-empty {
    color: rgba(255, 255, 255, 0.3);
}

.call-empty i {
    font-size: 5rem;
    display: block;
    margin-bottom: 20px;
    opacity: 0.4;
}

.call-empty p {
    font-size: 1.6rem;
    font-weight: 500;
}

.call-bell {
    font-size: 3rem;
    color: #facc15;
    margin-bottom: 16px;
    display: inline-block;
}

.call-bell.ringing {
    animation: ring 0.6s ease-in-out 3;
}

@keyframes ring {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-15deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

.call-paciente {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    word-break: break-word;
}

.call-consultorio {
    font-size: 2.2rem;
    font-weight: 700;
    color: #818cf8;
    margin-bottom: 12px;
}

.call-profissional {
    font-size: 1.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

/* Animation for new call */
.call-card.animate-in {
    animation: fadeSlideUp 0.8s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse glow */
.call-card.pulse {
    animation: pulseGlow 2s ease-in-out 2;
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 0px transparent); }
    50% { filter: drop-shadow(0 0 40px rgba(129, 140, 248, 0.4)); }
}

/* ==========================================
   RIGHT: RECENT CALLS
   ========================================== */
.painel-recent {
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 24px;
    overflow-y: auto;
}

.recent-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px 20px;
    border-left: 4px solid rgba(129, 140, 248, 0.5);
    transition: background 0.3s;
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.recent-item-nome {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
}

.recent-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.recent-item-consultorio {
    font-size: 0.85rem;
    color: #818cf8;
    font-weight: 500;
}

.recent-item-hora {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.recent-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    padding: 40px 16px;
}

.recent-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ==========================================
   VIDEO PLACEHOLDER (commented out for now)
   ========================================== */
/*
.video-area {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 300px;
    height: 170px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
}
*/

/* ==========================================
   RESPONSIVE (smaller screens / projectors)
   ========================================== */
@media (max-width: 1024px) {
    .painel-main {
        grid-template-columns: 1fr;
        grid-template-rows: 60% 40%;
    }

    .call-paciente { font-size: 3rem; }
    .call-consultorio { font-size: 1.6rem; }
    .call-profissional { font-size: 1.2rem; }
    .topbar-clock { font-size: 1.6rem; }
}

@keyframes pulseBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Botão de liberar o som — o navegador exige um clique do usuário. */
.painel-audio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: #fbbf24;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.painel-audio:hover { background: #f59e0b; }
