/* ===== Header Styles ===== */
/* 상단 네비게이션 헤더 스타일 */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-inner {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    padding: 20px 0 !important;
    height: var(--header-height, 70px);
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.header-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: relative;
}

@media (min-width: 1280px) {
    :root {
        --header-height: 80px;
    }

    .header-inner {
        padding: 25px 0 !important;
    }

    .header-container {
        justify-content: flex-start;
        gap: 0;
    }
}

/* ===== Logo Section ===== */
.header-logo {
    flex-shrink: 0;
    margin-left: 0;
}

@media (min-width: 1280px) {
    .header-logo {
        margin-right: auto;
        margin-left: 100px;
    }
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    height: 22px;
    width: auto;
    object-fit: contain;
}

/* ===== Navigation Menu (Desktop) ===== */
.header-nav {
    display: none;
    flex: 1;
    justify-content: center;
    align-items: center;
    margin: 0 24px;
}

@media (min-width: 1280px) {
    .header-nav {
        display: flex;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        flex: none;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    height: 100%;
    color: var(--white);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 10px 0; /* balanced vertical padding for center alignment */
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center; /* vertically center trigger text */
    padding-bottom: 0;
}

/* Hover bridge under parent item to keep dropdown open while moving cursor */
.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0; /* disable bridge to avoid blocking sibling hover */
    background: transparent;
    pointer-events: none;
}

.has-submenu .nav-submenu-label {
    display: inline-flex;
    align-items: center;
    height: 100%;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 0; /* align with nav-link vertical padding */
    color: var(--white);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.has-submenu .nav-submenu-label:hover {
    color: var(--primary-color);
}

.nav-chevron {
    display: none;
}

.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #111014; /* make submenu background fully opaque */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
    padding: 10px 0;
    z-index: 9999; /* ensure dropdown stays above other UI including progress bar */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.has-submenu:hover .nav-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Hover bridge to prevent flicker when moving into submenu */
.nav-submenu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 24px;
    background: transparent;
    pointer-events: none;
}

.nav-submenu-link {
    display: block;
    padding: 10px 16px;
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-submenu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-color);
}

/* ===== Header Actions (Right Section) ===== */
.header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Hamburger Button (Mobile) */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 32px;
    height: 32px;
    gap: 4px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 102;
}

@media (min-width: 1280px) {
    .hamburger-btn {
        display: none;
    }
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
    flex-shrink: 0;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hamburger-btn:hover span {
    background: var(--primary-color);
}

/* ===== Mobile Menu Overlay ===== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding-top: 80px;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
}

.mobile-nav-link {
    color: var(--white);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: block;
}

.mobile-nav-link:hover {
    color: var(--primary-color);
    padding-left: 16px;
    border-bottom-color: var(--primary-color);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 2;
}

.mobile-menu-close span {
    position: absolute;
    width: 18px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.mobile-menu-close span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-close span:last-child {
    transform: rotate(-45deg);
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mobile-menu-close:hover span {
    background: var(--accent-color);
}

/* ===== Header Scroll Effect ===== */
.site-header.scrolled .header-inner {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* ===== Section Padding Adjustment ===== */
/* Add padding-top to sections to account for fixed header */
.section {
    padding-top: calc(var(--header-height, 70px) + 20px);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 1279px) {
    .header-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        gap: 32px;
    }
    
    .nav-link {
        font-size: 18px;
    }

    .nav-submenu {
        left: 0;
        transform: none;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .header-inner {
        padding: 15px 0 !important;
    }

    .header-container {
        padding: 0 16px;
    }
    
    .logo-image {
        height: 18px;
    }
    
    .hamburger-btn {
        width: 32px;
        height: 32px;
        padding: 5px;
        gap: 3px;
    }
    
    .hamburger-btn span {
        height: 2.5px;
    }
    
    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    
    .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-item.has-submenu .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: var(--white);
    font-size: 18px;
    font-weight: 500;
    padding: 12px 0;
    text-align: left;
    cursor: pointer;
}

.mobile-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.mobile-nav-item.open .mobile-chevron {
    transform: rotate(-135deg);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent; /* remove background color in mobile submenu area */
    border: none;
    margin: 4px 0 8px;
    padding: 4px 0;
}

.mobile-submenu-link {
    display: block;
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    padding: 10px 0 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-submenu-link:hover {
    color: var(--primary-color);
}

.mobile-submenu-link:last-child {
    border-bottom: none;
}

/* ===== Animation Support ===== */
/* For potential future animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flipLeft {
    from {
        transform: rotateY(-90deg);
        opacity: 0;
    }
    to {
        transform: rotateY(0);
        opacity: 1;
    }
}

@keyframes flipUp {
    from {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    to {
        transform: rotateX(0);
        opacity: 1;
    }
}

/* Apply animations to elements if needed */
.header-logo {
    animation: flipLeft 0.7s ease;
}

.nav-link {
    animation: fadeInLeft 0.7s ease;
}

.hamburger-btn {
    animation: flipUp 0.7s ease;
}

