/* Kiosk 模式樣式 — 觸控友善、巨大按鈕、隱藏干擾元素 */

body.kiosk-body {
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

body.kiosk-body::-webkit-scrollbar {
    display: none;
}

/* 根容器：滿版、置中 */
.kiosk-root {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f1e3a 0%, #1a3566 100%);
    color: #fff;
    font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
    overflow: hidden;
}

/* 標題 */
.kiosk-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    padding: 1.5rem 0;
    letter-spacing: 0.2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 主內容區 */
.kiosk-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 2rem;
}

/* 模式選擇：兩顆巨型按鈕 */
.kiosk-mode-selector {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.kiosk-mode-btn {
    min-width: 360px;
    min-height: 240px;
    font-size: 3.5rem;
    font-weight: 700;
    border: 4px solid transparent;
    border-radius: 1.5rem;
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.kiosk-mode-btn:active {
    transform: scale(0.97);
}

.kiosk-mode-btn.entry {
    background: linear-gradient(135deg, #0f8a3e 0%, #13a94a 100%);
}

.kiosk-mode-btn.exit {
    background: linear-gradient(135deg, #a63838 0%, #d44a4a 100%);
}

.kiosk-mode-btn .bi {
    display: block;
    font-size: 5rem;
    margin-bottom: 0.5rem;
}

/* 車牌輸入區 */
.kiosk-plate-area {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.kiosk-plate-display {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 0.5rem;
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.12);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    min-width: 500px;
    min-height: 7rem;
    text-align: center;
    font-family: "Consolas", "Courier New", monospace;
}

.kiosk-plate-display.empty::after {
    content: "請輸入車牌";
    color: rgba(255, 255, 255, 0.4);
    font-size: 2.5rem;
    letter-spacing: normal;
}

/* 虛擬鍵盤 */
.kiosk-keyboard {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.5rem;
    width: 100%;
    max-width: 900px;
}

.kiosk-key {
    min-height: 70px;
    font-size: 2rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.1s;
}

.kiosk-key:active {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0.95);
}

.kiosk-key.wide { grid-column: span 2; }
.kiosk-key.danger { background: rgba(220, 53, 69, 0.4); }
.kiosk-key.primary { background: rgba(25, 135, 84, 0.5); }

/* 動作按鈕 */
.kiosk-action-btn {
    min-width: 320px;
    min-height: 120px;
    font-size: 2.5rem;
    font-weight: 700;
    border: none;
    border-radius: 1rem;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #0f8a3e 0%, #13a94a 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.1s;
}

.kiosk-action-btn:active { transform: scale(0.97); }
.kiosk-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.kiosk-action-btn.reading { background: linear-gradient(135deg, #d44a4a 0%, #e06666 100%); }
.kiosk-action-btn.secondary { background: rgba(255, 255, 255, 0.2); }

/* 即時重量顯示 */
.kiosk-weight {
    font-size: 7rem;
    font-weight: 900;
    font-family: "Consolas", "Courier New", monospace;
    text-align: center;
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.kiosk-weight small { font-size: 3rem; opacity: 0.7; }

/* 狀態橫幅 */
.kiosk-banner {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    min-width: 600px;
    max-width: 90vw;
    padding: 1.5rem 2.5rem;
    border-radius: 0.75rem;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    animation: banner-in 0.25s ease;
}

.kiosk-banner.success { background: #13a94a; color: #fff; }
.kiosk-banner.error { background: #d44a4a; color: #fff; }
.kiosk-banner.info { background: #1d6fdd; color: #fff; }

@keyframes banner-in {
    from { opacity: 0; transform: translate(-50%, -1rem); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 隱藏解鎖觸發區（左下角透明 60x60） */
.kiosk-unlock-trigger {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 60px;
    background: transparent;
    cursor: default;
    z-index: 1040;
}

/* PIN 輸入 Dialog */
.kiosk-unlock-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.kiosk-unlock-dialog {
    background: #1a3566;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    min-width: 420px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.kiosk-unlock-dialog h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
}

.kiosk-unlock-dialog .pin-display {
    font-size: 3rem;
    text-align: center;
    letter-spacing: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    font-family: "Consolas", monospace;
    margin-bottom: 1.5rem;
    min-height: 5rem;
    color: #ffd700;
}

.kiosk-unlock-dialog .pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.kiosk-unlock-dialog .pin-keypad button {
    min-height: 70px;
    font-size: 2rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    cursor: pointer;
}

.kiosk-unlock-dialog .pin-keypad button:active {
    background: rgba(255, 255, 255, 0.35);
}

.kiosk-unlock-dialog .pin-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.kiosk-unlock-dialog .pin-actions button {
    flex: 1;
    min-height: 55px;
    font-size: 1.3rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.kiosk-unlock-dialog .pin-actions .confirm { background: #13a94a; color: #fff; }
.kiosk-unlock-dialog .pin-actions .cancel { background: rgba(255, 255, 255, 0.2); color: #fff; }

.kiosk-unlock-dialog .pin-lockout {
    color: #ffb3b3;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
}

/* Welcome 頁：目前場內車輛面板 */
.kiosk-insite-panel {
    width: 90%;
    max-width: 800px;
    margin-top: 2.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    color: #fff;
}

.kiosk-insite-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffd700;
    text-align: center;
}

.kiosk-insite-empty {
    font-size: 1.5rem;
    text-align: center;
    padding: 1rem;
    opacity: 0.6;
}

.kiosk-insite-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kiosk-insite-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    font-size: 1.4rem;
}

.kiosk-insite-row.stale {
    background: rgba(220, 53, 69, 0.25);
    border-left: 4px solid #ff4d4d;
}

.kiosk-insite-row .plate {
    font-family: "Consolas", "Courier New", monospace;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.15rem;
}

.kiosk-insite-row .weight {
    font-family: "Consolas", "Courier New", monospace;
    text-align: right;
    opacity: 0.85;
}

.kiosk-insite-row .elapsed {
    text-align: right;
    opacity: 0.85;
}

.kiosk-insite-row.stale .elapsed {
    color: #ffb3b3;
    opacity: 1;
    font-weight: 600;
}

.kiosk-insite-more {
    text-align: center;
    padding: 0.5rem;
    font-size: 1.2rem;
    opacity: 0.6;
}

/* 全螢幕退出覆蓋層 */
.kiosk-fullscreen-guard {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    cursor: pointer;
    color: #fff;
    text-align: center;
    animation: banner-in 0.3s ease;
}

.kiosk-fullscreen-guard-inner {
    padding: 3rem;
}

/* 隱藏所有 body.kiosk-body 下的 Blazor 錯誤 UI（司機不應看到） */
body.kiosk-body #blazor-error-ui { display: none !important; }
