/* --- 기본 스타일 초기화 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    background-color: #f4f7f6;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- 전체 레이아웃 컨테이너 --- */
.main-container {
    display: flex;
    height: 100vh;
}

/* --- 좌측 프레임 (네비게이션) --- */
.left-frame {
    width: 240px;
    flex-shrink: 0;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative; /* [신규] 모바일 메뉴의 위치 기준점 */
}

.left-frame .logo {
    font-size: 1.6em;
    font-weight: bold;
    text-align: center;
    padding: 10px 20px;
    margin-bottom: 30px;
}

.left-frame .logo a:hover {
    color: #3498db;
}

.left-frame .nav-menu li {
    margin: 0 15px 10px;
}

.left-frame .nav-menu a {
    display: block;
    padding: 12px 20px;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
    font-size: 1em;
}

.left-frame .nav-menu a:hover,
.left-frame .nav-menu a.active {
    background-color: #34495e;
    color: #ffffff;
}

/* [신규] 햄버거 메뉴 버튼 기본 스타일 (PC에서는 숨김) */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    padding: 8px;
}
.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #ecf0f1;
    border-radius: 3px;
}


/* --- 메인 콘텐츠 영역 --- */
.content-wrapper {
    flex-grow: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

.content-wrapper h1, .content-wrapper h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* --- 테이블 스타일 --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

thead th {
    background-color: #34495e;
    color: #ffffff;
    font-weight: bold;
}

tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

tbody tr:hover {
    background-color: #e9ecef;
}

table a {
    color: #3498db;
    font-weight: bold;
}
table a:hover {
    text-decoration: underline;
}

/* --- [신규] 기타 공용 컴포넌트 --- */
.btn-primary {
    display: inline-block;
    padding: 10px 15px;
    background-color: #3498db; /* 다른 파란색 버튼과 통일감을 위해 수정 */
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em; /* 다른 버튼과 크기 조절 */
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* ================== [신규] 보조 버튼 스타일 추가 ================== */
.btn-secondary {
    display: inline-block;
    padding: 10px 15px;
    background-color: #7f8c8d; /* 회색 계열 */
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #6c7a7d;
}
/* ============================================================= */

/* --- 반응형 디자인을 위한 미디어 쿼리 --- */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }

    .left-frame {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
    }

    .left-frame .logo {
        margin-bottom: 0;
    }

    /* [수정] 모바일에서 햄버거 버튼 보이기 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* [수정] 모바일에서 메뉴 숨기기 및 스타일링 */
    .left-frame .nav-menu {
        display: none; /* 평소에는 메뉴를 숨깁니다. */
        position: absolute; /* 헤더 바 아래에 오버레이처럼 표시 */
        top: 100%; /* 헤더 바 바로 아래에 위치 */
        left: 0;
        width: 100%;
        background-color: #34495e; /* 메뉴 배경색 */
        padding: 10px 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    /* [신규] JS에 의해 is-open 클래스가 추가되면 메뉴를 보여줍니다. */
    .left-frame .nav-menu.is-open {
        display: block;
    }

    .left-frame .nav-menu li {
        margin: 0;
    }

    .left-frame .nav-menu a {
        padding: 12px 20px;
        text-align: center;
        border-radius: 0;
        border-bottom: 1px solid #4a5558;
    }
    .left-frame .nav-menu li:last-child a {
        border-bottom: none;
    }

    .content-wrapper {
        padding: 20px;
    }
}
