@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --bg-color: #f8f9fa;
    --sidebar-bg: #e9ecef;
    --main-bg: #ffffff;
    --text-color: #212529;
    --text-light: #868e96;
    --border-color: #dee2e6;
    --accent-blue: #3498db;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    max-height: 800px;
    background-color: var(--main-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* --- 사이드바 --- */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    margin-bottom: 40px;
}

.window-dots .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.dot.red { background-color: #ff5f57; }
.dot.yellow { background-color: #febc2e; }
.dot.green { background-color: #28c840; }

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    padding: 0; /* padding은 a 태그로 이동 */
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.menu li:hover {
    background-color: rgba(0,0,0,0.05);
}

/* 사이드바 메뉴 링크 스타일 */
.menu li a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    padding: 15px 10px;
    width: 100%;
    box-sizing: border-box;
}

/* 링크가 없는 li 항목 스타일 */
.menu li > span {
     display: flex;
    align-items: center;
    padding: 15px 10px;
}


.menu-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.qr-codes {
    margin-top: auto;
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
}

.qr-item {
    text-align: center;
}

.qr-item img {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.qr-item span {
    font-size: 13px;
    font-weight: 500;
}

/* --- 메인 콘텐츠 --- */
.main-content {
    flex: 1;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 20px;
}

.main-header .header-icons i {
    margin-left: 15px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f1f3f5;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    margin: 0 15px;
}

.search-bar i {
    color: var(--text-light);
}

.title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.title-section h1 {
    margin: 0;
    font-size: 28px;
}

.video-button {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.video-button:hover {
    background-color: #2980b9;
}

.video-button i {
    margin-right: 8px;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    flex: 1;
}

/* 폴더를 감싸는 링크 스타일 */
.folder-link {
    text-decoration: none;
    color: inherit;
}

.folder-item {
    background-color: #e7f5ff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%; /* 링크 내에서 높이를 채우도록 설정 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.folder-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.07);
}

.folder-icon {
    font-size: 60px;
    color: #4dabf7;
    margin-bottom: 15px;
}

.folder-label {
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 동영상 모달 스타일 --- */
.modal {
    display: none; /* 기본적으로 숨김 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* 반투명 검은 배경 */
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    border-radius: 10px;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#teaserVideo {
    border-radius: 8px;
}


/* --- 반응형 디자인 --- */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
    .page-container {
        height: auto;
        max-height: none;
    }
    .folder-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .sidebar {
        width: 240px;
    }
    .main-content {
        padding: 20px;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    body {
        height: auto;
        align-items: flex-start;
    }
    .page-container {
        flex-direction: column;
        height: auto;
        border-radius: 0;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
        box-sizing: border-box;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-header, .qr-codes {
        display: none; /* 모바일에서 숨김 */
    }
    .menu ul {
        display: flex;
        overflow-x: auto; /* 메뉴가 많을 경우 스크롤 */
        padding-bottom: 10px;
    }
    .menu li {
        flex-shrink: 0; /* 아이템이 줄어들지 않도록 설정 */
        font-size: 14px;
    }
    .menu li a {
        padding: 10px 15px;
    }
    .main-content {
        padding: 20px;
    }
    .title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .folder-grid {
        grid-template-columns: 1fr; /* 1열로 변경 */
    }
    .folder-item {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        padding: 15px;
    }
    .folder-icon {
        font-size: 30px;
        margin-bottom: 0;
        margin-right: 20px;
    }
    .folder-label {
        justify-content: flex-start;
    }

    .modal-content {
        width: 90%;
        padding: 10px;
    }
}