/**
 * 공통 네비게이션 스타일
 * navigation.js와 함께 사용
 * v2.0 - 모던 글래스모피즘 디자인
 */

/* ========================================
   메인 네비게이션 바
   ======================================== */
.navbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    margin: 10px;
    margin-bottom: 20px;
    box-shadow:
        0 4px 24px rgba(102, 126, 234, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* 로고/브랜드 영역 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 20px;
    margin-right: 10px;
    border-right: 2px solid rgba(102, 126, 234, 0.15);
}

.nav-brand-icon {
    font-size: 24px;
}

.nav-brand-text {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   네비게이션 아이템
   ======================================== */
.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #4a5568;
    text-decoration: none;
    background: transparent;
    border: none;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    transform: translateY(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    box-shadow:
        0 4px 12px rgba(102, 126, 234, 0.4),
        0 2px 4px rgba(102, 126, 234, 0.2);
}

.nav-item .icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.nav-item:hover .icon {
    transform: scale(1.1);
}

/* 드롭다운 화살표 */
.nav-dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 6px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-toggle::after {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}

/* ========================================
   드롭다운 메뉴
   ======================================== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown.has-active > .nav-dropdown-toggle {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    box-shadow:
        0 10px 40px rgba(102, 126, 234, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.1);
    z-index: 1000;
    padding: 8px;
    padding-top: 16px;
    overflow: visible;
}

/* 드롭다운 연결 영역 (마우스 이동 시 끊김 방지) */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
}

/* 드롭다운 화살표 (삼각형) */
.nav-dropdown-menu::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-right: none;
    border-bottom: none;
    transform: translateX(-50%) rotate(45deg);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
    animation: dropdownSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 드롭다운 아이템 */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #4a5568;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    margin: 2px 0;
}

.nav-dropdown-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
    color: #667eea;
    transform: translateX(4px);
}

.nav-dropdown-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-dropdown-item.active .icon {
    transform: scale(1.1);
}

/* ========================================
   조달관리 서브탭
   ======================================== */
.procurement-tabs {
    display: flex;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 6px;
    margin: 0 10px;
    gap: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.procurement-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.procurement-tab .icon {
    font-size: 16px;
}

.procurement-tab:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #475569;
}

.procurement-tab.active {
    background: white;
    color: #667eea;
    font-weight: 700;
    box-shadow:
        0 2px 8px rgba(102, 126, 234, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 활성 탭 인디케이터 */
.procurement-tab.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

/* 조달관리 탭 컨테이너 */
#procurement-tabs-container {
    margin-top: -10px;
    margin-bottom: 20px;
}

/* ========================================
   네비게이션 컨테이너
   ======================================== */
#navbar-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg,
        rgba(102, 126, 234, 0.03) 0%,
        transparent 100%);
    padding-top: 5px;
}

/* ========================================
   반응형 디자인
   ======================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 12px;
        gap: 4px;
        margin: 8px;
        border-radius: 12px;
        flex-wrap: wrap;
    }

    .nav-brand {
        width: 100%;
        padding-right: 0;
        margin-right: 0;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-right: none;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
        justify-content: center;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    .nav-dropdown-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 20px;
        width: auto;
        transform: none;
        border-radius: 16px;
        padding: 12px;
    }

    .nav-dropdown-menu::before {
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-dropdown-item {
        padding: 14px 16px;
        border-radius: 12px;
    }

    /* 모바일 조달관리 탭 */
    .procurement-tabs {
        margin: 0 8px;
        padding: 4px;
        border-radius: 10px;
    }

    .procurement-tab {
        padding: 10px 8px;
        font-size: 12px;
        border-radius: 6px;
    }

    .procurement-tab .icon {
        font-size: 14px;
    }

    .procurement-tab.active::after {
        width: 30%;
        height: 2px;
        bottom: -4px;
    }
}

/* ========================================
   다크모드 지원 (선택적)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* 필요시 다크모드 스타일 추가 */
}

/* ========================================
   애니메이션 & 트랜지션
   ======================================== */
.nav-item,
.nav-dropdown-item,
.procurement-tab {
    will-change: transform, background-color;
}

/* 포커스 스타일 (접근성) */
.nav-item:focus-visible,
.nav-dropdown-item:focus-visible,
.procurement-tab:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
