/* ===== 기본 구조 ===== */
.bar {
    height: 100px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease;
    background: rgba(0, 0, 0, 0.4);
}

.bar.scrolled {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
}

.bar.subpage {
    background: rgba(255, 255, 255, 0.95);
    color: #111;
}

.bar.subpage.scrolled {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
}

/* ===== topbar ===== */
.topbar {
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.topbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.topbar a {
    text-decoration: none;
    color: #333;
    background-color: #eee;
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 10px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.topbar a:hover {
    background-color: #00D7B9;
    color: #fff;
}

/* ===== navibar ===== */
.navibar {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 50px;
    position: relative;
}


/* ===== PC 메뉴 ===== */
.menubox {
    width: 100%;
    height: 100%;
    padding-top: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 1em;
    color: inherit;
}

.menu_main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0px;
    color: inherit;
}

.menu_item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 30px;
    position: relative;
}

.menu_firstname a {
    color: inherit;
    text-decoration: none;
    font-weight: bold;
    padding: 10px;
    display: block;
}

.menu_firstname a:hover {
    color: #00D7B9;
}

.menu_second {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    color: #fff;
    background-color: #222;
    border-radius: 5px;
    padding: 10px 0;
    min-width: 150px;
    flex-direction: column;
    z-index: 1002;
}

.menu_secondname {
    padding: 10px;
}

.menu_secondname a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.menu_secondname a:hover {
    color: #00D7B9;
}

.menu_item:hover .menu_second {
    display: flex;
}

.nomenu {
    color: inherit;
    font-size: 16px;
    padding-left: 20px;
}

/* ===== 햄버거 버튼 ===== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1001;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.bar.subpage .hamburger span {
    background-color: #333;
}
.bar.scrolled .hamburger span,
.bar.subpage.scrolled .hamburger span {
    background-color: #fff;
}

/* ===== 모바일 반응형 (1024px 이하) ===== */
@media (max-width: 1024px) {
    .topbar {
        display: none;
    }

    .navibar {
        flex-direction: column;
        align-items: center;
        padding: 10px 20px;
        height: auto;
    }

    .hamburger {
        display: flex;
    }

    .menubox {
        display: none;
    }
}

.mobilemenu-wrapper {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom, #111111, #222222, #333333);
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    animation: slideDown 0.4s ease forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-topbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.topline-logo {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
}

.topline-logo .logo-br {
    color: #00D7B9;
}

.topline-logo .logo-health {
    color: #FFB367;
    margin-left: 4px;
}

.menu-close {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.menu-close:hover {
    color: #00D7B9;
}

.mobile-login-box {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 0 20px;
}

.mobile-login-box a {
    flex: 1;
    display: block;
    text-align: center;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.btn-login {
    background-color: #f2f4f7;
    color: #3A3A3A;
    border: 1px solid #d0d5dd;
}

.btn-login:hover {
    background-color: #e4e8ed;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn-join {
    background-color: #3A86FF;
    color: #fff;
    border: none;
}

.btn-join:hover {
    background-color: #2F6EDB;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-item {
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 10px 0;
}

.mobile-menu-title {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.mobile-submenu {
    display: none;
    flex-direction: column;
    padding-left: 15px;
    margin-top: 5px;
}

.mobile-submenu a {
    color: #ccc;
    text-decoration: none;
    font-size: 16px;
    padding: 6px 0;
}

.mobile-submenu a:hover {
    color: #00D7B9;
}

.mobile-menu-item.open .mobile-submenu {
    display: flex;
}

.mobile-menu-item.open .mobile-menu-arrow {
    transform: rotate(180deg);
}

.mobile-sns-icons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mobile-sns-icons .sns-icon {
    width: 40px;
    height: 40px;
    border: 2px solid #888;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ccc;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-sns-icons .sns-icon:hover {
    background-color: #00D7B9;
    border-color: #00D7B9;
    color: #fff;
}

.mobile-menu-title a {
    color: inherit !important;
    text-decoration: none !important;
}