/* Base Header Styles */
* {
    font-family: Noto Sans TC;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.new-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}   

.header .new-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding: 0 20px;
}

/* Logo */
.logo {
    flex-shrink: 0;
}

.logo img {
    height: 80px;
    width: auto;
}

/* Main Navigation */
.main-nav {
    margin-left: auto;
    margin-right: 2rem;
}

.main-nav-list {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav a {
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.main-nav a:hover {
    color: #3E8B1C;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Navigation Items and Sub-navigation */
.nav-item {
    position: relative;
}

.sub-nav {
    position: absolute;
    top: 160%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.nav-item:hover .sub-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.sub-nav a {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: #333333;
    text-decoration: none;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.sub-nav a:hover {
    background-color: #F7F6FB;
    color: #3E8B1C;
}

/* Language Selector */
.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 24px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    z-index: 1001;
}

.language-selector:hover {
    background: #F7F6FB;
}

.language-selector img {
    width: 20px;
    height: 20px;
}

.btn-language {
    font-family: Noto Sans TC;
    font-size: 1rem;
    color: #333333;
    background: none;
    border: none;
    cursor: pointer;
}
.btn-header-cta {
    font-family: Noto Sans TC;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    letter-spacing: 0.5px;
    gap: 8px;
    border: 1px solid #3E8B1C;
    color: #3E8B1C;
    background: transparent;
    padding: 12px 32px;
}
.language-popover {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.language-popover.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    color: #333333;
    transition: background-color 0.3s ease;
}

.language-option:hover {
    background-color: #F7F6FB;
    color: #3E8B1C;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
}

.hamburger img {
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}

.hamburger img[alt="close"] {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.hamburger[aria-expanded="true"] img[alt=""] {
    opacity: 0;
}

.hamburger[aria-expanded="true"] img[alt="close"] {
    opacity: 1;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 52px;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav a {
    display: block;
    padding: 1rem;
    color: #333333;
    text-decoration: none;
}

.mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    color: #333333;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
}

.mobile-nav-toggle img {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.mobile-nav-toggle[aria-expanded="true"] img {
    transform: rotate(180deg);
}

.mobile-sub-nav {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-sub-nav.active {
    display: block;
}

.mobile-sub-nav a {
    padding-left: 2rem;
    font-size: 0.9rem;
}

/* Mobile Language Selector */
.mobile-language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #DDE1E6;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-language-selector:hover {
    background-color: #F7F6FB;
}

.mobile-language-selector[aria-expanded="true"] img[alt="dropdown Icon"] {
    transform: rotate(180deg);
}

.mobile-language-selector img {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.mobile-language-options {
    display: none;
    list-style: none;
    font-size: 1rem;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #DDE1E6;
}

.mobile-language-options.active {
    display: block;
}

.mobile-language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: #333333;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
}

.mobile-language-option:hover {
    background-color: #F7F6FB;
    color: #3E8B1C;
}

.mobile-language-option img {
    width: 20px;
    height: 20px;
}

/* Mobile Primary Button */
.mobile-nav .btn-primary {
    margin: 1rem;
    padding: 12px 24px;
    text-align: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 24px;
    background-color: #3E8B1C;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-nav .btn-primary:hover {
    background-color: #103928;
}

/* Utility Classes */
.desktop-only {
    display: flex;
}

/* Header Placeholder to prevent layout shift before dynamic load */
#header-container {
    min-height: 80px;
    width: 100%;
    background: #ffffff;
    /* Optionally, add box-shadow to match header */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-placeholder {
    height: 80px;
    width: 100%;
    background: #ffffff;
    /* Optionally, add a subtle shimmer or animation */
}

/* Media Queries */
@media (max-width: 992px) {
    .header .new-header-container {
        height: 70px;
        max-width: 100%;
    }
    #header-container,
    .header-placeholder {
        min-height: 70px;
        height: 70px;
    }
}

@media (max-width: 940px) {
    .logo img {
        height: 50px;
    }
    .main-nav {
        display: none;
    }
    .btn-header-cta {
        display: none;
    }
    .header-actions {
        gap: 0.5rem;
    }

    .hamburger {
        display: block;
    }

    .header .new-header-container {
        height: 60px;
    }

    .mobile-nav {
        top: 60px;
        max-height: calc(100vh - 60px);
    }

    .desktop-only {
        display: none;
    }
    #header-container,
    .header-placeholder {
        min-height: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .header .new-header-container {
        height: 50px;
    }

    .mobile-nav {
        top: 50px;
        max-height: calc(100vh - 50px);
    }

    .header-actions .btn-header-cta {
        display: none;
    }
    #header-container,
    .header-placeholder {
        min-height: 50px;
        height: 50px;
    }
} 