/* =========================================================
   شاشەی ئیستعلاماتی زیندوو — ستایل
   Live Queue Display Screen (TV-optimized, RTL)
   ========================================================= */

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

:root {
    --dp-header-h: 96px;
    --dp-footer-h: 68px;
    --dp-radius: 20px;
}

body.theme-dark {
    --bg: #060b16;
    --bg-grad-1: #0b1220;
    --bg-grad-2: #0f1b2e;
    --card: rgba(255, 255, 255, .05);
    --card-border: rgba(255, 255, 255, .1);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --header-bg: rgba(255, 255, 255, .04);
    --next-bg: rgba(255, 255, 255, .04);
}

body.theme-light {
    --bg: #eef2f7;
    --bg-grad-1: #f8fafc;
    --bg-grad-2: #e2e8f0;
    --card: #ffffff;
    --card-border: #d7dfe9;
    --text: #0f172a;
    --muted: #64748b;
    --header-bg: #ffffff;
    --next-bg: #f1f5f9;
}

html, body { height: 100%; overflow: hidden; }

@font-face{font-family:'NRT Bold';src:url('../fonts/NRT-Bd.ttf') format('truetype');font-weight:bold;font-style:normal;font-display:swap;}
:root{--font-main:'NRT Bold','Noto Sans Arabic','Segoe UI',Tahoma,sans-serif;}

body {
    font-family: var(--font-main);
    background: radial-gradient(1200px 700px at 85% -10%, var(--bg-grad-2), var(--bg-grad-1) 45%, var(--bg) 100%);
    color: var(--text);
    display: flex;
    flex-direction: column;
}
body,body *,input,textarea,select,button,table,.form-control,.form-select,.btn,.modal,.dropdown-menu{font-family:var(--font-main);} 

/* ---------------- Header ---------------- */
.dp-header {
    height: var(--dp-header-h);
    flex: 0 0 var(--dp-header-h);
    background: var(--header-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(16px, 2vw, 40px);
    backdrop-filter: blur(12px);
}

.dp-brand { display: flex; align-items: center; gap: 18px; }
.dp-logo { height: 62px; width: 62px; object-fit: cover; border-radius: 16px; }
.dp-logo-icon {
    height: 62px; width: 62px; border-radius: 16px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; color: #fff;
}
.dp-brand h1 { font-size: clamp(1.2rem, 2vw, 2rem); font-weight: 900; line-height: 1.15; }
.dp-brand span { color: var(--muted); font-size: clamp(.8rem, 1vw, 1.05rem); }
.dp-credit { color: var(--muted); font-size: clamp(.72rem, .95vw, 1rem); margin-top: 6px; }

.dp-clock { text-align: left; }
.dp-time {
    font-size: clamp(1.6rem, 3vw, 3rem); font-weight: 900; line-height: 1;
    font-variant-numeric: tabular-nums; letter-spacing: .02em;
    background: linear-gradient(135deg, #22d3ee, #0d9488);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dp-date { color: var(--muted); font-size: clamp(.8rem, 1.1vw, 1.1rem); }
.dp-day { color: var(--muted); font-size: clamp(.75rem, 1vw, 1rem); opacity: .85; }

/* ---------------- Grid ---------------- */
.dp-main { flex: 1; min-height: 0; padding: clamp(10px, 1.4vh, 24px) clamp(14px, 2vw, 34px); }

.dp-grid {
    height: 100%;
    display: grid;
    gap: clamp(12px, 1.4vw, 22px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: stretch;
}
body[data-columns="1"] .dp-grid { grid-template-columns: minmax(0, 1fr); }
body[data-columns="2"] .dp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-columns="4"] .dp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.dp-loading {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    font-size: 1.4rem; color: var(--muted);
}

/* ---------------- Doctor card ---------------- */
.dp-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-top: 6px solid var(--accent, #0d9488);
    border-radius: var(--dp-radius);
    padding: clamp(12px, 1.5vh, 22px) clamp(14px, 1.4vw, 22px);
    display: flex; flex-direction: column; min-height: 0; min-width: 0;
    position: relative; overflow: hidden;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
    transition: transform .3s ease, box-shadow .3s ease;
}

.dp-card::before {
    content: ''; position: absolute; inset-inline-end: -60px; top: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: var(--accent, #0d9488); opacity: .1;
}

.dp-card.is-calling {
    animation: dpCardPulse 1.1s ease-in-out 6;
    box-shadow: 0 0 0 4px var(--accent, #0d9488), 0 18px 44px rgba(0, 0, 0, .32);
}
@keyframes dpCardPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.018); }
}

.dp-card-head {
    display: flex; align-items: flex-start; gap: 12px;
    padding-bottom: clamp(8px, 1vh, 14px);
    border-bottom: 1px solid var(--card-border);
    margin-bottom: clamp(10px, 1.4vh, 18px);
    position: relative; z-index: 1;
}
.dp-doctor-name {
    font-size: clamp(1rem, 1.5vw, 1.55rem); font-weight: 900; line-height: 1.25;
}
.dp-doctor-specialty { color: var(--muted); font-size: clamp(.72rem, .95vw, .98rem); }
.dp-room {
    margin-inline-start: auto; flex-shrink: 0;
    background: var(--accent, #0d9488); color: #fff;
    padding: 6px 13px; border-radius: 12px;
    font-weight: 800; font-size: clamp(.72rem, .95vw, .96rem);
    white-space: nowrap;
}

/* Current patient */
.dp-current { text-align: center; margin-bottom: clamp(8px, 1.2vh, 16px); position: relative; z-index: 1; flex-shrink: 0; }
.dp-current-label {
    color: var(--muted); font-size: clamp(.7rem, .9vw, .92rem);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px;
}
.dp-current-number {
    font-size: clamp(2.6rem, min(6vw, 11vh), 6.2rem); font-weight: 900; line-height: .95;
    font-variant-numeric: tabular-nums;
    color: var(--accent, #0d9488);
    text-shadow: 0 6px 26px color-mix(in srgb, var(--accent, #0d9488) 45%, transparent);
}
.dp-current-name {
    font-size: clamp(.95rem, 1.5vw, 1.6rem); font-weight: 800; margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dp-current-empty { color: var(--muted); font-size: clamp(.9rem, 1.2vw, 1.2rem); padding: clamp(18px, 3vh, 42px) 0; }

/* Next patients */
.dp-next-title {
    color: var(--muted); font-size: clamp(.7rem, .9vw, .9rem); font-weight: 700;
    margin-bottom: 8px; display: flex; align-items: center; gap: 7px;
    flex-shrink: 0;
}
/* لیستی نۆرەکانی داهاتوو: هەرگیز نابێت لە کارت بەدەر بچێت */
.dp-next-list {
    display: flex; flex-direction: column; gap: 7px;
    overflow: hidden; flex: 1 1 auto; min-height: 0;
    position: relative; z-index: 1;
    mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 14px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 14px), transparent 100%);
}
.dp-next-item {
    background: var(--next-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: clamp(7px, .9vh, 12px) clamp(10px, 1vw, 15px);
    display: flex; align-items: center; gap: 11px;
    flex-shrink: 0;
}
.dp-next-num {
    background: var(--accent, #0d9488); color: #fff;
    min-width: 38px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: clamp(.85rem, 1.1vw, 1.1rem);
    font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.dp-next-name {
    flex: 1; min-width: 0; font-weight: 600; font-size: clamp(.8rem, 1.05vw, 1.05rem);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dp-next-time { color: var(--muted); font-size: clamp(.7rem, .9vw, .9rem); flex-shrink: 0; }
.dp-next-item.is-skipped { opacity: .6; }
.dp-next-item.is-skipped .dp-next-num { background: #64748b; }
.dp-next-empty { color: var(--muted); text-align: center; padding: 14px 0; font-size: clamp(.78rem, 1vw, 1rem); }

/* Footer stats inside card */
.dp-card-stats {
    display: flex; gap: 8px; margin-top: clamp(8px, 1.1vh, 14px);
    padding-top: clamp(7px, .9vh, 12px); border-top: 1px solid var(--card-border);
    position: relative; z-index: 1;
    flex-shrink: 0; margin-top: auto;
}
.dp-stat {
    flex: 1; text-align: center;
    background: var(--next-bg); border-radius: 10px; padding: 6px 4px;
}
.dp-stat b { display: block; font-size: clamp(.9rem, 1.2vw, 1.25rem); font-weight: 900; line-height: 1.1; }
.dp-stat span { color: var(--muted); font-size: clamp(.62rem, .8vw, .8rem); }

/* ---------------- Callout overlay ---------------- */
.dp-callout {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(4, 8, 16, .93);
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.dp-callout.show { display: flex; animation: dpFadeIn .35s ease; }
@keyframes dpFadeIn { from { opacity: 0; } to { opacity: 1; } }

.dp-callout-inner {
    text-align: center; padding: clamp(24px, 5vh, 60px) clamp(32px, 6vw, 90px);
    border-radius: 30px;
    border: 3px solid var(--callout-color, #0d9488);
    background: rgba(255, 255, 255, .04);
    animation: dpCalloutIn .45s cubic-bezier(.2, .9, .3, 1.3);
    max-width: 92vw;
}
@keyframes dpCalloutIn {
    from { transform: scale(.75); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.dp-callout-label {
    color: #94a3b8; font-size: clamp(.9rem, 1.5vw, 1.5rem); letter-spacing: .12em;
    text-transform: uppercase; margin-bottom: 10px;
}
.dp-callout-number {
    font-size: clamp(6rem, 18vw, 17rem); font-weight: 900; line-height: .9;
    color: var(--callout-color, #0d9488); font-variant-numeric: tabular-nums;
    text-shadow: 0 0 70px color-mix(in srgb, var(--callout-color, #0d9488) 60%, transparent);
    animation: dpNumberPop 1s ease-in-out infinite alternate;
}
@keyframes dpNumberPop { from { transform: scale(1); } to { transform: scale(1.04); } }
.dp-callout-name { font-size: clamp(1.6rem, 4vw, 4rem); font-weight: 900; color: #f1f5f9; margin-top: 8px; }
.dp-callout-doctor { font-size: clamp(1rem, 2vw, 2rem); color: #cbd5e1; margin-top: 12px; }
.dp-callout-room {
    display: inline-block; margin-top: 18px;
    background: var(--callout-color, #0d9488); color: #fff;
    padding: 10px 28px; border-radius: 16px;
    font-size: clamp(1rem, 2vw, 2rem); font-weight: 900;
}

/* ---------------- Footer ticker ---------------- */
.dp-footer {
    height: var(--dp-footer-h); flex: 0 0 var(--dp-footer-h);
    background: var(--header-bg); border-top: 1px solid var(--card-border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 clamp(14px, 2vw, 30px);
    backdrop-filter: blur(12px);
}
.dp-ticker-label {
    background: linear-gradient(135deg, #e11d48, #be123c); color: #fff;
    padding: 8px 16px; border-radius: 11px; font-weight: 800; flex-shrink: 0;
    font-size: clamp(.75rem, 1vw, .98rem); white-space: nowrap;
}
.dp-ticker { flex: 1; overflow: hidden; min-width: 0; position: relative; }
.dp-ticker-track {
    display: inline-block; white-space: nowrap;
    font-size: clamp(.9rem, 1.3vw, 1.3rem); font-weight: 600;
    animation: dpTicker linear infinite;
    animation-duration: var(--ticker-duration, 40s);
    padding-inline-start: 100%;
}
@keyframes dpTicker {
    from { transform: translateX(0); }
    to { transform: translateX(200%); }
}
.dp-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: clamp(.7rem, .9vw, .9rem); flex-shrink: 0; }
.dp-dot { width: 11px; height: 11px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 12px #22c55e; }
.dp-dot.off { background: #ef4444; box-shadow: 0 0 12px #ef4444; }

/* ---------------- Buttons ---------------- */
.dp-fullscreen, .dp-soundbtn {
    position: fixed; bottom: calc(var(--dp-footer-h) + 16px); z-index: 8000;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255, 255, 255, .1); border: 1px solid var(--card-border);
    color: var(--text); cursor: pointer; font-size: 1.05rem;
    opacity: .3; transition: opacity .25s;
}
.dp-fullscreen { inset-inline-start: 16px; }
.dp-soundbtn { inset-inline-start: 74px; }
.dp-fullscreen:hover, .dp-soundbtn:hover { opacity: 1; }
.dp-soundbtn.active { background: #0d9488; color: #fff; opacity: .85; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1200px) {
    .dp-grid, body[data-columns="4"] .dp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    :root { --dp-header-h: 76px; --dp-footer-h: 58px; }
    .dp-grid, body[data-columns="2"] .dp-grid, body[data-columns="3"] .dp-grid, body[data-columns="4"] .dp-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .dp-main { overflow-y: auto; }
    html, body { overflow: auto; }
    .dp-ticker-label { display: none; }
}
