.app-header {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    z-index: 10;
}

.app-header *,
.app-header *::before,
.app-header *::after {
    box-sizing: border-box;
}

/* Hero Image Animation */
.header-hero-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;

    transform: scale(1.04);
    transform-origin: center;
    opacity: 0;
    animation: heroImageReveal 1.6s ease-out forwards;
}

.app-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25),
        rgba(0, 0, 0, 0.05)
    );
    pointer-events: none;
    z-index: 1;

    opacity: 0;
    animation: overlayFadeIn 1.2s ease-out 0.2s forwards;
}

/* Glass Header */
.glass-header {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 9999;

    width: min(1180px, calc(100% - 64px));
    max-width: 1180px;
    height: var(--header-height);

    transform: translate(-50%, -24px) scale(0.98);
    transform-origin: center top;
    opacity: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 0 18px;

    background: var(--glass-bg);
    border-radius: var(--header-radius);
    box-shadow: 0 18px 45px var(--glass-shadow);

    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);

    animation: glassHeaderReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
    overflow: visible;

    transition:
        top 0.35s ease,
        width 0.35s ease,
        height 0.35s ease,
        padding 0.35s ease,
        border-radius 0.35s ease,
        background 0.35s ease,
        box-shadow 0.35s ease,
        backdrop-filter 0.35s ease,
        -webkit-backdrop-filter 0.35s ease,
        transform 0.35s ease;
}

/* Scrolled Header */
.glass-header.is-scrolled {
    top: 10px;

    width: min(1040px, calc(100% - 40px));
    height: 58px;

    padding: 0 14px;

    border-radius: 999px;

    /* background: rgba(0, 0, 0, 0.422); */
    color: black;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);

    backdrop-filter: blur(26px) saturate(190%);
    -webkit-backdrop-filter: blur(26px) saturate(190%);

    transform: translate(-50%, 0) scale(1);
}

.glass-header-default {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;

    transition: gap 0.35s ease;
}

.glass-header.is-scrolled .header-right {
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    opacity: 0;
    transform: translateY(-8px);
    animation: fadeSlideDown 0.7s ease-out 0.6s forwards;
}

.header-logo img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;

    transition:
        width 0.35s ease,
        height 0.35s ease,
        transform 0.35s ease;
}

.glass-header.is-scrolled .header-logo img {
    width: 44px;
    height: 44px;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    min-width: 0;

    opacity: 0;
    transform: translateY(-8px);
    animation: fadeSlideDown 0.7s ease-out 0.72s forwards;

    transition: gap 0.35s ease;
}

.glass-header.is-scrolled .header-menu {
    gap: 4px;
}

.header-menu li {
    display: flex;
    min-width: 0;
}

.header-menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 14px;

    color: var(--color-text-light);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;

    border-radius: 999px;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        min-height 0.35s ease,
        padding 0.35s ease,
        font-size 0.35s ease;
}

.glass-header.is-scrolled .header-menu a {
    color: #000000;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.header-menu a:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-1px);
}

/* Header Left - Glass Container */
.header-left {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;

    height: 48px;
    padding: 0 6px;

    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

    opacity: 0;
    transform: translateY(-8px);
    animation: fadeSlideDown 0.7s ease-out 0.82s forwards;

    transition:
        height 0.35s ease,
        padding 0.35s ease,
        background 0.35s ease,
        box-shadow 0.35s ease;
}

.glass-header.is-scrolled .header-left {
    height: 42px;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.18);
}

.header-icon-btn,
.language-btn {
    height: 40px;

    border: none;
    background: transparent;
    color: var(--color-text-light);

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        opacity 0.25s ease,
        height 0.35s ease,
        width 0.35s ease,
        padding 0.35s ease,
        font-size 0.35s ease;

    font-family: inherit;
}

.glass-header.is-scrolled .header-icon-btn,
.glass-header.is-scrolled .language-btn {
    height: 34px;
}

.header-icon-btn:hover,
.language-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

/* Search icon button */
.header-icon-btn {
    width: 42px;
    border-radius: 50%;
    background-color: var(--color-white);

    -webkit-mask-image: url("../assets/svg/search.svg");
    mask-image: url("../assets/svg/search.svg");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: 20px 20px;
    mask-size: 20px 20px;
}

.glass-header.is-scrolled .header-icon-btn {
    width: 34px;
    background-color: #000000;
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
}

.header-left-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.35);
    margin: 0 4px;
    flex-shrink: 0;

    transition:
        height 0.35s ease,
        margin 0.35s ease;
}

.glass-header.is-scrolled .header-left-divider {
    height: 18px;
    margin: 0 3px;
}

.language-btn {
    gap: 8px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}

.glass-header.is-scrolled .language-btn {
    color: #000000;
    gap: 6px;
    padding: 0 8px;
    font-size: 12px;
}

.language-btn img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 50%;
    display: block;

    transition:
        width 0.35s ease,
        height 0.35s ease;
}

.glass-header.is-scrolled .language-btn img {
    width: 22px;
    height: 22px;
}

/* Hero Content */
.header-hero-content {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;

    width: min(90%, 900px);
    text-align: center;
    color: var(--color-white, #fff);
    padding-inline: 12px;
}

.header-hero-content h1 {
    margin: 0 0 16px;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.3;
    text-shadow: 5px 5px 10px #000000;

    opacity: 0;
    transform: translateY(28px);
    animation: heroTextUp 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.95s forwards;
}

.header-hero-content p {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 2;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 5px 5px 10px #000000;

    opacity: 0;
    transform: translateY(24px);
    animation: heroTextUp 0.95s cubic-bezier(0.22, 1, 0.36, 1) 1.15s forwards;
}

/* Language Dropdown */
.language-switcher {
    position: static;
    display: inline-flex;
    align-items: center;
}

.language-menu {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    right: 0;
    z-index: 20;

    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    padding: 8px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    background: rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);

    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-8px) scaleY(0.96);
    transform-origin: top center;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.glass-header.is-scrolled .language-menu {
    top: calc(100% + 12px);
}

.language-switcher.is-open .language-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scaleY(1);
}

.language-menu-item {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;

    border: none;
    outline: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);

    background: transparent;
    border-radius: 999px;

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        color 0.25s ease;
}

.language-menu-item:hover,
.language-menu-item.is-active {
    background: rgba(255, 255, 255, 0.18);
}

.language-menu-item:hover {
    transform: translateY(-1px);
}

.glass-header.is-scrolled .language-menu-item{
    color: #000000;
}
.glass-header.is-scrolled:hover .language-menu-item{
    color: #000000;
}


.language-menu-item img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.language-menu-item span {
    white-space: nowrap;
}

/* Header Search Mode */
.glass-header-search {
    position: absolute;
    inset: 0;
    z-index: 3;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 18px;
    min-width: 0;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(8px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease,
        padding 0.35s ease;
}

.glass-header.is-scrolled .glass-header-search {
    padding: 0 14px;
}

.glass-header.is-search-active .glass-header-default {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.98);
}

.glass-header.is-search-active .glass-header-search {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.header-search-form {
    flex: 1;
    min-width: 0;
}

.header-search-input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 18px;

    border: none;
    outline: none;
    border-radius: 999px;

    background: transparent;
    color: var(--color-text-light);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    transition:
        background 0.25s ease,
        box-shadow 0.25s ease,
        height 0.35s ease,
        font-size 0.35s ease;
}

.glass-header.is-scrolled .header-search-input {
    height: 40px;
    font-size: 13px;
    color: #000000;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.glass-header.is-scrolled .header-search-input::placeholder {
    color: #000000;
}

/* .header-search-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
} */

.header-search-close-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;

    border: none;
    border-radius: 50%;
    cursor: pointer;

    background-color: var(--color-white);

    transition:
        transform 0.25s ease,
        opacity 0.25s ease,
        background-color 0.25s ease,
        width 0.35s ease,
        height 0.35s ease;

    -webkit-mask-image: url("../assets/svg/close.svg");
    mask-image: url("../assets/svg/close.svg");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: 60%;
    mask-size: 60%;
}

.glass-header.is-scrolled .header-search-close-btn {
    width: 36px;
    height: 36px;
    background-color: #000000;
}

.header-search-close-btn:hover {
    transform: translateY(-1px);
    opacity: 0.88;
}

/* Responsive */
@media (max-width: 900px) {
    .glass-header {
        width: calc(100% - 32px);
        height: auto;
        min-height: var(--header-height);
        padding: 12px;
        align-items: center;
    }

    .glass-header.is-scrolled {
        top: 8px;
        width: calc(100% - 24px);
        min-height: 58px;
        height: 58px;
        padding: 0 12px;
        border-radius: 999px;
    }

    .header-right {
        gap: 16px;
        min-width: 0;
    }

    .glass-header.is-scrolled .header-right {
        gap: 12px;
    }

    .header-menu {
        display: none;
    }

    .header-logo img {
        width: 52px;
        height: 52px;
    }

    .glass-header.is-scrolled .header-logo img {
        width: 42px;
        height: 42px;
    }

    .header-hero-content {
        top: 60%;
        width: min(92%, 700px);
    }

    .header-hero-content h1 {
        font-size: 36px;
    }

    .header-hero-content p {
        font-size: 16px;
        line-height: 1.9;
    }

    .glass-header-search {
        padding: 0 12px;
    }

    .header-search-input {
        height: 44px;
        font-size: 14px;
    }

    .glass-header.is-scrolled .header-search-input {
        height: 40px;
        font-size: 13px;
    }

    .header-search-close-btn {
        width: 40px;
        height: 40px;
    }

    .glass-header.is-scrolled .header-search-close-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .app-header,
    .header-hero-image {
        height: 420px;
    }

    .glass-header {
        top: 16px;
        width: calc(100% - 20px);
    }

    .glass-header.is-scrolled {
        top: 8px;
        width: calc(100% - 16px);
        height: 56px;
        min-height: 56px;
        padding: 0 10px;
    }

    .language-btn span {
        display: none;
    }

    .language-btn {
        width: 42px;
        padding: 0;
    }

    .glass-header.is-scrolled .language-btn {
        width: 34px;
        padding: 0;
    }

    .header-left {
        height: 48px;
        padding: 0 5px;
    }

    .glass-header.is-scrolled .header-left {
        height: 40px;
        padding: 0 4px;
    }

    .header-hero-content {
        top: 45%;
        width: 90%;
    }

    .header-hero-content h1 {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .header-hero-content p {
        font-size: 14px;
        line-height: 1.8;
    }

    .header-search-input {
        padding: 0 14px;
        font-size: 13px;
    }

    .glass-header-search {
        gap: 10px;
    }

    .language-menu {
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
        transform: translateY(-8px) scaleY(0.96);
    }

    .language-switcher.is-open .language-menu {
        transform: translateY(0) scaleY(1);
    }

}

/* Animations */
@keyframes heroImageReveal {
    0% {
        opacity: 0;
        transform: scale(1.04);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes overlayFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes glassHeaderReveal {
    0% {
        opacity: 0;
        transform: translate(-50%, -24px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@keyframes fadeSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTextUp {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .header-hero-image,
    .app-header::after,
    .glass-header,
    .header-logo,
    .header-menu,
    .header-left,
    .header-hero-content h1,
    .header-hero-content p {
        animation: none !important;
        opacity: 1 !important;
    }

    .glass-header {
        transform: translate(-50%, 0) scale(1) !important;
    }

    .header-logo,
    .header-menu,
    .header-left,
    .header-hero-content h1,
    .header-hero-content p,
    .header-hero-image {
        transform: none !important;
    }

    .glass-header,
    .glass-header *,
    .glass-header *::before,
    .glass-header *::after {
        transition: none !important;
    }
}
