@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #191f28;
    --subtext: #6b7684;
    --muted: #8b95a1;
    --line: #e5e8eb;
    --line-soft: #f2f4f6;
    --blue: #3182f6;
    --blue-pressed: #1b64da;
    --blue-soft: #e8f3ff;
    --red: #f04452;
    --red-soft: #fff0f1;
    --green: #00a86b;
    --green-soft: #e9f8f0;
    --shadow: 0 16px 40px rgba(25, 31, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #ffffff;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: #ffffff;
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    letter-spacing: 0;
    overflow-y: scroll;
}

button,
input,
select {
    font: inherit;
    letter-spacing: 0;
}

button {
    border: 0;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.entry-container,
.main-container {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 28px 20px;
}

.entry-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #ffffff;
}

.entry-container img {
    width: clamp(132px, 34vw, 200px);
    height: auto;
    margin-bottom: 18px;
}

.entry-container h1 {
    margin: 0;
    font-size: clamp(34px, 9vw, 48px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.entry-container p {
    margin: 12px 0 28px;
    color: var(--subtext);
    font-size: 15px;
    font-weight: 600;
}

#login-form {
    width: min(100%, 360px);
    display: grid;
    gap: 10px;
}

#login-form input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--line-soft);
    outline: none;
    font-size: 16px;
    font-weight: 600;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#login-form input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

#login-form input:focus {
    border-color: rgba(49, 130, 246, 0.32);
    box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.13);
}

#login-form button {
    height: 52px;
    margin-top: 4px;
    color: #ffffff;
    background: var(--blue);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    transition: transform 0.12s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

#login-form button:hover {
    background: var(--blue-pressed);
    box-shadow: 0 10px 22px rgba(49, 130, 246, 0.22);
}

#login-form button:active {
    transform: translateY(1px);
}

.main-container {
    min-height: 100vh;
    background: #ffffff;
}

.header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 0 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.header h2 {
    min-width: 0;
    margin: 0;
    font-size: clamp(22px, 6vw, 30px);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
}

.logout-btn {
    width: 80px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--subtext);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(25, 31, 40, 0.06);
    font-size: 15px;
    font-weight: 900;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
}

.logout-btn:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.logout-btn:active {
    transform: translateY(1px);
}

.room-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 16px;
}

.room-tab {
    min-width: 0;
    min-height: 42px;
    padding: 0 8px;
    color: var(--subtext);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.room-tab:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.room-tab.active {
    color: #ffffff;
    background: var(--blue);
    border-color: var(--blue);
}

.viewMode-select {
    grid-column: 1 / -1;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-weight: 700;
}

.viewMode-select:focus {
    border-color: rgba(49, 130, 246, 0.42);
    box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}

table {
    width: 100%;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

thead th {
    padding: 13px 8px;
    color: var(--muted);
    background: #ffffff;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

tbody td {
    padding: 14px 8px;
    color: #333d4b;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbfcfd;
}

.seat-num {
    color: var(--blue);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.time-text {
    color: var(--text);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.status-badge {
    min-width: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.status-badge.available {
    color: var(--green);
    background: var(--green-soft);
}

.status-badge.occupied {
    color: var(--red);
    background: var(--red-soft);
}

.loading-row td {
    padding: 72px 20px !important;
    color: var(--muted);
    background: var(--surface);
    border-bottom: 0 !important;
    font-weight: 700;
    text-align: center;
}

/* =========================================
   데이터 로딩. 
   ========================================= */
   .loading-row td {
    padding: 100px 24px !important; /* '데이터 없음' 화면과 동일한 넓은 여백으로 덜컥거림 방지 */
    text-align: center;
    background-color: #ffffff;
    border-bottom: none !important;
}

/* 오리 컨테이너 (여백 추가 수정, 이전 수정 유지) */
.duck-walker {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 30px auto 0; 
}

/* 바닥 그림자 (기존 유지) */
.duck-shadow {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 8px;
    background: rgba(30, 75, 143, 0.12);
    border-radius: 50%;
    animation: shadow-size 0.85s infinite ease-in-out;
}

/* 흰 오리 몸통 (둥둥 떠있는 애니메이션 적용, z-index: 2, 이전 수정 유지) */
.duck {
    position: relative;
    width: 50px;
    height: 45px;
    background: #ffffff;
    border: 1.5px solid #d0dae6;
    border-radius: 55% 55% 45% 45%;
    margin: 0 auto;
    z-index: 2; /* 몸통 레이어 */
    will-change: transform;
    animation: duck-float 4s infinite ease-in-out;
}

/* 학사모 (z-index: 3, 몸통 위에 배치, 기존 유지) */
.duck-cap {
    position: absolute;
    top: -14px;
    left: 6px;
    width: 38px;
    height: 10px;
    background: #1e4b8f;
    border-radius: 2px;
    transform: rotate(-5deg);
    z-index: 3;
}
/* 학사모 머리 들어가는 부분 (기존 유지) */
.duck-cap::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 9px;
    width: 20px;
    height: 8px;
    background: #15376b;
    border-radius: 0 0 4px 4px;
}
/* 학사모 술(Tassel) (기존 유지) */
.duck-cap::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 4px;
    width: 2px;
    height: 14px;
    background: #1e4b8f;
}

/* 타이머 책 (z-index: 4, 몸통 위에 배치, 기존 유지) */
.duck-book {
    position: absolute;
    top: 28px;
    left: 6px;
    width: 26px;
    height: 18px;
    background: #3b82f6;
    border-radius: 2px;
    transform: rotate(-15deg);
    z-index: 4;
    border-left: 3px solid #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 6px;
    font-family: 'Courier New', monospace;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* 날개 (z-index: 5, 책 위에 배치, 기존 유지) */
.duck::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 12px;
    width: 14px;
    height: 10px;
    background: #ffffff;
    border: 1px solid #d0dae6;
    border-radius: 50%;
    transform: rotate(-40deg);
    z-index: 5;
}

/* 오리 눈 (기존 유지) */
.duck-eye {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 4px;
    height: 4px;
    background: #9ca3af; 
    border-radius: 50%;
}

/* 오리 부리 (기존 유지) */
.duck-beak {
    position: absolute;
    top: 20px;
    right: -10px;
    width: 15px;
    height: 8px;
    background: #e2e8f0; 
    border: 1px solid #cbd5e1;
    border-radius: 2px 8px 8px 2px;
}

/* 오리 발 (비대칭 모양 수정 유지, z-index 추가) */
.foot {
    position: absolute;
    bottom: -8px;
    width: 14px;
    height: 6px;
    background: #e2e8f0;
    border: 1.5px solid #cbd5e1;
    border-radius: 70% 30% 30% 70%;
    transform-origin: left center;
}

/* 발 애니메이션 및 레이어 설정 */

/* 가까운 쪽 발 (몸통 위에 배치) */
.foot.left {
    left: 14px;
    z-index: 3; /* 몸통 위에 배치 */
    animation: foot-wiggle 0.42s infinite alternate ease-in-out;
}

/* 먼 쪽 발 (몸통 뒤에 배치) */
.foot.right {
    right: 14px;
    z-index: 1; /* 몸통 뒤에 배치 (입체감 부여) */
    animation: foot-wiggle 0.42s infinite alternate ease-in-out 0.21s; /* 교차 애니메이션 */
}

/* keyframes 정의 */

/* 애니메이션: 몸통이 제자리에서 부드럽게 둥둥 뜸 (기존 유지) */
@keyframes duck-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    38% { transform: translateY(-24px) rotate(3deg); }
    55% { transform: translateY(-28px) rotate(0deg); }
    72% { transform: translateY(-12px) rotate(-3deg); }
}

/* 애니메이션: 발가락만 살짝 까딱이는 모션 (기존 유지) */
@keyframes foot-wiggle {
    0% { transform: rotate(-14deg) translateX(-2px); }
    100% { transform: rotate(28deg) translateX(3px); }
}

/* 애니메이션: 그림자 크기 조절 (기존 유지) */
@keyframes shadow-size {
    0%, 100% { width: 46px; opacity: 0.9; }
    45%, 60% { width: 18px; opacity: 0.22; }
}

.loading-text {
    display: block;
    margin-top: 24px;
    color: #8b95a1;
    font-size: 16px; 
    font-weight: 600; 
    letter-spacing: -0.3px;
    text-align: center; 
}

.loading-text::before {
    content: '...';
    color: transparent; /* 글씨를 투명하게 만들어 공간만 차지하게 합니다 */
}

.no-data-row td,
.closed-row td {
    padding: 76px 20px !important;
    background: var(--surface);
    border-bottom: 0 !important;
    text-align: center;
}

.no-data-text,
.closed-row td {
    color: var(--subtext);
}

.no-data-icon,
.closed-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: var(--line-soft);
    border-radius: 50%;
    font-size: 24px;
}

.no-data-msg,
.closed-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.45;
}

.closed-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

@keyframes duck-bob {
    0%,
    100% {
        transform: translateX(-50%) translateY(0) rotate(-1deg);
    }

    50% {
        transform: translateX(-50%) translateY(-8px) rotate(2deg);
    }
}

@keyframes duck-shadow-pulse {
    0%,
    100% {
        opacity: 0.9;
        transform: translateX(-50%) scaleX(1);
    }

    50% {
        opacity: 0.55;
        transform: translateX(-50%) scaleX(0.78);
    }
}

@keyframes duck-step-left {
    0%,
    100% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(5px);
    }
}

@keyframes duck-step-right {
    0%,
    100% {
        transform: translateX(5px);
    }

    50% {
        transform: translateX(-4px);
    }
}

@media (min-width: 768px) {
    .entry-container,
    .main-container {
        width: min(100%, 760px);
        padding: 40px 32px;
    }

    #login-form {
        width: 380px;
    }

    .room-nav {
        grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(180px, 220px);
        align-items: center;
    }

    .viewMode-select {
        grid-column: auto;
    }

    tbody td {
        padding: 15px 12px;
        font-size: 15px;
    }
}

@media (max-width: 420px) {
    .entry-container,
    .main-container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .room-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .room-tab,
    .viewMode-select {
        min-height: 44px;
    }

    thead th,
    tbody td {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 12px;
    }

    .status-badge {
        min-width: 58px;
        padding: 6px 7px;
        font-size: 11px;
    }

    .loading-row td,
    .no-data-row td,
    .closed-row td {
        padding-top: 56px !important;
        padding-bottom: 56px !important;
    }

    .duck-walker {
        height: 116px;
        margin-bottom: 10px;
    }

    .duck {
        scale: 0.9;
        transform-origin: bottom center;
    }

    .loading-text,
    .no-data-msg,
    .closed-title {
        font-size: 14px;
    }

    .closed-subtitle {
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    html,
    body {
        min-width: 0;
        width: 100%;
    }

    .entry-container,
    .main-container {
        width: 100%;
        padding: 24px 18px;
    }

    .entry-container {
        min-height: 100svh;
        justify-content: center;
    }

    .entry-container img {
        width: min(48vw, 180px);
        margin-bottom: 16px;
    }

    .entry-container h1 {
        font-size: 42px;
    }

    .entry-container p {
        margin-bottom: 28px;
        font-size: 16px;
    }

    #login-form {
        width: 100%;
        max-width: 390px;
        gap: 12px;
    }

    #login-form input,
    #login-form button {
        height: 56px;
        font-size: 17px;
    }

    .header {
        padding: 16px 0 14px;
    }

    .header h2 {
        font-size: 30px;
    }

    .logout-btn {
        width: 78px;
        height: 42px;
        font-size: 14px;
    }

    .room-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
        margin-bottom: 18px;
    }

    .room-tab,
    .viewMode-select {
        min-height: 48px;
        font-size: 16px;
    }

    .viewMode-select {
        grid-column: 1 / -1;
        height: 68px;
        min-height: 68px;
        padding: 0 20px;
        border-width: 1.5px;
        font-size: 18px;
        font-weight: 800;
        line-height: 68px;
    }

    table {
        box-shadow: none;
    }

    thead th,
    tbody td {
        padding: 13px 5px;
        font-size: 13px;
    }

    .status-badge {
        min-width: 62px;
        padding: 6px 7px;
        font-size: 12px;
    }

    .time-text,
    .seat-num {
        font-size: 14px;
    }
}

@media (min-width: 641px) and (max-device-width: 480px) {
    html,
    body {
        min-width: 0;
        width: 100%;
    }

    .entry-container,
    .main-container {
        width: 100%;
        max-width: none;
        padding: 64px 48px;
    }

    .entry-container {
        min-height: 100vh;
        justify-content: center;
    }

    .entry-container img {
        width: 360px;
        max-width: none;
        margin-bottom: 36px;
    }

    .entry-container h1 {
        font-size: 100px;
        line-height: 1.05;
    }

    .entry-container p {
        margin: 28px 0 64px;
        font-size: 38px;
        font-weight: 700;
    }

    #login-form {
        width: min(100%, 760px);
        max-width: none;
        gap: 24px;
    }

    #login-form input,
    #login-form button {
        height: 124px;
        padding: 0 40px;
        border-radius: 18px;
        font-size: 40px;
    }

    .header {
        padding: 44px 0 36px;
    }

    .header h2 {
        font-size: 64px;
    }

    .logout-btn {
        width: 180px;
        height: 92px;
        border-radius: 18px;
        font-size: 32px;
    }

    .room-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
        margin: 10px 0 34px;
    }

    .room-tab,
    .viewMode-select {
        min-height: 104px;
        border-radius: 18px;
        font-size: 34px;
    }

    .viewMode-select {
        grid-column: 1 / -1;
        height: 132px;
        min-height: 132px;
        padding: 0 42px;
        border-width: 2px;
        font-size: 40px;
        font-weight: 800;
        line-height: 132px;
    }

    table {
        border-radius: 18px;
        box-shadow: none;
    }

    thead th,
    tbody td {
        padding: 32px 14px;
        font-size: 30px;
    }

    .seat-num,
    .time-text {
        font-size: 34px;
    }

    .status-badge {
        min-width: 152px;
        padding: 18px 22px;
        font-size: 28px;
    }

    .loading-row td,
    .no-data-row td,
    .closed-row td {
        padding-top: 140px !important;
        padding-bottom: 140px !important;
    }

    .loading-text,
    .no-data-msg,
    .closed-title {
        font-size: 34px;
    }

    .closed-subtitle {
        font-size: 28px;
    }
}
