/* Header Component Styles */
/* Thiết kế theo Figma: Header với logo và navigation menu horizontal */

.header {
    width: 100%;
    max-width: 800px;
    height: 64px;
    background-color: rgba(27, 27, 27, 0.8);
    backdrop-filter: blur(4px);
    border: 0.5px solid #393939;
    position: fixed;
    top: 2rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}


.header__container {
    max-width: 760px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo Section */
.header__logo {
    display: flex;
    align-items: center;
    width: 173px;
    height: 32px;
}

.header__logo img {
    height: 100%;
    width: auto;
}

/* Navigation Menu */
.header__menu {
    display: flex;
    align-items: center;
}

.header__nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 48px;
}

.header__nav-link {
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.3em;
    letter-spacing: 0.14px;
    color: #A5A5A5;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.header__nav-link:hover {
    color: #FFFFFF;
}

.header__nav-link.active {
    font-weight: 400;
    color: #FFFFFF;
}


/* Dropdown - Service + */
.header__nav li {
    position: relative;
}

.header__nav-item--dropdown > .header__nav-link::after {
    content: none;
}

.header__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    padding: 8px;
    background: #FFFFFF;
    border: 1px solid rgba(35, 35, 37, 0.15);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
}

.header__nav-item--dropdown:hover .header__dropdown,
.header__nav-item--dropdown:focus-within .header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__dropdown-item {
    list-style: none;
}

.header__dropdown-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #404040;
    text-decoration: none;
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.header__dropdown-link:hover,
.header__dropdown-link:focus {
    background-color: rgba(35, 35, 37, 0.06);
    color: #000000;
}

/* Ensure header container overlaps content when dropdown is open */
.header {
    overflow: visible;
}

/* Mobile Burger Menu Styles */
.header__burger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 7px;
    height: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: all 0.3s ease;
}

.header__burger-line {
    width: 100%;
    height: 0.5px;
    background-color: #FFFFFF;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Mobile Navigation Menu */
.header__menu--mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(27, 27, 27, 0.8);
    backdrop-filter: blur(4px);
    border-bottom: 0.5px solid #393939;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Mobile menu separator line */
.header__menu--mobile::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0.5px;
    background-color: #393939;
}

.header__nav--mobile {
    flex-direction: column;
    gap: 0;
    padding: 0;
    align-items: flex-start;
}

.header__nav-link--mobile {
    display: block;
    padding: 0;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 14px;
    line-height: 130%;
    letter-spacing: 1%;
    color: #A5A5A5;
    text-decoration: none;
    transition: color 0.3s ease;
    text-align: left;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.header__nav-link--mobile:last-child {
    border-bottom: none;
}

.header__nav-link--mobile:hover,
.header__nav-link--mobile.active {
    color: #FFFFFF;
    font-weight: 400;
}

/* Mobile Menu Open State */
.header.header--mobile-open .header__menu--mobile {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    padding-top: 6px;
    padding-right: 16px;
    padding-bottom: 6px;
    padding-left: 16px;
    border-width: 0.5px;
}

/* Mobile Menu Items Animation - Slide Down Effect */
.header.header--mobile-open .header__nav-link--mobile {
    height: 2.5em;
    padding: 0.5em 0;
    border-bottom: 1px solid rgba(57, 57, 57, 0.3);
    transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.header.header--mobile-open .header__nav-link--mobile:last-child {
    border-bottom: none;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Burger Animation - Open State */
.header.header--mobile-open .header__burger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header.header--mobile-open .header__burger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.header.header--mobile-open .header__burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Desktop Menu - Hidden on Mobile */
.header__menu--desktop {
    display: flex;
}




/* Responsive behavior */
@media (max-width: 1024px) {
    .header__container {
        padding: 0 20px;
        gap: 40px;
    }

    .header__nav {
        gap: 32px;
    }

    .header__nav-link {
        font-size: 13px;
    }
}

@media (max-width: 768px) {

    .header {
        max-width: 240px;
        height: 24px;
    }
    
    /* Reduce logo size on mobile for better fit */
    .header__logo {
        width: 65px;
        height: 12px;
    }

    .header__logo img {
        height: 100%;
        width: auto;
        object-fit: contain;
    }
    .header__container {
        padding: 0 16px;
        gap: 24px;
    }

    .header__nav {
        gap: 24px;
    }

    .header__nav-link {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header__container {
        padding: 0 12px;
        gap: 16px;
    }

    .header__nav {
        gap: 16px;
    }

    .header__nav-link {
        font-size: 11px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Hide desktop menu, show burger menu */
    .header__menu--desktop {
        display: none;
    }
    
    .header__burger {
        display: flex;
    }
    
    .header__menu--mobile {
        display: block;
    }
    
    /* Adjust header container for mobile */
    .header__container {
        justify-content: space-between;
        gap: 0;
    }
    
    /* Ensure mobile menu appears below header */
    .header__menu--mobile {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
    }
}
