/*header*/
.main {
    background-color: #fff;
}

.main header {
    /*position:fixed; top:0; left:0;*/
    z-index: 100;
    width: 100%;
    /* height:120px; background:#fff; background:url('../images/common/bg_header.png') repeat-x left top;*/
}

.sub {
    background-color: #fff;
}

.sub header {
    z-index: 100;
    width: 100%;
}

header .toputil_wrap {
    background-color: #fff;
    border-bottom: 1px solid #E0E1EA;
    height: 60px;
}

header .toputil {
    /* width: 1180px; */
    font-size: 14px;
    font-weight: 500;
    margin: 0 auto;
}

header .toputil::after {
    clear: both;
    content: "";
}

header .toputil .toputil_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .toputil .toputil_box ul {
    display: flex;
    align-items: center;
    margin-left: auto;
    /* 핵심: 오른쪽 끝으로 밀기 */
    height: 60px;
    overflow: hidden;
}

header .header {
    /* position: relative; */
    /* width: 1180px; */
    /* margin: auto; */
    z-index: 5;
    /* left: 35px; */
    /* height: 100px; */
}

header .header h1 {
    position: absolute;
    left: 35px;
}

header .header h1 a {
    display: inline-block;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

header a.btn_logo img {
    height: 128px;
}

header .header h1 a.btn_home {
    vertical-align: top;
    padding-top: 14px;
    padding-left: 1px;
    width: 200px;
    color: #000;
    font-size: 1.1rem;
}

/*menu*/
.menu_btn {
    display: none;
}

#menu {
    display: none;
}

#gnb {
    position: relative;
    z-index: 50;
    top: 0;
    float: none;
    /* flex 내부에서는 float 제거 */
}

#gnb::after {
    display: block;
    clear: both;
    content: "";
}

#gnb .dep1 {
    display: flex;
    align-items: center;
    /* gap: 15px; */
}

#gnb .dep1>li::before {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0px;
    background-color: #fff;
    content: "";
    -webkit-transition: height 0.2s;
    transition: height 0.2s;
}

#gnb .dep1>li {
    position: relative;
    float: left;
    padding: 0 30px;
}

#gnb .dep1>li>a {
    display: block;
    text-align: center;
    text-decoration: none;
}

#gnb .dep1>li>a>span {
    display: flex;
    align-items: center;
    position: relative;
    vertical-align: top;
    font-size: 21.5px;
    width: 100%;
    line-height: 1;
    font-weight: 700;
    color: #1F2024;
}

#gnb .dep1>li>a>span::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0px;
    height: 4px;
}

#gnb .dep1>li>a:hover span,
#gnb .dep1>li>a:active span {
    color: #1C57EF;
}

/* 드롭다운이 열려있을 때 메인 메뉴 항목도 활성화 상태 유지 */
#gnb .dep1>li:hover>a span {
    color: #1C57EF;
}

#gnb .dep1>li>.dep2 {
    position: absolute;
    top: 100%;
    width: 200px;
    min-width: 200px;
    padding: 8px 0;
    z-index: 10001;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #E0E1EA;
    margin-top: 10px;
    background: #fff;
    display: none;
}

/* 호버 시 .dep2 드롭다운 메뉴 표시 */
#gnb .dep1>li:hover>.dep2 {
    display: block !important;
}

#gnb .dep1>li>ul.ov {
    background: #fff;
    display: none;
    position: absolute;
    top: 100%;
    width: 200px;
    min-width: 200px;
    padding: 8px 0;
    z-index: 10001;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #E0E1EA;
    margin-top: 10px;
}

/* 드롭다운과 메인 메뉴 사이의 보이지 않는 연결 영역 */
#gnb .dep1>li>ul.ov::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

/* 호버 시 드롭다운 메뉴 표시 */
#gnb .dep1>li:hover>ul.ov {
    display: block !important;
}

/* .ov 드롭다운 메뉴 호버 시에도 유지 */
#gnb .dep1>li>ul.ov:hover {
    display: block !important;
}

/* 드롭다운 메뉴의 가상 요소에도 호버 적용 */
#gnb .dep1>li>ul.ov::before:hover {
    display: block !important;
}

/* 메인 메뉴 항목이 호버 상태일 때 드롭다운 유지 */
#gnb .dep1>li:hover>ul.ov,
#gnb .dep1>li>ul.ov:hover {
    display: block !important;
}

#gnb .dep1>li>.dep2>li:last-child {
    display: block;
}

#gnb .dep1>li>.dep2 li,
#gnb .dep1>li>ul.ov li {
    float: none;
    width: 100%;
    margin: 0;
}

#gnb .dep1>li>.dep2 li a,
#gnb .dep1>li>ul.ov li a {
    display: block;
    vertical-align: top;
    font-size: 17px;
    line-height: 1.4;
    height: auto;
    padding: 10px 16px;
    color: #1F2024;
    text-align: left;
    letter-spacing: -0.5px;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0;
    text-decoration: none;
}

/* .dep2 드롭다운 메뉴 호버 시에도 유지 */
#gnb .dep1>li>.dep2:hover {
    display: block !important;
}

/* .dep2 드롭다운과 메인 메뉴 사이의 보이지 않는 연결 영역 */
#gnb .dep1>li>.dep2::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

#gnb .dep1>li>.dep2 li a strong {
    font-weight: normal;
}

#gnb .dep1>li>.dep2 li a:hover,
#gnb .dep1 li .dep2 li a:active,
#gnb .dep1 li .dep2 li a.ov,
#gnb .dep1>li>ul.ov li a:hover,
#gnb .dep1>li>ul.ov li a:active {
    background-color: #F8F9FA;
    color: #1C57EF;
    text-decoration: none;
}

#gnb .dep1 li:hover::before,
#gnb .dep1 li.active::before {
    height: 80px;
}

#gnb .dep1 li:hover>a,
#gnb .dep1 li:active>a {
    color: #1C57EF;
    transition: color 0.2s;
    -webkit-transition: color 0.2s;
}

/********** Media quary **********/

@media screen and (max-width: 1019px) {

    /* header */
    .sub header {
        height: 110px;
    }

    header .toputil {
        position: relative;
        width: 100%;
        height: 40px;
        font-size: 13px;
        margin: 0 auto;
    }

    header .toputil .toputil_box {
        /* float: right; */
        padding-right: 20px;
    }

    header .header {
        min-width: 320px;
        width: 100%;
    }

    header .header h1 {
        position: absolute;
        left: 20px;
        top: 18px;
        margin: 0;
    }

    header .header h1 a {
        font-size: 1.2rem;
        letter-spacing: -1px;
    }

    header .header h1 a.btn_logo {
        background-size: 100%;
        top: 18px;
        width: 35px;
        background: url(../images/main/scnu.png) no-repeat left center;
    }

    .toputil_wrap {
        display: none;
    }

    #gnb {
        display: none;
    }
}

/* 언어 선택 */
.select-lang {
    color: #454752 !important;
    border: none !important;
    font-weight: 500;
}

.select-lang:focus {
    box-shadow: none !important;
}

.headerText {
    width: 5px;
    height: 5px;
    vertical-align: middle;
    margin-right: 4px;
    margin-bottom: 2px;
    display: inline-block;
}

header .toputil .toputil_box .university-links {
    border-left: 1px solid #E0E1EA;
}

header .toputil .toputil_box .university-links li a {
    color: #006DB3;
    font-weight: 600;
}

/* 왼쪽 */
header .toputil .toputil_box .menu-left {
    margin-left: 35px;
}

header .toputil .toputil_box .menu-left a {
    font-weight: 700;
    color: #1C58F1;
    display: inline-block;
    text-decoration: none;
    position: relative;
    font-size: 16px;
}

/* 밑줄 강조 효과 */
header .toputil .toputil_box .menu-left a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -22px;
    /* 밑줄을 글자 아래로 더 내림 */
    transform: translateX(-50%);
    /* 중앙 정렬 */
    width: 150px;
    /* 밑줄 길이 (글자보다 짧게) */
    height: 2px;
    /* 밑줄 두께 */
    background-color: #1565FF;
}

/* 가운데: 일반 메뉴 */
header .toputil .toputil_box .menu-center ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

header .toputil .toputil_box .menu-center ul li {
    padding: 0 20px;
}

header .toputil .toputil_box .menu-center ul li a {
    color: #454752;
    font-weight: 500;
    text-decoration: none;
}

/* 오른쪽 전체 그룹 */
header .toputil .toputil_box .menu-group {
    display: flex;
    align-items: center;
    gap: 24px;
    /* menu-center와 menu-right 사이 간격 조절 (조금만 띄움) */
}

/* 오른쪽: 학교 링크 */
header .toputil .toputil_box .menu-right {
    display: flex;
    align-items: center;
}

header .toputil .toputil_box .menu-right ul li {
    padding: 0 25px;
}

.menu-wrap {
    display: flex;
    /* 가로로 나란히 배치 */
    align-items: center;
    /* 세로 중앙 정렬 */
    position: relative;
    margin-top: 50px;
    justify-content: flex-start;
    gap: 60px;
    /* left: 35px; */
    padding: 0px 35px;
    /* height: 10rem; */
    margin: auto;
    max-width: 120rem;
    margin-top: 30px;
    /* margin-bottom: 100px; */
}

.circleLine {
    width: 420px;
    height: auto;
}

/* 모바일 유틸리티 메뉴 스타일 */
.mobile-utility-menu {
    background: #f8f9fa;
    padding: 15px;
    margin-top: 80px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

/* Bootstrap 3에서 mt-5 클래스 정의 */
.mt-5 {
    margin-top: 3rem !important;
}

.mobile-utility-section h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.mobile-utility-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-utility-list li {
    margin-bottom: 10px;
}

.mobile-utility-link {
    display: block;
    padding: 10px 15px;
    color: #007bff;
    text-decoration: none;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-utility-link:hover {
    background: #e9ecef;
    color: #0056b3;
    text-decoration: none;
}

.mobile-lang-select {
    width: 100%;
    /* padding: 10px 15px; */
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

@media (max-width: 1780px) {
    .circleLine {
        display: none;
    }

    #gnb {
        margin-left: auto;
    }
}

/* 중간 화면에서 nav 최적화 */
@media (max-width: 1200px) {
    .circleLine {
        display: none;
    }
}

/* 작은 데스크톱에서 nav 최적화 */
@media (max-width: 1100px) {
    /* 
    header .toputil .toputil_box .menu-center ul li {
        padding: 0 10px;
    }
    
    header .toputil .toputil_box .menu-right ul li {
        padding: 0 15px;
    }
    
    header .toputil .toputil_box .menu-center ul li a {
        font-size: 14px;
    }
    
    header .toputil .toputil_box .menu-right ul li a {
        font-size: 14px;
    } */

    .toputil_wrap {
        display: none;
    }

    .menu-wrap {
        /* margin-top: 20px; */
        margin-bottom: 20px;
        gap: 40px;
    }

    #gnb {
        display: none;
    }

    .visible-xs {
        display: block !important;
    }

    /* 태블릿에서 nav 메뉴 항목들 최적화 */
    header .toputil .toputil_box .menu-center ul li {
        padding: 0 12px;
    }

    header .toputil .toputil_box .menu-right ul li {
        padding: 0 15px;
    }

    /* 폰트 크기 조정 */
    header .toputil .toputil_box .menu-center ul li a {
        font-size: 13px;
    }

    header .toputil .toputil_box .menu-right ul li a {
        font-size: 13px;
    }

    /* 햄버거 메뉴 버튼 표시 */
    .menu_btn {
        display: block !important;
        position: absolute;
        top: 40px;
        right: 30px;
        z-index: 1000;
        color: white;
        padding: 10px 15px;
        border-radius: 4px;
        text-decoration: none;
        font-size: 18px;
        font-weight: bold;
        transition: all 0.3s ease;
        background: fff;
    }

    .menu_btn:hover {
        color: white;
        text-decoration: none;
    }

    .menu_btn.active {
        background: #dc3545;
    }

    .menu_btn.active:hover {
        background: #c82333;
    }

    .hamburger-icon,
    .close-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        transition: all 0.3s ease;
        object-fit: contain;
    }

    /* 메뉴가 열렸을 때 아이콘 토글 - 메뉴가 펼쳐진 상태에서만 */
    #menu.open .hamburger-icon {
        display: none !important;
    }

    #menu.open .close-icon {
        display: inline-block !important;
    }

    /* 메뉴가 닫힌 상태에서는 햄버거 아이콘 표시 */
    #menu:not(.open) .hamburger-icon {
        display: inline-block !important;
    }

    #menu:not(.open) .close-icon {
        display: none !important;
    }

    /* html.open 상태에서도 처리 */
    html.open .menu_btn .hamburger-icon {
        display: none !important;
    }

    html.open .menu_btn .close-icon {
        display: inline-block !important;
        width: 20px;
        height: 20px;
    }

    html:not(.open) .menu_btn .hamburger-icon {
        display: inline-block !important;
    }

    html:not(.open) .menu_btn .close-icon {
        display: none !important;
    }

    /* menu */
    .page_cover.open {
        display: block;
    }

    #menu {
        display: block;
        width: 80%;
        height: 100%;
        position: fixed;
        top: 0px;
        right: -80%;
        border: 1px solid #c9c9c9;
        background-color: white;
        transition: All 0.2s ease;
        -webkit-transition: All 0.2s ease;
        -moz-transition: All 0.2s ease;
        -o-transition: All 0.2s ease;
    }

    #menu.open {
        right: 0px;
        overflow: scroll;
        z-index: 1000;
    }
    
    /* 메뉴가 열렸을 때 검색 인터페이스 숨기기 */
    html.open .search-interface,
    html.open .search-button,
    html.open .search-form,
    html.open .hero-right,
    html.open .illustration-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -1 !important;
        pointer-events: none !important;
    }

    .close {
        width: 44px;
        height: 44px;
        position: absolute;
        top: 8px;
        right: 8px;
        cursor: pointer;
        background: url("../images/common/gnb_close.png") no-repeat center;
        background-size: 50%;
        opacity: 0.7;
        -webkit-opacity: 0.7;
    }

    .page_cover {
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0px;
        left: 0px;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 4;
        display: none;
    }

    .hid {
        text-indent: -9999px;
        position: absolute;
        left: 0;
        top: 0;
    }

    .menu {
        z-index: 10;
        padding: 16px;
    }

    .menu .title {
        position: absolute;
        width: 100%;
        font-size: 1.4rem;
        line-height: 1.2;
        box-sizing: border-box;
        font-weight: 500;
    }

    .menu .mdep1 {
        margin-top: 20px;
    }

    .menu .mdep1>li {
        position: relative;
    }

    .menu .mdep1>li>a {
        display: block;
        position: relative;
        border-bottom: 1px solid #cecece;
        color: #222;
    }

    .menu .mdep1>li>a:hover>span {
        color: #266ed4;
        font-weight: 500;
    }

    .menu .mdep1>li>a>span {
        display: block;
        font-size: 1rem;
        line-height: 22px;
        font-weight: 500;
        padding: 14px 10px;
    }

    .menu .mdep1>li>.mdep2 {
        display: block;
        margin: 0;
        padding: 8px 0;
        border-bottom: 1px solid #cecece;
    }

    .menu .mdep1>li>.mdep2 li {
        position: relative;
    }

    .menu .mdep1>li>.mdep2 li a {
        display: block;
        font-weight: normal;
        font-size: 1rem;
        line-height: 1.4;
        padding: 8px 30px;
        border: 0 !important;
    }

    .menu .mdep1>li>.mdep2 li a:hover span {
        color: #266ed4;
        font-weight: 500;
    }

    .menu .mdep1>li>.mdep2 li a span:before {
        content: "";
        position: absolute;
        top: 17px;
        left: 15px;
        width: 5px;
        height: 5px;
        background-color: #999;
        border-radius: 3px;
    }
}

/* 모바일에서 상단 유틸리티 바 숨김 */
@media (max-width: 768px) {

    /* 모바일에서 로고와 햄버거 버튼을 같은 줄에 배치 */
    .btn_logo {
        position: absolute !important;
        top: -10px !important;
        left: 20px !important;
        /* z-index: 1001 !important; */
        width: auto !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
    }

    .btn_logo img {
        max-width: 120px !important;
        height: auto !important;
    }
}