/**
 * Site Header Styles
 *
 * @package HR_Consulting_Theme
 */

/* Header */
.site-header {
    background-color: #FFFFFF;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.site-header-container {
    max-width: 1340px;
    margin: 0 auto;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

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

.logo-link {
    text-decoration: none;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: start;
    position: relative;
}

.logo img {
    width: 168px;
    height: 40px;
}

.logo-divider {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 4px;
}

.logo-divider .line {
    width: 26px;
    height: 1px;
    background-color: #D9D9D9;
}

/* Navigation */
.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #000000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #1538BF;
}

.chevron-icon {
    width: 16px;
    height: 16px;
}

/* Dropdown Menu */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 8px;
    list-style: none;
    margin: 0;
    min-width: 136px;
    box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

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

.dropdown-item {
    margin: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 120px;
    height: 38px;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5714285714285714em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background-color: #FFFFFF;
    color: #000000;
}

.dropdown-link:hover {
    background-color: #1538BF;
    color: #FFFFFF;
}

.dropdown-link.active,
.dropdown-link:active {
    background-color: #1538BF;
    color: #FFFFFF;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-contact-sales {
    padding: 12px 24px;
}

.btn-search {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background-color: #F0F0F0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0;
}

.btn-search:hover {
    background-color: #E0E0E0;
}

.btn-search svg {
    width: 24px;
    height: 24px;
    stroke: #000000;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: #000000;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger animation when active */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu toggle color when menu is active */
@media (max-width: 767px) {
    .mobile-menu-toggle.active .hamburger-line {
        background-color: #FFFFFF;
    }
}

/* Tablet - Large (1024px-1280px) */
@media (min-width: 1024px) and (max-width: 1280px) {
    .site-header {
        padding: 15px 0;
    }

    .site-header-container {
        padding: 0 32px;
    }

    .header-wrapper {
        gap: 32px;
        align-items: center;
    }

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

    .nav-menu {
        gap: 28px;
        flex-wrap: nowrap;
    }

    .nav-link {
        font-size: 13.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-actions {
        gap: 20px;
        flex-shrink: 0;
    }

    .btn-contact-sales {
        padding: 11px 22px;
        font-size: 13.5px;
        white-space: nowrap;
    }

    .btn-search {
        width: 46px;
        height: 46px;
        flex-shrink: 0;
    }

    .btn-search svg {
        width: 20px;
        height: 20px;
    }
}

/* Tablet - Medium (900px-1023px) */
@media (min-width: 900px) and (max-width: 1023px) {
    .site-header {
        padding: 14px 0;
    }

    .site-header-container {
        padding: 0 24px;
    }

    .header-wrapper {
        gap: 20px;
        flex-wrap: nowrap;
        align-items: center;
    }

    /* Logo */
    .header-logo {
        flex-shrink: 0;
        min-width: 130px;
    }

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

    /* Navigation */
    .main-navigation {
        flex-grow: 1;
        min-width: 0;
        overflow: visible;
    }

    .nav-menu {
        gap: 18px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .nav-item {
        flex-shrink: 0;
    }

    .nav-link {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chevron-icon {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* Header Actions */
    .header-actions {
        gap: 14px;
        flex-shrink: 0;
        align-items: center;
    }

    .action-buttons {
        gap: 10px;
    }

    .btn-contact-sales {
        padding: 10px 18px;
        font-size: 13px;
        white-space: nowrap;
    }

    .btn-search {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .btn-search svg {
        width: 20px;
        height: 20px;
    }

    /* Dropdown优化 */
    .dropdown-menu {
        min-width: 125px;
    }

    .dropdown-link {
        width: 115px;
        font-size: 13px;
    }
}

/* Tablet - Small (768px-899px) */
@media (min-width: 768px) and (max-width: 899px) {
    .site-header {
        padding: 12px 0;
    }

    .site-header-container {
        padding: 0 16px;
    }

    .header-wrapper {
        gap: 12px;
        flex-wrap: nowrap;
    }

    /* Logo */
    .header-logo {
        flex-shrink: 0;
        min-width: 110px;
    }

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

    /* Navigation - 更紧凑 */
    .main-navigation {
        flex-grow: 1;
        min-width: 0;
        overflow: visible;
    }

    .nav-menu {
        gap: 10px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .nav-item {
        flex-shrink: 0;
    }

    .nav-link {
        font-size: 12px;
        white-space: nowrap;
        padding: 4px 0;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .chevron-icon {
        width: 12px;
        height: 12px;
        margin-left: 2px;
    }

    /* Header Actions - 优化布局 */
    .header-actions {
        gap: 8px;
        flex-shrink: 0;
        align-items: center;
    }

    /* 按钮优化 */
    .action-buttons {
        gap: 6px;
        display: flex;
        align-items: center;
    }

    .btn-contact-sales {
        padding: 9px 16px;
        font-size: 12px;
        white-space: nowrap;
        min-width: auto;
    }

    .btn-search {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .btn-search svg {
        width: 18px;
        height: 18px;
    }

    /* Dropdown优化 */
    .dropdown-menu {
        min-width: 120px;
        padding: 6px;
    }

    .dropdown-link {
        width: 110px;
        height: 34px;
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Mobile (<=767px) */
@media (max-width: 767px) {
    .site-header {
        padding: 12px 0;
    }

    .site-header-container {
        padding: 0 16px;
    }

    .header-wrapper {
        gap: 16px;
        position: relative;
    }

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

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

    /* Hide desktop navigation and actions */
    .main-navigation {
        display: none;
    }

    .header-actions {
        display: none;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile menu styles */
    .main-navigation.active {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #FFFFFF;
        z-index: 1000;
        padding: 80px 24px 24px 24px;
        overflow-y: auto;
        animation: slideInFromRight 0.3s ease-out;
    }

    @keyframes slideInFromRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .main-navigation.active .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .main-navigation.active .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .main-navigation.active .nav-item:last-child {
        border-bottom: none;
    }

    .main-navigation.active .nav-link {
        padding: 16px 0;
        font-size: 16px;
        font-weight: 500;
        width: 100%;
        justify-content: space-between;
        color: #FFFFFF;
    }

    .main-navigation.active .nav-link:hover {
        color: rgba(255, 255, 255, 0.8);
    }

    .main-navigation.active .chevron-icon {
        transition: transform 0.3s ease;
        stroke: #FFFFFF;
    }

    .main-navigation.active .has-dropdown.active .chevron-icon {
        transform: rotate(180deg);
    }

    /* Mobile dropdown menu */
    .main-navigation.active .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin: 0;
        padding: 0;
        background-color: transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .main-navigation.active .has-dropdown.active .dropdown-menu {
        max-height: 200px;
        padding: 8px 0 8px 16px;
    }

    .main-navigation.active .dropdown-item {
        margin: 0;
    }

    .main-navigation.active .dropdown-link {
        width: 100%;
        height: auto;
        padding: 12px 0;
        justify-content: flex-start;
        text-align: left;
        background-color: transparent;
        color: rgba(255, 255, 255, 0.9);
        font-size: 14px;
        font-weight: 400;
        text-transform: none;
        border-radius: 0;
    }

    .main-navigation.active .dropdown-link:hover {
        background-color: transparent;
        color: #FFFFFF;
    }

    /* Mobile header actions in menu */
    .main-navigation.active .nav-menu {
        flex: 0 0 auto;
    }

    .main-navigation.active .header-actions {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: auto;
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        width: 100%;
    }

    .main-navigation.active .header-actions .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .main-navigation.active .header-actions .btn-contact-sales {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
        text-align: center;
        justify-content: center;
    }

    .main-navigation.active .header-actions .btn-search {
        width: 100%;
        height: 48px;
        border-radius: 8px;
    }

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

    /* Mobile menu overlay */
    .main-navigation.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease-out;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

/* Small Mobile (<=480px) */
@media (max-width: 480px) {
    .site-header-container {
        padding: 0 12px;
    }

    .logo img {
        width: 100px;
    }

    .main-navigation.active {
        padding: 70px 16px 20px 16px;
    }

    .main-navigation.active .nav-link {
        font-size: 15px;
        padding: 14px 0;
    }

    .main-navigation.active .dropdown-link {
        font-size: 13px;
        padding: 10px 0;
    }
}

/* ===========================
   Contact Modal Styles
   =========================== */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.contact-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 0;
    z-index: 10001;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.contact-modal.active .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-close img {
    width: 24px;
    height: 24px;
    display: block;
}

.modal-header {
    padding: 24px 24px 0 24px;
    margin-bottom: 6px;
}

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4444444444444444em;
    color: #18181B;
    margin: 0;
}

.contact-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.form-label {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1em;
    color: #18181B;
}

.form-input {
    width: 100%;
    padding: 8px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4285714285714286em;
    color: #18181B;
    background-color: #FFFFFF;
    border: 1px solid #E4E4E7;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #BFBFBF;
}

.form-input:focus {
    border-color: #1538BF;
    box-shadow: 0 0 0 3px rgba(21, 56, 191, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 12px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5em;
    color: #FFFFFF;
    background-color: #1538BF;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 8px;
}

.btn-submit:hover {
    background-color: #0F2A8F;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5em;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-message-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.form-message-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Modal Responsive Styles */
@media screen and (max-width: 767px) {
    .modal-container {
        width: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 20px 20px 0 20px;
    }

    .modal-title {
        font-size: 16px;
        line-height: 1.5em;
    }

    .contact-form {
        padding: 20px;
        gap: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 14px;
    }

    .form-group {
        gap: 6px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .btn-submit {
        padding: 14px 24px;
        font-size: 15px;
    }

    .modal-close {
        top: 16px;
        right: 16px;
    }
}

@media screen and (max-width: 480px) {
    .modal-header {
        padding: 16px 16px 0 16px;
    }

    .contact-form {
        padding: 16px;
        gap: 12px;
    }

    .form-row {
        gap: 12px;
    }
}
