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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}
.screen.active {
    display: flex;
}

/* Login/Interact Screen */
#login-container, #interact-screen {
    justify-content: center;
    align-items: center;
    background: #000;
}

.login-box, .interact-box {
    background: #1e1e1e;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    position: relative;
    z-index: 10;
}

.login-box h1 { margin-bottom: 5px; color: #4db8ff; }
.login-box p { margin-bottom: 20px; color: #aaa; font-size: 14px; }
.login-box input, .login-box select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #333;
    background: #2d2d2d;
    color: #fff;
    border-radius: 6px;
    font-size: 16px;
}
.login-box input:focus, .login-box select:focus {
    outline: none;
    border-color: #4db8ff;
}
.login-box button {
    width: 100%;
    padding: 14px;
    background: #4db8ff;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
.login-box button:active { background: #3a9bdc; }
.error { color: #ff6b6b; font-size: 14px; margin-top: 10px; min-height: 20px; }

/* Interact box specific */
.interact-box { cursor: pointer; background: #1a2a3a; border: 2px solid #4db8ff; }
.interact-box h1 { color: #4db8ff; font-size: 24px; margin-top: 15px;}
.interact-box p { color: #ccc; margin-top: 10px; }

/* Pulse animation for touch prompt */
.pulse-ring {
    width: 60px; height: 60px;
    background: rgba(77, 184, 255, 0.4);
    border-radius: 50%;
    margin: 0 auto;
    animation: pulse 1.5s infinite ease-out;
}
@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Main Board Screen */
#board-screen {
    display: none; 
    flex-direction: column;
}
#board-screen.active {
    display: flex;
}

.board-header {
    background: #1e1e1e;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    height: 70px;
}
.board-header h2 {
    font-size: 24px;
    color: #4db8ff;
    margin: 0;
}
.header-actions {
    display: flex;
    align-items: center;
}
.btn-logout {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.btn-logout:hover {
    background: #444;
}

.board-body {
    flex: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: min-content;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 24px;
    color: #555;
    margin-top: 20vh;
}

/* Ticket Card */
.ticket {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    max-height: 80vh;
}
.ticket.flash-new {
    animation: flashTicket 3s ease-in-out;
}
@keyframes flashTicket {
    0%, 20%, 40%, 60%, 80% { transform: scale(1.02); border-color: #ff6b6b; box-shadow: 0 0 15px rgba(255,107,107,0.5); }
    10%, 30%, 50%, 70%, 90% { transform: scale(1); border-color: #333; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
    100% { transform: scale(1); }
}

.ticket-header {
    padding: 12px 15px;
    background: #2a2a2a;
    border-bottom: 2px solid #333;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ticket-type {
    font-size: 14px;
    font-weight: bold;
    color: #aaa;
    text-transform: uppercase;
}
.ticket-type.dinein { color: #4db8ff; }
.ticket-type.takeaway { color: #f39c12; }
.ticket-type.delivery { color: #2ecc71; }

.ticket-table {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
}
.ticket-memo {
    padding: 8px 15px;
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
    font-size: 15px;
    font-weight: bold;
    border-bottom: 2px solid #333;
}
.ticket-time {
    font-size: 16px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background: #333;
}
.time-warning { background: #d35400; color: #fff; }
.time-danger { background: #c0392b; color: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.5; } }

.ticket-body {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}
.ticket-item {
    margin-bottom: 15px;
    border-bottom: 1px dashed #444;
    padding-bottom: 10px;
}
.ticket-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.item-main {
    display: flex;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}
.item-qty {
    color: #ff6b6b;
    margin-right: 10px;
    min-width: 25px;
}
.item-options {
    padding-left: 35px;
    font-size: 14px;
    color: #aaa;
}
.item-option-line {
    margin-bottom: 3px;
}
.item-memo {
    padding-left: 35px;
    color: #f39c12;
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
}

.ticket-footer {
    padding: 15px;
    background: #1e1e1e;
    border-top: 1px solid #333;
    border-radius: 0 0 8px 8px;
}
.btn-ready {
    width: 100%;
    padding: 15px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
}
.btn-ready:active { background: #219653; }
.btn-ready:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

/* Scrollbar styling for KDS board */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #121212;
}
::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}
