* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: transform 0.5s ease-out;
    z-index: 1000;
    height: 11vh;
}

.navbar.hidden {
    transform: translateY(-110%);
}

.nav-container {
    max-width: 100%;
    margin: 0 1%;
    padding: 0;
    display: flex;
    justify-content:space-between;
    align-items: center;
    height: 100%;
    /* border: solid#eee; */
}


.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    text-align: center;
    color: #333;
    /* font-size: clamp(1.2rem, 3vw, 1.5rem); */
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 600;
    gap: 1vw;
}

.logo img {
    height: 80px;
    width: auto;
    object-fit: contain;
    padding: 5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0 3%;
    gap: 3vw;  
}

.nav-item {
    position: relative;
    display: flex;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    font-weight: 600;
}

/* 메뉴 링크 스타일 */
.nav-link {
    text-decoration: none;
    color: #333;
    padding: 10px;
    display: block;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #007bff;
}

/* 드롭다운 메뉴 스타일 */
.dropdown {
    position:absolute;
    top: 100%;
    left: -45px;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none;
    border-radius: 4px;
    overflow: hidden;
}

/* 메뉴 아이템에 마우스를 올렸을 때 드롭다운 표시 */
.nav-item:hover .dropdown {
    display: block;
}

/* 드롭다운 메뉴 아이템 스타일 */
.dropdown-item {
    padding: 12px 15px;
    display: block;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
    text-align: center;
}

/* 드롭다운 메뉴 아이템 호버 효과 */
.dropdown-item:hover {
    background-color: #f5f5f5;
}

.menu-toggle {
    display: none;
}

@media screen and (max-width: 768px) {
    .navbar{
        height: 10vh;
    }
    .logo {
        font-size: clamp(1rem, 2vw, 1.25rem);
    }
    .logo img{
        height: 65px;
    }
    .nav-menu {
        display:none;
        padding:0;
    }

    .nav-container {
        margin:0;
        padding: 0 20px;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #333;
        margin: 5px 0;
        transition: 0.3s;
    }

    /* 햄버거 메뉴 애니메이션 */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* 모바일 메뉴가 열렸을 때 스타일 */
    .nav-menu.active {
        display: flex;
        position: absolute;
        top: 70px;
        right: 0;
        width: 40%;
        background-color: white;
        flex-direction: column;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        gap:0;
    }

    .nav-menu.active .nav-item {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
        /* border:solid#333; */

    }

    .nav-menu.active .nav-link {
        width: 100%;
        display: block;
        padding:0;
    }

    .nav-item {
        position: relative;
        width: 100%;
    }
    
    .dropdown {
        position: static; /* 절대 위치에서 정적 위치로 변경 */
        display: none;
        width: 100%;
        box-shadow: none;
        background-color: #f8f8f8;
        min-width: 100%;
        left: 0;
    }

    .nav-item.active .dropdown {
        display: block;
    }
    
    /* 드롭다운 아이템 스타일 조정 */
    .dropdown-item {
        padding: 10px 20px;
        text-align: center;
    }
    .nav-item:hover .dropdown {
        display: none;
    }
    
    /* active 클래스로만 드롭다운 표시되도록 설정 */
    .nav-item.active .dropdown {
        display: block;
    }
    
    /* 드롭다운 위치와 스타일 개선 */
    .dropdown {
        position: static;
        left: 0;
        min-width: 100%;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        background-color: #f5f5f5;
        margin-top: 5px;
    }
    
    /* 드롭다운 아이템 스타일 */
    .dropdown-item {
        padding: 10px 0;
        border-top: 1px solid #e0e0e0;
    }
    
    /* Program 메뉴 내부의 드롭다운 항목들을 명확히 구분 */
    .nav-menu.active .nav-item.active {
        padding-bottom: 0;
    }
}
/* 데스크톱과 모바일 사이 중간 크기 대응 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .logo {
        /* font-size:clamp(1rem, 4vw, 1.35rem); */
        font-size: clamp(1.125rem, 2vw, 1.5rem);
    }
    .nav-item {
        /* font-size:clamp(0.55rem, 3vw, 0.9rem); */
        font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    }

    .nav-menu{
        gap: 1.5rem;
    }
    .nav-container {
        padding: 0 3%;
    }

    .dropdown {
        min-width: 180px;
    }
}