/* --- CSS Variables --- */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #f4f7fc;
    --text-color: #333;
    --secondary-text-color: #6c757d;
    --border-color: #e0e0e0;
    --white-color: #ffffff;
    --danger-color: #dc3545;
    --font-family: 'Pretendard', sans-serif;
}

/* --- Base Layout --- */
body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.main-content { flex: 1; overflow-y: auto; padding: 2rem; }
.container { max-width: 1200px; margin: 0 auto; }

/* --- Header --- */
.header { text-align:center; margin-bottom: 2.5rem; }
.header p { font-size: 1rem; margin-top: 0.5rem; color: var(--secondary-text-color); }

/* --- Section Layouts --- */
.notice-section, .calendar-section, .weather-section {
    background-color: var(--white-color);
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents grid item from overflowing its container */
}

.notice-section {
    margin-bottom: 1.5rem;
    min-height: 420px; /* 고정 높이로 레이아웃 안정화 */
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.weather-section, .calendar-section {
    min-height: 480px; /* 고정 높이로 레이아웃 안정화 */
}


/* --- Notice & Calendar Headers --- */
.notice-header, .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.notice-header h2, .calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}
.plus-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--secondary-text-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}
.plus-btn:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* --- Notice Controls (Search Bar) --- */
.notice-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.notice-search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}
#notice-search-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-right: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
}
#notice-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}
#notice-search-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 1rem;
}


/* --- Notice Tabs & Lists --- */
.notice-tabs { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; flex-shrink: 0; }
.notice-tab { padding: 0.5rem 1rem; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s; color: var(--secondary-text-color); }
.notice-tab.active { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); }
.notice-list, .calendar-list { list-style: none; padding: 0; margin: 0; flex-grow: 1; overflow-y: auto; overflow-x: auto; }

.notice-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0.5rem; border-bottom: 1px solid #f0f0f0; }
.notice-item:last-child { border-bottom: none; }
.notice-item a { text-decoration: none; color: var(--text-color); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 1rem; }
.notice-item a:hover { text-decoration: underline; }
.notice-date { color: var(--secondary-text-color); font-size: 0.9rem; flex-shrink: 0; }

.calendar-item { display: flex; flex-direction: column; padding: 0.75rem 0.5rem; border-bottom: 1px solid #f0f0f0; }
.calendar-item:last-child { border-bottom: none; }
.calendar-date { font-size: 0.85rem; color: var(--primary-color); font-weight: 600; margin-bottom: 0.25rem; }
.calendar-event { color: var(--text-color); }

/* --- Weather Section Styles --- */
.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.weather-header h2 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.campus-tabs { display: flex; background-color: var(--secondary-color); border-radius: 99px; padding: 4px; }
.campus-tab { padding: 0.4rem 0.8rem; border: none; background-color: transparent; border-radius: 99px; cursor: pointer; font-weight: 600; transition: all 0.2s; color: var(--secondary-text-color); font-size: 0.9rem; }
.campus-tab.active { background-color: var(--white-color); color: var(--primary-color); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.weather-content { flex-grow: 1; text-align: center; }
.weather-loading p { color: var(--secondary-text-color); margin-top: 2rem; }
.current-weather { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.5rem; }
.current-weather-icon { font-size: 4rem; margin-bottom: 0.5rem; color: var(--primary-color); }
.current-temp { font-size: 3rem; font-weight: 700; line-height: 1; }
.current-temp sup { font-size: 1.5rem; vertical-align: top; }
.min-max-temp { font-size: 1rem; color: var(--secondary-text-color); font-weight: 500; }
.hourly-forecast { display: flex; overflow-x: auto; gap: 1rem; padding-bottom: 1rem; }
.hourly-forecast::-webkit-scrollbar { height: 6px; }
.hourly-forecast::-webkit-scrollbar-thumb { background-color: #d1dce8; border-radius: 3px; }
.hour-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; min-width: 60px; }
.hour-time { font-size: 0.9rem; font-weight: 600; color: var(--secondary-text-color); }
.hour-icon { font-size: 1.8rem; color: #555; }
.hour-temp { font-size: 1.1rem; font-weight: 600; }
.weather-footer { text-align: right; font-size: 0.8rem; color: #aaa; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-color); }

/* --- Other Sections --- */
.service-section { margin-bottom: 3rem; }
.service-section h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1.5rem; text-align: left; color: var(--text-color); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.service-card { background-color: var(--white-color); border: 1px solid var(--border-color); border-radius: 0.75rem; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); }
.card-content { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.card-thumbnail { width: 100%; height: 150px; object-fit: cover; border-bottom: 1px solid var(--border-color); }
.card-title { padding: 1rem; font-size: 1.1rem; font-weight: bold; color: var(--text-color); }

.shortcut-prompt { text-align: center; padding: 2rem 0; margin-top: 2rem; background-color: var(--white-color); border-radius: 0.75rem; box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
.shortcut-prompt h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.shortcut-prompt p { color: var(--secondary-text-color); margin-bottom: 1.5rem; }
.shortcut-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.shortcut-btn { padding: 0.75rem 1.5rem; border-radius: 999px; border: none; font-size: 1rem; font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; color: #fff; }
.shortcut-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.android-btn { background-color: #3DDC84; }
.ios-btn { background-color: #007AFF; }
.windows-btn { background-color: #0078D7; }
.mac-btn { background-color: #555; }

/* --- Popups & Overlays --- */
.shortcut-overlay, .service-overlay, .site-notice-overlay, .cookie-consent-overlay { position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 9999; }
.shortcut-popup, .site-notice-popup, .cookie-consent-popup { background-color: #fff; padding: 2rem; border-radius: 1rem; max-width: 450px; width: 90%; text-align: center; position: relative; box-shadow: 0 8px 30px rgba(0,0,0,0.2); animation: popupFadeIn 0.3s forwards; }
@keyframes popupFadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.close-btn, .site-notice-close { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; border: none; background: none; cursor: pointer; color: #aaa; }
.shortcut-popup { text-align: left; }
.shortcut-popup h3 { margin-top: 0; font-size: 1.25rem; font-weight: 700; }
.shortcut-popup p { color: #666; margin-bottom: 1.5rem; }
.shortcut-steps { list-style: none; padding: 0; margin: 0; }
.step { display: flex; align-items: center; margin-bottom: 1rem; }
.step .step-number { background-color: var(--primary-color); color: #fff; width: 30px; height: 30px; min-width: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; margin-right: 1rem; }
.step .step-text { flex: 1; font-size: 1rem; }

.site-notice-popup, .cookie-consent-popup { max-width: 380px; padding: 35px 28px 25px 28px; }
.site-notice-popup h2 { margin: 0 0 15px 0; font-size: 1.22em; color: #86562c; font-weight: bold; }
.site-notice-desc { color: #444; font-size: 1.02em; margin-bottom: 24px; line-height: 1.52; }
.site-notice-allow-btn, .cookie-consent-buttons button { background: #8c6239; color: #fff; border: none; font-size: 1em; font-weight: 700; border-radius: 8px; padding: 13px 0; cursor: pointer; transition: background 0.16s; width: 120px; }
.site-notice-allow-btn:hover { background: #967246; }
.cookie-consent-popup h2 { color: var(--primary-color); }
.cookie-consent-buttons { display:flex; justify-content:center; gap:16px; }

.service-overlay { animation: fadeIn 0.3s forwards; cursor: pointer; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.service-popup { background-color: #fff; border-radius: 1rem; width: 90%; max-width: 1200px; height: 90%; position: relative; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; pointer-events: none; }
.service-popup .close-btn { z-index: 10; color: #333; pointer-events: auto; }
.service-popup-iframe { width: 100%; height: 100%; border-radius: 1rem; border: none; }

/* --- Music Controller --- */
.music-controller { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; z-index: 1002; gap: 10px; }
.music-controller.folded .music-content { display: none; }
.music-content { display: flex; flex-direction: column; align-items: center; gap: 10px; background-color: #2d3436; color: var(--white-color); border-radius: 0.75rem; padding: 1rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); width: 350px; }
.music-controls-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.music-message { font-size: 0.9rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 300px; }
.music-controls-buttons { display: flex; align-items: center; gap: 20px; }
.music-button-icon { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 10px; transition: color 0.3s; }
.music-button-icon:hover { color: #7ed6df; }
.play-pause-btn { border: 2px solid #fff; width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.toggle-button { background-color: var(--white-color); border: 1px solid var(--border-color); color: var(--primary-color); padding: 0.75rem 1rem; border-radius: 999px; cursor: pointer; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }

/* --- Footer --- */
.footer { padding: 2rem; text-align: center; color: var(--secondary-text-color); font-size: 0.875rem; margin-top: auto; }

/* --- Notification Prompt Banner (New) --- */
#notification-prompt-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3436;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 0.95rem;
    animation: popupFadeIn 0.3s forwards;
}
#notification-prompt-banner .prompt-buttons { display: flex; gap: 10px; }
#notification-prompt-banner button { border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background-color 0.2s; }
#notification-prompt-banner #prompt-allow { background-color: #007AFF; color: white; }
#notification-prompt-banner #prompt-allow:hover { background-color: #0056b3; }
#notification-prompt-banner #prompt-dismiss { background-color: #555; color: white; }
#notification-prompt-banner #prompt-dismiss:hover { background-color: #777; }

/* --- 날씨 알림 배너 --- */
#weather-alert-banner {
    display: none; /* 초기에는 숨김 */
    padding: 1rem 1.5rem;
    background-color: #eef2f7;
    border: 1px solid #d1dce8;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
#weather-alert-banner p {
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
}
#weather-alert-banner i {
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 1.2rem;
}
#weather-alert-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0 0.5rem;
}

/* --- Responsive --- */
#sidebar-toggle { display: none; position: fixed; top: 15px; left: 15px; z-index: 1001; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; font-size: 1.2rem; color: var(--primary-color); }

@media (max-width: 992px) {
    .container { max-width: 100%; }
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    body { 
        display: block; 
        height: auto; 
        overflow-y: auto; 
        overflow-x: hidden; 
    }
    .main-content { padding: 1rem; padding-top: 60px; overflow-y: visible; }
    #sidebar { position: fixed; transform: translateX(-100%); height: 100%; z-index: 1000; }
    #sidebar.open { transform: translateX(0); }
    #sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    #notification-prompt-banner { width: 90%; flex-direction: column; text-align: center; gap: 15px; bottom: 10px; }
    .service-section { margin-bottom: 1.5rem; }
    .shortcut-prompt { margin-top: 1rem; padding: 1.5rem 0;}
    .header { margin-bottom: 1.5rem;}
}

/* ⬇️ [신규] "도서관 열람실 현황" 카드 디자인 CSS ⬇️ */
.library-section {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 20px; /* 상단 로고와의 간격 */
    margin-bottom: 20px; /* 공지사항 카드와의 간격 */
}
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.library-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--main-text-color);
}
.library-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px; /* 최대 높이 (필요시 조절) */
    overflow-y: auto;
}
.library-list li {
    padding: 12px 5px;
    border-bottom: 1px solid var(--border-color);
}
.library-list li:last-child {
    border-bottom: none;
}
.library-list .room-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.library-list .room-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--main-text-color);
}
.library-list .seat-count {
    font-size: 0.9rem;
    font-weight: 600;
}
.library-list .seat-count .current {
    color: #007bff; /* 사용 중 좌석 (파란색) */
    font-size: 1.05rem;
}
.library-list .seat-count .total {
    color: var(--secondary-text-color);
}
.library-list .progress-bar {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.library-list .progress {
    height: 100%;
    background-color: #007bff; /* 진행률 (파란색) */
    width: 0%; /* JS에서 채워짐 */
    transition: width 0.5s ease;
}