/* ===================================================================
   공통 네비게이션 바 스타일
   메인 페이지와 서브 페이지에서 공용으로 사용
   =================================================================== */

/* ===================================================================
   네비게이션 바
   =================================================================== */

/* 네비게이션 바 기본 스타일 */
#navbar {
    position: fixed;      /* 화면 상단에 고정 */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;       /* 다른 요소 위에 표시 */
    transition: all 0.3s ease;  /* 스크롤 시 부드러운 전환 */
}

/* 스크롤 시 적용되는 스타일 (JavaScript에서 .scrolled 클래스 추가) */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);  /* 반투명 흰색 배경 */
    backdrop-filter: blur(10px);            /* 배경 블러 효과 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);  /* 약한 그림자 */
}

/* 네비게이션 내부 컨테이너 */
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;              /* flexbox 레이아웃 */
    justify-content: space-between;  /* 양 끝 정렬 */
    align-items: center;        /* 수직 중앙 정렬 */
}

/* 로고 스타일 */
.logo {
    font-size: 1.75rem;
    font-weight: 400;          /* 얇은 폰트 */
    letter-spacing: 0.15em;    /* 글자 간격 넓게 */
    color: white;
    transition: color 0.3s ease;
}

/* 스크롤 시 로고 색상 변경 */
#navbar.scrolled .logo {
    color: #0a0a0a;
}

/* 네비게이션 링크 컨테이너 */
.nav-links {
    display: flex;
    gap: 2rem;  /* 링크 간 간격 */
}

/* 개별 네비게이션 링크 */
.nav-link {
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease, color 0.3s ease;
}

/* 링크 호버 효과 */
.nav-link:hover {
    opacity: 0.7;
}

/* 스크롤 시 링크 색상 변경 */
#navbar.scrolled .nav-link {
    color: #0a0a0a;
}

/* 로그인 버튼 */
.login-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;     /* 완전한 둥근 모서리 */
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.2);  /* 반투명 배경 */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 스크롤 시 로그인 버튼 스타일 */
#navbar.scrolled .login-btn {
    background: #0a0a0a;
    color: white;
    border-color: #0a0a0a;
}

#navbar.scrolled .login-btn:hover {
    background: #262626;
}

/* ===================================================================
   사용자 정보 영역 (로그인 후 표시)
   =================================================================== */

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 사용자 이름 */
.user-name {
    font-size: 0.875rem;
    color: white;
    font-weight: 400;
}

#navbar.scrolled .user-name {
    color: #0a0a0a;
}

/* 로그아웃 버튼 */
.logout-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#navbar.scrolled .logout-btn {
    background: transparent;
    color: #0a0a0a;
    border-color: #0a0a0a;
}

#navbar.scrolled .logout-btn:hover {
    background: #f5f5f5;
}

/* 모바일 메뉴 버튼 (기본적으로 숨김, 768px 이하에서 표시) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* 햄버거 메뉴 막대 */
.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

/* 스크롤 시 햄버거 메뉴 색상 변경 */
#navbar.scrolled .mobile-menu-btn span {
    background: #0a0a0a;
}

/* 메뉴 활성화 시 X 모양으로 변경 */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===================================================================
   모바일 메뉴 스타일
   =================================================================== */

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.mobile-menu-header .mobile-logo {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #0a0a0a;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #525252;
    transition: color 0.3s ease;
}

.mobile-menu-close:hover {
    color: #0a0a0a;
}

.mobile-menu-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #0a0a0a;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.mobile-nav-link:hover {
    background: #f5f5f5;
}

.mobile-nav-link svg {
    color: #525252;
}

.mobile-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.mobile-login-btn {
    width: 100%;
    padding: 1rem;
    background: #0a0a0a;
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mobile-login-btn:hover {
    background: #262626;
}

/* ===================================================================
   반응형 디자인 (모바일)
   =================================================================== */

/* 768px 이하 화면 (태블릿, 모바일) */
@media (max-width: 768px) {
    /* 네비게이션 컨테이너 조정 */
    .nav-container {
        padding: 1rem 1.5rem;
    }

    /* 데스크톱 네비게이션 링크 숨김 */
    .nav-links {
        display: none !important;
    }

    /* 데스크톱 로그인 버튼 숨김 */
    .login-btn {
        display: none !important;
    }

    /* 사용자 정보 영역도 모바일에서는 숨김 */
    .user-info {
        display: none !important;
    }

    /* 모바일 메뉴 버튼 표시 */
    .mobile-menu-btn {
        display: flex !important;
    }
}