/* ═══════════════════════════════════════════════════════════════════════
   WB-Turnos · Display CSS  —  sala de espera pública
   ═══════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800;900&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
    --bg:        #e8edf5;
    --surface:   #ffffff;
    --surface2:  #dde4ef;
    --border:    rgba(0,0,0,.09);
    --text:      #0f172a;
    --text-muted:#4a6483;
    --blue:      #1d4ed8;
    --blue-dim:  rgba(29,78,216,.07);
    --green:     #047857;
    --green-dim: rgba(4,120,87,.07);
    --shadow:    0 4px 24px rgba(0,0,0,.10);
    --radius:    1.25rem;
    --header-h:  88px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.dp-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background: linear-gradient(90deg, #0d1f36 0%, #0a1828 100%);
    border-bottom: 2px solid rgba(0,0,0,.15);
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.dp-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 900;
    letter-spacing: .06em;
    font-size: 2rem;
}
.dp-brand-wb     { color: #60a5fa; }
.dp-brand-sep    {
    width: 3px; height: 2rem;
    background: linear-gradient(180deg,#60a5fa,#a78bfa);
    border-radius: 4px;
}
.dp-brand-turnos { color: #a78bfa; }

.dp-datetime { text-align: right; }
.dp-clock {
    font-size: 2.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #f0f6ff;
}
.dp-date {
    font-size: .95rem;
    color: #93b4d4;
    font-weight: 400;
    text-transform: capitalize;
    margin-top: .15rem;
}

/* ── Main layout ────────────────────────────────────────────────────────── */
.dp-main {
    display: flex;
    height: calc(100vh - var(--header-h));
    gap: 0;
    overflow: hidden;
}

.dp-divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
    margin: 1.5rem 0;
}

/* ── Panels ─────────────────────────────────────────────────────────────── */
.dp-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
    gap: .75rem;
}
.dp-panel--left  { flex: 1.1; }
.dp-panel--right { flex: .9;  }

/* Panel header */
.dp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.4rem;
    border-radius: var(--radius);
    flex-shrink: 0;
}
.dp-panel-header--blue  { background: rgba(29,78,216,.08);  border: 1px solid rgba(29,78,216,.25); }
.dp-panel-header--green { background: rgba(4,120,87,.08); border: 1px solid rgba(4,120,87,.25); }

.dp-panel-title-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.dp-panel-icon  { font-size: 1.4rem; }
.dp-panel-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.dp-panel-header--blue  .dp-panel-title { color: #1d4ed8; }
.dp-panel-header--green .dp-panel-title { color: #047857; }

.dp-count {
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
}
.dp-count--blue  { background: rgba(29,78,216,.15);  color: #1d4ed8; }
.dp-count--green { background: rgba(4,120,87,.15); color: #047857; }

/* Panel body: scrollable list */
.dp-panel-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-right: .25rem;
}
.dp-panel-body::-webkit-scrollbar { width: 4px; }
.dp-panel-body::-webkit-scrollbar-track { background: transparent; }
.dp-panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Featured card (primer elemento En Atención) ────────────────────────── */
.dp-featured {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    border-left: 6px solid var(--ac, var(--blue));
    box-shadow: 0 2px 16px rgba(0,0,0,.09);
    flex-shrink: 0;
    animation: slideDown .35s cubic-bezier(.4,0,.2,1);
}
.dp-featured-top {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.dp-featured-area-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .5rem;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.dp-featured-area-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.dp-featured-time {
    font-size: .95rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.dp-featured-number {
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .02em;
    margin-bottom: .5rem;
}
.dp-featured-opcion {
    font-size: .95rem;
    color: var(--text-muted);
    background: rgba(0,0,0,.05);
    display: inline-block;
    padding: .3rem .8rem;
    border-radius: 100px;
}

/* ── Row item ───────────────────────────────────────────────────────────── */
.dp-row {
    display: grid;
    grid-template-columns: 10px 5.5rem 1fr auto auto;
    align-items: center;
    gap: .6rem 1rem;
    padding: .85rem 1.2rem;
    background: var(--surface);
    border-radius: .9rem;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    transition: background .15s;
    animation: slideDown .3s cubic-bezier(.4,0,.2,1);
}
.dp-row--llamado { border-left: 3px solid var(--ac, var(--blue)); }
.dp-row--atendido{ border-left: 3px solid var(--ac, var(--green)); opacity: .85; }

.dp-row-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dp-row-num  {
    font-size: 1.8rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dp-row-area {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dp-row-opcion {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0,0,0,.06);
    padding: .2rem .6rem;
    border-radius: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.dp-row-time {
    font-size: .9rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.dp-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 3rem;
    opacity: .6;
}
.dp-empty-icon { font-size: 2.5rem; }

/* ══════════════════════════════════════════════════════════════════════════
   MODAL DE LLAMADA
   ══════════════════════════════════════════════════════════════════════════ */
.dp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,13,24,.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}
.dp-modal-overlay--enter { animation: overlayIn  .3s ease forwards; }
.dp-modal-overlay--exit  { animation: overlayOut .4s ease forwards; }

@keyframes overlayIn  { from { opacity:0 } to { opacity:1 } }
@keyframes overlayOut { from { opacity:1 } to { opacity:0 } }

.dp-modal-card {
    width: min(700px, 90vw);
    background: #0d1f35;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(var(--mc-rgb,.59,.130,.246),.3),
        0 40px 80px rgba(0,0,0,.6),
        0 0 120px rgba(var(--mc-rgb,.59,.130,.246),.2);
    display: flex;
    flex-direction: column;
}
.dp-modal-overlay--enter .dp-modal-card {
    animation: cardIn .35s cubic-bezier(.34,1.56,.64,1) forwards;
}
.dp-modal-overlay--exit  .dp-modal-card {
    animation: cardOut .35s ease forwards;
}
@keyframes cardIn  { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cardOut { from { transform: scale(1);   opacity: 1; } to { transform: scale(1.06); opacity: 0; } }

/* Franja de color en el tope */
.dp-modal-stripe {
    height: 8px;
    background: linear-gradient(90deg, var(--mc, var(--blue)), transparent 70%);
}

.dp-modal-inner {
    padding: 2.5rem 3.5rem 2rem;
    text-align: center;
}

.dp-modal-label {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .2em;
    color: #93b4d4;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.dp-modal-number {
    font-size: clamp(5rem, 14vw, 10rem);
    font-weight: 900;
    line-height: 1;
    color: var(--mc, var(--blue));
    text-shadow:
        0 0 40px rgba(var(--mc-rgb,.59,.130,.246),.6),
        0 4px 20px rgba(0,0,0,.4);
    margin-bottom: 1.25rem;
    letter-spacing: .03em;
    animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { text-shadow: 0 0 40px rgba(var(--mc-rgb,.59,.130,.246),.5), 0 4px 20px rgba(0,0,0,.4); }
    50%       { text-shadow: 0 0 80px rgba(var(--mc-rgb,.59,.130,.246),.9), 0 4px 20px rgba(0,0,0,.4); }
}

.dp-modal-area {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.7rem;
    font-weight: 700;
    color: #f0f6ff;
    margin-bottom: .75rem;
}
.dp-modal-area-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dp-modal-opcion {
    font-size: 1.1rem;
    color: #93b4d4;
    background: rgba(255,255,255,.07);
    display: inline-block;
    padding: .4rem 1.2rem;
    border-radius: 100px;
}

.dp-modal-ubicacion {
    margin-top: .75rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    letter-spacing: .02em;
}

.dp-modal-ubicacion-icon {
    font-size: 1rem;
}

/* Barra de progreso */
.dp-modal-progress {
    height: 4px;
    background: rgba(255,255,255,.08);
}
.dp-modal-progress-bar { height: 100%; width: 0; }
.dp-modal-progress-bar--running {
    animation: progressBar 5s linear forwards;
    background: linear-gradient(90deg, var(--mc, var(--blue)), transparent);
}
@keyframes progressBar { from { width: 0 } to { width: 100% } }

/* ── Reconectando ───────────────────────────────────────────────────────── */
.dp-reconnecting {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(234,179,8,.15);
    border: 1px solid rgba(234,179,8,.4);
    color: #fde68a;
    padding: .6rem 1.2rem;
    border-radius: 100px;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    z-index: 8000;
}
.dp-reconnecting-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fde68a;
    animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Animaciones de entrada ─────────────────────────────────────────────── */
@keyframes slideDown {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ── Error Blazor ───────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: rgba(239,68,68,.95);
    border-radius: 8px;
    bottom: 2rem; right: 2rem;
    padding: 1rem 2rem;
    position: fixed;
    display: none;
    z-index: 9999;
    color: white;
    font-size: 1rem;
    box-shadow: var(--shadow);
}
#blazor-error-ui.blazor-error-boundary { display: block; }
