/* ========================================
   KINGWORK - Header Styles
   Modern & Premium Design
   ======================================== */

/* Header Base */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header.scrolled {
    height: 70px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.header.scrolled::after {
    opacity: 1;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    position: relative;
    z-index: 10;
}

.logo img {
    height: 54px;
    width: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header.scrolled .logo img {
    height: 46px;
}

.logo:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(13, 79, 110, 0.2);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}

.header.scrolled .logo-text {
    font-size: 1.6rem;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 10px;
    position: relative;
    text-decoration: none;
    letter-spacing: 0.2px;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 30px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link i {
    margin-left: 5px;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-link i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 260px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 0;
    z-index: 100;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 24px;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    text-decoration: none;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, var(--bg-light) 0%, transparent 100%);
    color: var(--primary-color);
    padding-left: 30px;
}

.dropdown-item i {
    display: none;
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 680px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px;
    z-index: 100;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.mega-menu-col h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-menu-col h4 i {
    font-size: 0.9rem;
}

.mega-menu-col a {
    display: block;
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    text-decoration: none;
}

.mega-menu-col a:hover {
    color: var(--primary-color);
    padding-left: 12px;
    border-bottom-color: var(--border-color);
}

/* Header CTA */
.header-cta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-cta .btn {
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(13, 79, 110, 0.3);
    transition: all 0.3s ease;
}

.header-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 79, 110, 0.4);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    transition: background 0.3s ease;
    z-index: 1001;
}

.menu-toggle:hover {
    background: var(--bg-light);
}

.menu-toggle span {
    width: 26px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation */
@media (max-width: 1100px) {
    .header-inner {
        padding: 0 20px;
    }

    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 25px;
        gap: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.1);
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link {
        padding: 18px 15px;
        font-size: 1.05rem;
        justify-content: space-between;
    }

    .nav-link::before {
        display: none;
    }

    .dropdown,
    .mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        width: 100%;
        padding: 0 0 0 20px;
        display: none;
        background: var(--bg-light);
        border-radius: 0;
        border: none;
        margin-top: 0;
    }

    .dropdown::before,
    .mega-menu::before {
        display: none;
    }

    .nav-item.open .dropdown,
    .nav-item.open .mega-menu {
        display: block;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .header-cta {
        display: none;
    }
}

@media (max-width: 768px) {
    .logo img {
        height: 42px;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .header.scrolled .logo img {
        height: 38px;
    }

    .header.scrolled .logo-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    .header-inner {
        padding: 0 15px;
    }
}
