/* ==========================================================================
   본가숯불돼지갈비 예약자 현황판 스타일시트 (디스플레이 / 사이니지 전용)
   ========================================================================== */

:root {
    --bg-dark: #0f0d0c;
    --burgundy-header: #72191b;
    --burgundy-text: #961919;
    --burgundy-subtext: #8c2424;
    --green-header: #194e26;
    --green-text: #196b29;
    --table-header-bg: #262626;
    --table-body-bg: #f7f4ec;
    --table-border: #e8e3d5;
    --gold-text: #ebd5ba;
    --gold-subtext: #cfbda2;
    --text-dark: #222222;
}

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

body {
    background-color: var(--bg-dark);
    color: #ffffff;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
}

/* 상단 컨트롤 바 (평소에는 희미하고 호버 시 나타남) */
.top-control-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 13, 12, 0.95);
    border-bottom: 1px solid #332b26;
    padding: 6px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    opacity: 0.15;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.top-control-bar:hover {
    opacity: 1;
}

.control-left {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #aaa;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4ade80;
    font-weight: 500;
}

.live-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.clock {
    font-family: monospace;
    font-size: 14px;
    color: #ddd;
}

.control-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-label {
    font-size: 13px;
    color: #ccc;
}

#branch-selector {
    background: #25201d;
    border: 1px solid #4a3e35;
    color: #f0e6d6;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.ctrl-btn {
    background: #362e29;
    border: 1px solid #5a4b41;
    color: #eee;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: #50443c;
    color: #fff;
}

.admin-link {
    background: #872628;
    border-color: #a83437;
}

.admin-link:hover {
    background: #a83437;
}

/* ==========================================================================
   메인 디스플레이 컨테이너 (16:9 와이드 화면 최적화)
   ========================================================================== */
.board-screen {
    width: 100vw;
    max-width: 1500px;
    height: 100vh;
    max-height: 843px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 30px 18px 30px;
    box-sizing: border-box;
}

/* 1. 상단 헤더 배너 */
.board-header {
    position: relative;
    width: 100%;
    height: 120px;
    background: url('/static/images/header_bg.jpg') center top / cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(10, 8, 8, 0.2) 0%,
        rgba(15, 12, 11, 0.65) 20%,
        rgba(15, 12, 11, 0.75) 50%,
        rgba(15, 12, 11, 0.65) 80%,
        rgba(10, 8, 8, 0.2) 100%
    );
    z-index: 1;
}

.header-center-title {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.brand-name {
    font-family: 'Gowun Batang', 'Nanum Myeongjo', serif;
    font-size: 44px;
    font-weight: 700;
    color: #f7eedb;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 16px rgba(235, 185, 120, 0.3);
    line-height: 1.1;
}

/* 빨간색 낙관/도장 마크 */
.red-stamp {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background: #b51c1c;
    border: 1px solid #ff4d4d;
    border-radius: 4px;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    margin-left: -4px;
    margin-right: 2px;
}

.red-stamp span {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    transform: scale(0.9);
}

.branch-name {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

.sub-title-row {
    margin-top: 6px;
}

.sub-en {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #e5cbaf;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    opacity: 0.95;
}

/* 2. 메인 콘텐츠 (2분할 카드) */
.board-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 14px;
    flex: 1;
    min-height: 0; /* flex 자식 스크롤 가능하게 */
}

.board-card {
    background: var(--table-body-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    border: 1px solid #332d29;
}

/* 카드 상단 배너 */
.card-header {
    height: 54px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}

.card-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header .icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.card-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-header .header-count {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.waiting-header {
    background: var(--burgundy-header);
}

.dining-header {
    background: var(--green-header);
}

/* 오전 / 오후 파트 뱃지 */
.part-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0;
    font-family: 'Noto Sans KR', sans-serif;
    display: inline-flex;
    align-items: center;
}

.part-badge.morning {
    background: rgba(254, 240, 138, 0.22);
    color: #fef08a;
    border: 1px solid rgba(254, 240, 138, 0.45);
}

.part-badge.afternoon {
    background: rgba(147, 197, 253, 0.22);
    color: #bfdbfe;
    border: 1px solid rgba(147, 197, 253, 0.45);
}

/* 테이블 영역 */
.table-container {
    flex: 1;
    overflow-y: auto;
    background: var(--table-body-bg);
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.status-table thead tr {
    background: var(--table-header-bg);
}

.status-table th {
    padding: 11px 8px;
    color: #ffffff;
    font-size: 19px;
    font-weight: 600;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
}

.status-table tbody tr {
    border-bottom: 1px solid var(--table-border);
    transition: background-color 0.2s ease;
}

.status-table tbody tr:last-child {
    border-bottom: none;
}

.status-table td {
    padding: 13px 8px;
    color: var(--text-dark);
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

/* 컬럼별 스타일 - 입장 대기 테이블 */
.waiting-table td:nth-child(1) {
    font-size: 24px;
    font-weight: 800;
}

.waiting-table tr:first-child td:nth-child(1) {
    color: var(--burgundy-text);
}

.waiting-table td:nth-child(2) {
    font-weight: 700;
    font-size: 23px;
}

.waiting-table td.status-col {
    font-weight: 800;
}

.waiting-table td.status-ready {
    color: var(--burgundy-text);
    font-size: 23px;
    animation: gentle-glow 2.5s infinite;
}

@keyframes gentle-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.82; }
}

.waiting-table td.status-waiting {
    color: var(--burgundy-subtext);
    font-size: 21px;
    font-weight: 700;
}

/* 테이블 표시 뱃지 */
.table-col {
    font-weight: 700;
    font-size: 21px;
}

.table-pill {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #fcd34d;
    padding: 3px 14px;
    border-radius: 16px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.room-table .table-pill {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #6ee7b7;
}

/* 컬럼별 스타일 - 룸 대기 테이블 */
.room-table td:nth-child(1) {
    font-size: 24px;
    font-weight: 800;
}

.room-table tr:first-child td:nth-child(1) {
    color: var(--green-text);
}

.room-table td:nth-child(2) {
    font-weight: 700;
    font-size: 23px;
}

.room-table td.status-col {
    font-weight: 800;
}

.room-table td.status-ready {
    color: var(--burgundy-text);
    font-size: 23px;
    animation: gentle-glow 2.5s infinite;
}

.room-table td.status-waiting {
    color: var(--green-text);
    font-size: 21px;
    font-weight: 700;
}

/* 빈 목록 표시 */
.empty-row td {
    padding: 40px 10px !important;
    color: #8c8275 !important;
    font-size: 18px !important;
    font-weight: 500 !important;
}

/* 3. 하단 푸터 영역 */
.board-footer {
    width: 100%;
    margin-top: 14px;
    padding-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.footer-divider-left,
.footer-divider-right {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(214, 187, 153, 0.45));
}

.footer-divider-right {
    background: linear-gradient(90deg, rgba(214, 187, 153, 0.45), transparent);
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hanok-icon-wrap {
    display: flex;
    align-items: center;
}

.hanok-svg {
    width: 32px;
    height: 24px;
    color: var(--gold-text);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.footer-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--gold-text);
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* 토스트 팝업 (입장 호출) */
.calling-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #7a1b1d, #521113);
    color: #fff;
    padding: 16px 28px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 60, 60, 0.4);
    border: 1px solid #c2383c;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.calling-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toast-icon {
    font-size: 32px;
    animation: ring 1s infinite ease-in-out;
}

@keyframes ring {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.toast-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffd2d2;
}

.toast-desc {
    font-size: 15px;
    color: #fff;
    margin-top: 2px;
}

/* 반응형 미디어 쿼리 (작은 화면 대응) */
@media (max-width: 1024px) {
    .board-header {
        height: 100px;
    }
    .brand-name {
        font-size: 34px;
    }
    .branch-name {
        font-size: 26px;
    }
    .status-table td {
        font-size: 18px;
        padding: 10px 6px;
    }
    .status-table th {
        font-size: 16px;
    }
}
