/* 공통 헤더 스타일 - Land.me */

/* CSS 변수 정의 */
:root {
    --primary-color: #3498db;
    --primary-hover-color: #2980b9;
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --border-color: #e9ecef;
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --shadow-light: rgba(0, 0, 0, 0.1);
}

/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Land.me 상단 네비게이션 스타일 */
.top-nav {
    background: var(--bg-white);
    box-shadow: 0 2px 4px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 9998;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* 로고 스타일 */
.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--primary-color);
}

.logo i {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 28px;
}

/* 메뉴 스타일 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 0;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* 우측 메뉴 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 사용자 메뉴 스타일 */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 9999;
}

.loading-user {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 20px;
    background: var(--bg-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 25px;
    background: var(--bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.user-info:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.user-menu.show .user-info {
    background: #e9ecef;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.user-menu.show .fa-chevron-down {
    transform: rotate(180deg) !important;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.user-grade {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

/* 회원 등급별 색상 */
.grade-f { background-color: #9ca3af; }
.grade-n { background-color: #059669; }
.grade-p { background-color: #dc2626; }
.grade-v { background-color: #7c3aed; }
.grade-s { background-color: #ea580c; }
.grade-b { background-color: #dc2626; }

/* 드롭다운 메뉴 */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    z-index: -1;
}

.user-menu.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.dropdown-menu a:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-menu a:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: #1f2937;
    transform: translateX(2px);
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.dropdown-menu a.active {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    font-weight: 600;
}

/* 구분선 */
.dropdown-menu .divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

/* 로그인 버튼 */
.login-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    color: var(--primary-color) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    /* 브라우저 다크 테마에서도 색상이 강제 적용되도록 */
    -webkit-text-fill-color: var(--primary-color) !important;
}

.login-btn:hover {
    background: var(--primary-color) !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.mobile-menu-btn:hover {
    color: var(--primary-color);
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 30px;
    }
    
    .nav-menu a {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: fixed;
        top: 40px;
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        box-shadow: 0 4px 8px var(--shadow-light);
        border-top: 1px solid var(--border-color);
        z-index: 999;
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .nav-menu a.active::after {
        display: none;
    }
    
    .nav-header {
        height: 70px; /* 고정 높이 유지 */
        padding: 10px 0;
        flex-wrap: nowrap; /* 한 줄 고정 */
    }
    
    .logo {
        order: 1;
        flex: 1; /* 남은 공간 차지 */
    }
    
    .nav-right {
        order: 2;
        display: flex;
        align-items: center;
        gap: 8px; /* 간격 축소 */
        flex-shrink: 0; /* 축소 방지 */
    }
    
    /* 모바일 로그인 버튼 - 아이콘만 표시 */
    .login-btn {
        padding: 8px;
        min-width: 40px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-btn .login-text {
        display: none; /* 텍스트 숨김 */
    }
    
    .login-btn::before {
        content: '👤'; /* 로그인 아이콘 */
        font-size: 18px;
    }
    
    /* 모바일 사용자 메뉴 - 컴팩트화 */
    .user-info {
        padding: 4px 8px;
        min-width: 40px;
        height: 33px;
        border-radius: 15px;
        gap: 5px;
    }
    
    .user-name {
        display: none; /* 사용자명 숨김 */
    }
    
    .user-grade {
        display: none; /* 등급 숨김 */
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    /* 드롭다운 화살표 작게 */
    .fa-chevron-down {
        font-size: 10px;
    }
    
    /* 햄버거 버튼 위치 조정 */
    .mobile-menu-btn {
        order: 3;
        padding: 8px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-header {
        height: 40px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .nav-right {
        gap: 10px;
    }
    
    .user-name {
        display: none;
    }
    
    .user-info {
        padding: 5px 8px;
    }
}