/* =====================================================================
   assets/css/kiosk.css
   Giao diện Kiosk - full màn hình, tối ưu cho màn hình cảm ứng.
   Màu thương hiệu: đỏ đô (--brand) dùng cho header/khung/nút hành động.
   Mỗi nút LĨNH VỰC dùng màu riêng lấy từ cột departments.color trong DB
   (đúng yêu cầu "Mỗi nút có màu riêng" để khách quét mắt chọn nhanh) -
   màu riêng này KHÔNG thay thế màu thương hiệu, mà là lớp phân biệt chức
   năng nằm trên nền giao diện đỏ đô.
   ===================================================================== */

:root {
    --brand: #7A1E2B;
    --brand-dark: #551520;
    --accent-gold: #A6791F;
    --bg: #F5F2EC;
    --text: #2A2A2A;
    --text-muted: #7A7570;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    /* Chặn zoom/scroll do vuốt nhầm trên màn hình cảm ứng công cộng */
    overscroll-behavior: none;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.kiosk-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.kiosk-header {
    background: var(--brand);
    color: #fff;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.kiosk-header .org {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kiosk-header .org img {
    height: 52px;
    width: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}

.kiosk-header .org-name { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.kiosk-header .org-subtitle { font-size: 14px; opacity: 0.9; margin-top: 2px; }

.kiosk-header .clock { text-align: right; }
.kiosk-header .clock .time { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kiosk-header .clock .date { font-size: 13px; opacity: 0.9; text-transform: capitalize; }

/* ---- Màn hình chọn lĩnh vực ---- */
.department-screen {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.department-screen h1 {
    text-align: center;
    font-size: 26px;
    color: var(--brand-dark);
    margin: 0 0 32px;
}

.department-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-content: center;
}

.department-btn {
    border: none;
    border-radius: 20px;
    padding: 36px 20px;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 24px rgba(0,0,0,0.12);
    transition: transform 0.08s ease;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

.department-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.12);
}

/* ---- Màn hình kết quả (sau khi lấy số) ---- */
.result-screen {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.result-screen.active { display: flex; }
.department-screen.hidden { display: none; }

.result-screen .label { font-size: 18px; color: var(--text-muted); }
.result-screen .ticket-no {
    font-size: 110px;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1;
    margin: 12px 0;
}
.result-screen .dept-name { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.result-screen .waiting-info { font-size: 16px; color: var(--text-muted); margin-bottom: 20px; }
.result-screen .note {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 12px; padding: 12px 20px;
    color: var(--text-muted); font-size: 14px;
}
.result-screen .countdown { margin-top: 24px; font-size: 13px; color: #B0AAA2; }

/* ---- Overlay lỗi ---- */
.error-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #B3261E; color: #fff; padding: 14px 24px; border-radius: 10px;
    font-size: 15px; display: none; box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.error-toast.show { display: block; }

#print-frame { display: none; }
