@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800');

:root {
    --blue:      #3b82f6;
    --blue-dark: #3478f6;
    --blue-dim:  #dbeafe;
    --yellow:    #fbbf24;
    --yellow-dim:#fef3c7;
    --slate:     #1e293b;
    --slate2:    #334155;
    --slate3:    #475569;
    --muted:     #94a3b8;
    --line:      #eaeaea;
    --line2:     #f1f5f9;
    --cream:     #f8fafc;
    --paper:     #ffffff;
    --text:      #1c1d21;
    --text2:     #334155;
    --shadow-sm: 0 1px 4px rgba(15,23,42,.07);
    --shadow:    0 4px 16px rgba(15,23,42,.09);
    --shadow-lg: 0 16px 48px rgba(15,23,42,.14);
    --radius:    20px;
    --radius-sm: 9px;
    --panel-transition: 0.2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after {
    margin: 0;

    padding: 0;

    box-sizing: border-box;
}

body {
    margin: 0;

    height: 100vh;
    padding: 0;
    padding-top: 70px;

    display: flex;
    background-color: var(--cream);

    color: var(--text);
    font-family: 'Manrope', 'Noto Sans KR', Arial, sans-serif;

    flex-direction: column;
}
body:has(.request[style*="display: flex"]) {
    overflow: hidden;
}
body:has(.info-overlay.active) {
    overflow: hidden;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;

    width: 100%;
    height: 70px;

    display: flex;
    background-color: white;
    border-bottom: 1px solid #eaeaea;

    align-items: center;
    flex-wrap: wrap;
}
header h1 {
    margin: 0.67em 0 0.67em 35px;

    width: auto;

    font-size: 25px;
    font-weight: 700;
    letter-spacing: 5px;
    text-shadow: 0 2px 12px #3564f522;
    line-height: 0;

    text-align: left;
}
header .admin-button {
    position: absolute;
    right: 35px;

    padding: 8px 20px;

    border: 2px solid var(--text);
    box-sizing: border-box;
    background-color: white;

    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;

    transition: background 0.2s, color 0.2s, border 0.2s;
    cursor: pointer;
}
header .admin-button:hover {
    background-color: var(--text);

    color: white;
}

.floorTabs {
    height: 48px;
    padding: 0 40px;

    display: flex;
    background-color: white;
    border-bottom: 1px solid var(--line);
    box-sizing: border-box;

    align-items: flex-end;
    gap: 20px;
    overflow-x: auto;
    flex-shrink: 0;
    justify-content: center;
}
.floorTabs::-webkit-scrollbar {
    display: none;
}
.floorTabs .floor {
    height: 100%;
    padding: 0 16px;

    background: transparent;
    border: none;
    border-bottom: 2.5px solid transparent;

    color: var(--muted);
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;

    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.floorTabs .floor:hover {
    color: var(--text);
}
.floorTabs .floor[aria-selected="true"] {
    border-bottom-color: var(--blue-dark);

    color: var(--blue-dark);
}

.content {
    min-height: 0;

    display: flex;

    flex: 1;
    overflow: hidden;
}
.content .admin-panel {
    width: 0;

    display: flex;
    background: var(--paper);
    border-right: 0px solid var(--line);

    flex-shrink: 0;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--panel-transition), border-right-width var(--panel-transition);
}
.admin-inner {
    width: 100%;
    height: 100%;

    display: flex;

    flex-shrink: 0;
    flex-direction: column;
    overflow: hidden;
}
.admin-head {
    padding: 20px;

    display: flex;
    border-bottom: 1px solid var(--line2);

    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.admin-head strong {
    margin-bottom: 10px;

    display: block;

    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
}
.admin-head .count {
    color: var(--text);
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;
}
.admin-close-btn {
    padding: 6px 14px;

    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 20px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 200;
    letter-spacing: 1px;
    color: var(--text);

    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.admin-close-btn:hover {
    background: var(--cream);
}
.admin-list {
    padding: 16px 20px;

    flex: 1;
    overflow-y: auto;
}
.admin-list::-webkit-scrollbar {
    width: 4px;
}
.admin-list::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 4px;
}
.admin-card {
    margin-bottom: 10px;

    padding: 20px;

    background-color: var(--cream);
    border: 1px solid var(--line);
    border-radius: 20px;
    display: grid;
    gap: 12px;
    transition: border-color 0.2s;
}
.admin-card:hover {
    border-color: #cbd5e1;
}
.admin-card-head {
    min-width: 0;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.admin-card-room {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    min-width: 0;
    line-height: 1.5;
}
.admin-card-room-name {
    min-width: 0;

    font-size: 18px;
    font-weight: 200;
    letter-spacing: 1px;
    color: var(--text);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.admin-card-floor {
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;
    color: var(--text);
    white-space: nowrap;
}
.admin-card-detail {
    min-width: 0;

    display: grid;
    gap: 8px;
}
.admin-card-line {
    min-width: 0;

    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 6px;
}
.admin-card-label,
.admin-card-value {
    font-size: 16px;
    letter-spacing: 1px;
    font-weight: 200;
    color: var(--text);
    line-height: 1.55;
}
.admin-card-label {
    color: var(--text);
    white-space: nowrap;
}
.admin-card-label-inline {
    color: var(--text);
    white-space: nowrap;
}
.admin-card-line-inline .admin-card-value {
    white-space: normal;
}
.admin-card-value {
    min-width: 0;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.delete-btn {
    padding: 5px 12px;

    background: transparent;
    border: 1.5px solid #fca5a5;
    border-radius: 20px;
    
    color: #ef4444;
    font-family: inherit;
    font-size: 13px;
    font-weight: 200;
    letter-spacing: 1px;

    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s;
}
.delete-btn:hover {
    background: #fef2f2;
}
.admin-empty {
    padding: 48px 0;

    color: var(--text);
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: 200;

    text-align: center;
}
.content .map {
    min-width: 0;
    padding: 20px;

    display: flex;
    box-sizing: border-box;
    overflow-y: auto;

    flex-direction: column;
    flex: 1;
    transition: flex var(--panel-transition);
}
.content .map .mapCanvas {
    position: relative;

    min-height: clamp(470px, min(calc(100svh - 158px), calc(100vh - 158px)), 870px);

    background: var(--paper);
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;

    overflow: hidden;
    flex: 1;
}
.content .map .mapCanvas .floor {
    position: absolute;

    padding: 30px;

    display: none;

    inset: 0;
    flex-direction: column;
    justify-content: space-between;
}
.content .map .mapCanvas .floor[aria-hidden="false"] {
    display: flex;
}
.content .map .mapCanvas .floor .floor-row {
    display: flex;

    gap: 20px;
    flex: 0 0 38%;
}
.content .map .mapCanvas .floor .floor-row .roomBtn {
    padding: 0;

    display: flex;
    border: none;
    border-radius: 20px;
    background-color: #5b9cf6;
    box-shadow: 0 2px 8px rgba(91,156,246,.28);
    box-sizing: border-box;

    color: white;
    font-size: 18px;
    font-weight: 200;
    letter-spacing: 1px;

    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s, outline 0.2s;
    pointer-events: auto;
    cursor: pointer;
    flex: 1;
}
.content .map .mapCanvas .floor .floor-row .roomBtn:hover {
    background-color: #4a8ef0;
    box-shadow: 0 4px 14px rgba(91,156,246,.36);

    transform: scale(0.97);
}
.content .map .mapCanvas .floor .floor-row .roomBtn[data-selected="true"] {
    background-color: #f6a823;
    box-shadow: 0 4px 16px rgba(246,168,35,.4);
    outline: 2.5px solid #fcd97a;
    outline-offset: 2px;

    color: white;
}
.content .map .mapCanvas .floor .floor-row .roomBtnDummy {
    padding: 0;

    display: flex;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    background: rgba(148,163,184,.06);
    box-sizing: border-box;

    color: #94a3b8;
    font-size: 18px;
    font-weight: 200;
    letter-spacing: 1px;

    pointer-events: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
}

.content .info {
    width: 0;

    display: flex;
    background-color: var(--paper);
    border-left: 0px solid var(--line);

    flex-shrink: 0;
    overflow: hidden;
    flex-direction: column;
    transition: width var(--panel-transition), border-left-width var(--panel-transition);
}
.content .info .infoPanel {
    width: 320px;
    height: 100%;

    display: flex;

    flex-direction: column;
    flex-shrink: 0;
}
.content .info .infoPanel .content {
    height: 100%;

    display: flex;

    flex-direction: column;
    overflow: hidden;
}
.content .info .infoPanel .content .head {
    padding: 20px;

    border-bottom: 1px solid var(--line2);
}
.content .info .infoPanel .content .head .room {
    margin-bottom: 10px;

    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
}
.content .info .infoPanel .content .head .floor {
    color: var(--text);
    font-size: 186x;
    font-weight: 200;
    letter-spacing: 1px;
}
.content .info .infoPanel .content .body {
    padding: 20px;

    flex: 1;
    overflow-y: auto;
}
.content .info .infoPanel .content .body::-webkit-scrollbar {
    width: 4px;
}
.content .info .infoPanel .content .body::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 4px;
}
.content .info .infoPanel .content .body .bodyTitle {
    margin-bottom: 20px;

    display: block;

    font-size: 18px;
    font-weight: 200;
    letter-spacing: 1px;
}
.content .info .infoPanel .content .body .list .reqCard {
    margin-bottom: 8px;

    padding: 20px;

    display: grid;
    gap: 8px;
    border-radius: 20px;
    background: var(--cream);
    border: 1px solid var(--line);
}
.content .info .infoPanel .content .body .list .reqCard .reqTop {
    display: grid;
    gap: 6px;
}
.content .info .infoPanel .content .body .list .reqCard .reqSubmittedAt {
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;
    color: var(--text);
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.content .info .infoPanel .content .body .list .reqCard .reqTop .reqName {
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;
    color: var(--text);
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.content .info .infoPanel .content .body .list .reqCard .reqTop .reqMeta {
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;
    color: var(--text);
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.content .info .infoPanel .content .body .list .reqCard .reqSid {
    font-size: 16px;
    font-weight: 200;
    letter-spacing: 1px;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.content .info .infoPanel .content .body .list .reqEmpty {
    padding: 48px 0;

    color: var(--text);
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: 200;

    text-align: center;
}
.content .info .infoPanel .content .foot {
    padding: 20px;
    border-top: 1px solid var(--line2);
}
.content .info .infoPanel .content .foot .apply-button {
    width: 100%;
    padding: 12px 0;

    background-color: var(--blue-dark);
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 8px #3564f544;
    box-sizing: border-box;

    color: white;
    font-size: 18px;
    font-weight: 200;
    letter-spacing: 1px;

    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.content .info .infoPanel .content .foot .apply-button:hover {
    background: var(--blue);
}

.content.room-selected .map {
    flex: 1;
}
.content.room-selected .info {
    width: 320px;
    border-left-width: 1px;
}
.content.admin-open .admin-panel {
    width: 320px;
    border-right-width: 1px;
}

.info-overlay {
    position: fixed;
    z-index: 150;

    display: none;
    background: rgba(8,16,32,.45);
    backdrop-filter: blur(4px);

    inset: 0;
}
.info-overlay.active {
    display: block;
}

.request {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100vw; height: 100vh;
    height: 100svh;
    padding: 12px;

    display: none;
    background-color: rgba(8,16,32,.55);
    backdrop-filter: blur(5px);
    box-sizing: border-box;

    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.request .window {
    width: min(50vw, 720px);
    max-height: min(calc(100svh - 24px), calc(100vh - 24px));
    padding: 30px;

    display: block;
    background-color: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.request .window.open {
    animation: window-pop 0.2s;
}
.request .window.close {
    animation: window-popdown 0.2s;
}
.request .window .contents {
    position: relative;
}
.request .window .contents strong {
    display: block;
    max-width: calc(100% - 40px);

    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: anywhere;

    vertical-align: middle;
}
.request .window .contents .close {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;

    display: inline-block;

    color: var(--blue);
    font-size: 27px;

    cursor: pointer;
    transition: color 0.2s;
    vertical-align: middle;
    line-height: 1;
}
.request .window .contents .close:hover {
    color: var(--blue-dark);
}

/* 기본 라벨 */
.request .window .contents a {
    margin-top: 15px;

    display: block;

    font-weight: 200;
    font-size: 18px;
    letter-spacing: 1px;

    align-self: flex-start;
}

/* 기본 인풋 */
.request .window .contents input {
    margin-top: 6px;

    width: 100%;
    padding: 11px 13px;

    background-color: white;
    border: 1.6px solid #cacaca;
    border-radius: 15px;
    box-sizing: border-box;
    outline: none;

    font-size: 18px;
    font-weight: 200;
    color: var(--text);
    letter-spacing: 1px;

    transition: border 0.2s, background 0.2s;
}
.request .window .contents input:focus {
    background-color: #eef5ff;
    border: 1.6px solid var(--blue-dark);
}

/* 학번+이름 / 지도교사 한 줄 배치 */
.request-row {
    margin-top: 15px;

    display: flex;
    gap: 12px;
}
.request-row .request-field {
    display: flex;

    flex: 1;
    flex-direction: column;
}
.request-row .request-field a {
    margin-top: 0;
}
.request-row .request-field input {
    margin-top: 6px;
}
.request-time {
    margin-top: 6px;

    display: grid;
    grid-template-columns: 42.5% 57.5%;
    align-items: center;
}
.request-time .startPeriod,
.request-time .endPeriod {
    margin-top: 0 !important;
    width: 100% !important;
    text-align: center;
}
.request-time-end {
    display: grid;
    grid-template-columns: 13fr 42.5fr;
    align-items: center;
}
.request-time-dash {
    display: inline-block;

    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
}

.request .window .contents button {
    margin-top: 20px;

    width: 100%;
    padding: 12px 0;

    background-color: var(--blue-dark);
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 8px #3564f544;
    box-sizing: border-box;

    color: white;
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: 200;

    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.request .window .contents button:hover {
    box-shadow: 0 6px 20px #3564f577;
}

@media (max-width: 768px) {
    .content {
        overflow-x: auto;
        overflow-y: hidden;
    }
    .content .map {
        min-width: 700px;
    }
    .content .info {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;

        width: 100% !important;
        height: 60vh;

        border-left: none !important;
        border-top: 1px solid var(--line);
        border-radius: 20px 20px 0 0;

        transform: translateY(100%);
        transition: transform var(--panel-transition);
    }
    .content .info .infoPanel {
        width: 100%;
    }
    .content .admin-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;

        width: 100% !important;
        height: 60vh;

        border-right: none !important;
        border-top: 1px solid var(--line);
        border-radius: 20px 20px 0 0;

        transform: translateY(100%);
        transition: transform var(--panel-transition);
    }
    .content.admin-open .admin-panel {
        transform: translateY(0);
    }

    .content.room-selected .info {
        width: 100%;

        border-left: none;
        border-top: 1px solid var(--line);
        
        transform: translateY(0);
    }

    .request .window {
        width: 100%;
    }
    .admin-inner {
        width: 100%;
    }

    .floorTabs {
        justify-content: unset;
    }

    /* 모바일에서는 한 줄 배치 유지하되 세로로 전환 */
    .request-row {
        flex-direction: column;
        gap: 0;
    }
    .request-row .request-field {
        margin-top: 0;
    }
    .request-row .request-field a {
        margin-top: 15px;
    }
    .request-time {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .request-time-end {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
    }
    .request-time-dash {
        padding: 0 4px;
    }
}

@media (max-width: 600px) {
    body {
        padding-top: 123px;
    }

    header {
        height: auto;
        min-height: 0;
        padding: 10px 0;

        flex-direction: column;
        justify-content: center;
        align-items: stretch;
    }
    header h1 {
        margin: 0.67em 0;

        width: 100%;

        line-height: 1;

        text-align: center;
    }
    header .admin-button {
        position: static;
        right: auto;
        top: auto;
        margin: 0 auto 8px auto;

        width: 80%;
        padding: 6px 18px;

        display: block;

        transform: none;
    }
}

@keyframes window-pop {
    from { opacity: 0; transform: scale(0.95);}
    to { opacity: 1; transform: scale(1);}
}
@keyframes window-popdown {
    from { opacity: 1; transform: scale(1);}
    to { opacity: 0; transform: scale(0.95);}
}
