/**
 * D-QUANT 9.0 - 공통 네비게이션 스타일
 * 모든 페이지에서 동일한 네비게이션 UI 제공
 * 
 * @version 1.0.0
 * @date 2026-03-08
 */

/* ============================================
   NAVIGATION STYLES
   ============================================ */

/* Navigation */
.glass-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--cyan-glow, #00f2ff);
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s;
    flex-shrink: 0;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    flex: 1;
    margin-left: 3rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-secondary, rgba(255,255,255,0.7));
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--cyan-glow, #00f2ff);
}

/* 기본 메뉴 (디퀀트나인, D.Insight, 투자운용 시뮬레이션) - 언더라인 효과 */
.nav-links li:nth-of-type(1) a::after,
.nav-links li:nth-of-type(2) a::after,
.nav-links li:nth-of-type(3) a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cyan-glow, #00f2ff);
    transition: width 0.3s ease;
}

.nav-links li:nth-of-type(1) a:hover::after,
.nav-links li:nth-of-type(2) a:hover::after,
.nav-links li:nth-of-type(3) a:hover::after,
.nav-links li:nth-of-type(1) a.active::after,
.nav-links li:nth-of-type(2) a.active::after,
.nav-links li:nth-of-type(3) a.active::after {
    width: 100%;
}

/* 4번째 li (나의 자산) - 시안/녹색 그라데이션 */
.nav-links li:nth-of-type(4) a {
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0,242,255,0.1), rgba(16,185,129,0.1));
    position: relative;
    overflow: hidden;
}

.nav-links li:nth-of-type(4) a::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00f2ff, #10b981, #00f2ff, #10b981);
    background-size: 300% 300%;
    border-radius: 8px;
    z-index: -1;
    animation: shimmerBorder 3s ease-in-out infinite;
    opacity: 0.8;
}

.nav-links li:nth-of-type(4) a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 2s ease-in-out infinite;
}

.nav-links li:nth-of-type(4) a:hover {
    color: var(--cyan-glow, #00f2ff);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,242,255,0.4);
}

.nav-links li:nth-of-type(4) a i {
    margin-right: 0.5rem;
}

/* 5번째 li (나의 정보) - 보라색 그라데이션 */
.nav-links li:nth-of-type(5) a {
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(147,51,234,0.1), rgba(168,85,247,0.1));
    position: relative;
    overflow: hidden;
}

.nav-links li:nth-of-type(5) a::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #9333EA, #A855F7, #9333EA, #A855F7);
    background-size: 300% 300%;
    border-radius: 8px;
    z-index: -1;
    animation: shimmerBorder 3s ease-in-out infinite;
    opacity: 0.8;
}

.nav-links li:nth-of-type(5) a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 2s ease-in-out infinite;
}

.nav-links li:nth-of-type(5) a:hover {
    color: #A855F7;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(147,51,234,0.4);
}

.nav-links li:nth-of-type(5) a i {
    margin-right: 0.5rem;
}

/* 6번째 li (고객센터) - 핑크 그라데이션 */
.nav-links li:nth-of-type(6) a {
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(236,72,153,0.1), rgba(244,114,182,0.1));
    position: relative;
    overflow: hidden;
}

.nav-links li:nth-of-type(6) a::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #EC4899, #F472B6, #EC4899, #F472B6);
    background-size: 300% 300%;
    border-radius: 8px;
    z-index: -1;
    animation: shimmerBorder 3s ease-in-out infinite;
    opacity: 0.8;
}

.nav-links li:nth-of-type(6) a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 2s ease-in-out infinite;
}

.nav-links li:nth-of-type(6) a:hover {
    color: #EC4899;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(236,72,153,0.4);
}

.nav-links li:nth-of-type(6) a i {
    margin-right: 0.5rem;
}

/* 애니메이션 */
@keyframes shimmerBorder {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 100;
}

.nav-link-text {
    color: var(--text-secondary, rgba(255,255,255,0.7));
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.nav-link-text:hover {
    color: var(--cyan-glow, #00f2ff);
}

/* 로그인 상태 (logged-in 클래스) */
.nav-link-text.logged-in {
    background: linear-gradient(135deg, rgba(255,20,147,0.2), rgba(255,107,107,0.2));
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid rgba(255,20,147,0.3);
    color: #ff1493;
    font-weight: 600;
}

.nav-link-text.logged-in:hover {
    background: linear-gradient(135deg, rgba(255,20,147,0.3), rgba(255,107,107,0.3));
    box-shadow: 0 4px 15px rgba(255,20,147,0.3);
    color: #ff6b6b;
}

/* 나의 정보 아이콘 버튼 */
.btn-my-info-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(147,51,234,0.1));
    border: 2px solid transparent;
    border-radius: 50%;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    text-decoration: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-my-info-icon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #A855F7, #9333EA, #A855F7, #9333EA);
    background-size: 300% 300%;
    border-radius: 50%;
    z-index: -1;
    animation: shimmerBorder 3s ease-in-out infinite;
    opacity: 0.8;
}

.btn-my-info-icon:hover {
    color: #A855F7;
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 5px 20px rgba(147,51,234,0.4);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary, #ffffff);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
    position: relative;
}

.mobile-menu-toggle:hover {
    color: var(--cyan-glow, #00f2ff);
}

.mobile-menu-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-primary, #ffffff);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
        margin-left: 2rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .nav-actions {
        gap: 0.75rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        height: 70px;
    }
    
    .nav-brand {
        font-size: 1.25rem;
    }
    
    /* Hide desktop nav links */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px 2rem 2rem;
        margin: 0;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-links a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        font-size: 1rem;
    }
    
    .nav-links a:hover {
        background: rgba(0, 242, 255, 0.1);
    }
    
    /* Reset nth-child specific styles for mobile */
    .nav-links li:nth-of-type(1) a::after,
    .nav-links li:nth-of-type(2) a::after,
    .nav-links li:nth-of-type(3) a::after {
        display: none;
    }
    
    .nav-links li:nth-of-type(4) a,
    .nav-links li:nth-of-type(5) a,
    .nav-links li:nth-of-type(6) a {
        border: none;
        background: rgba(0, 242, 255, 0.05);
    }
    
    .nav-links li:nth-of-type(4) a::before,
    .nav-links li:nth-of-type(5) a::before,
    .nav-links li:nth-of-type(6) a::before,
    .nav-links li:nth-of-type(4) a::after,
    .nav-links li:nth-of-type(5) a::after,
    .nav-links li:nth-of-type(6) a::after {
        display: none;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu-close {
        display: block;
    }
    
    /* Hide desktop-only items in mobile nav */
    .nav-actions .nav-link-text {
        display: none;
    }
    
    .nav-actions .btn-my-info-icon {
        display: none;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
        height: 60px;
    }
    
    .nav-brand {
        font-size: 1.1rem;
        gap: 0.5rem;
    }
    
    .nav-brand i {
        font-size: 1.25rem;
    }
    
    .nav-links {
        width: 260px;
        padding: 70px 1.5rem 1.5rem;
    }
}
