/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    /* Removing padding to let container handle spacing if needed, or keeping minimal */
    background-color: var(--color-primary);
    transition: all var(--transition-normal);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header.transparent {
    background-color: transparent;
    box-shadow: none;
}

.header.scrolled {
    background-color: rgba(43, 57, 73, 0.98);
    backdrop-filter: blur(10px);
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    padding: 20px 0;
}

/* Nav List & Links */
.nav-list {
    display: flex;
    gap: 10px;
    /* Reduced gap - items are closer */
    height: 100%;
    align-items: center;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 15px;
    position: relative;
    padding: 30px 15px;
    /* Large vertical padding to connect to mega menu */
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.nav-link .arrow {
    font-size: 10px;
    margin-left: 6px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.nav-item:hover .nav-link {
    color: #fff;
}

.nav-item:hover .nav-link .arrow {
    transform: rotate(180deg);
}

/* Mega Menu Container - Video Reference Match */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff !important;
    /* or var(--color-bg-light) if defined, effectively flat */
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    /* Subtle separator */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    /* Seamless shadow, no hard box look */
    border-radius: 0;
    /* REMOVED border-radius as per rule */
    padding: 0;
    /* Internal padding handled by container */

    /* Animation Match */
    opacity: 0;
    transform: translateY(-12px);
    /* Video spec */
    visibility: hidden;
    transition:
        opacity 0.25s ease-out,
        transform 0.25s ease-out,
        visibility 0.25s;
    z-index: 999;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Mega Menu Scrollbar */
.mega-menu::-webkit-scrollbar {
    width: 6px;
}

.mega-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mega-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.mega-menu::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Hover Behavior */
.nav-item.has-mega-menu:hover .mega-menu,
.nav-item.has-mega-menu:focus-within .mega-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s;
}

/* Mega Menu Internal Layout */
.mega-menu .container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 64px 80px;
    /* Video spec: 64px T/B, 80px L/R */
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* Video spec */
    column-gap: 56px;
    /* Video spec */
    row-gap: 0;
    width: 100%;
}

/* Columns - STRICT NO BOX */
.mega-menu-col {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Column Headings */
.mega-menu-col h4 {
    color: #0f172a;
    /* Darker slate for contrast */
    font-size: 14px;
    /* Video spec */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* Video spec */
    opacity: 0.7;
    /* Video spec */
    margin-bottom: 24px;
    padding-bottom: 0;
    border: none;
    /* No underlines */
    display: block;
}

/* Column Links */
.mega-menu-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-col ul li {
    margin-bottom: 12px;
}

.mega-menu-col ul li a {
    color: #64748b;
    /* Slate-500 */
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    display: block;
    /* Larger hit area */
    padding: 4px 0;
    transition: color 0.2s ease;
}

.mega-menu-col ul li a:hover {
    color: var(--color-primary);
    text-decoration: none;
    background: transparent;
    /* Mandatory: No background */
}



.mega-menu-col a:hover {
    color: var(--color-primary);
    transform: translateX(6px);
    color: var(--color-accent);
}

/* Last Column Feature Styling (e.g. Case Studies) */
.mega-menu-col .feature-box {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.mega-menu-col .feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Technologies Mega Menu Grid */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 cols for density */
    gap: 20px;
    /* Increased gap for breathing room */
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    /* Larger hit area */
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tech-item:hover {
    background: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Stronger lift */
    transform: translateY(-3px);
    color: var(--color-primary);
}

.tech-icon {
    font-size: 20px;
    /* Slightly larger icons */
    line-height: 1;
}

/* Header CTA */
.header-cta .btn {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    /* More corporate, less rounded */
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* -------------------------------------------------------------------------- */
/*             Mega Menu - Generic Grid Layout (Moved from sections.css)      */
/* -------------------------------------------------------------------------- */
.mega-grid-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 10px 0;
}

.mega-category h4 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-category h4 i {
    color: #ef4444;
    /* icon red color from image */
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.mega-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-category ul li {
    margin-bottom: 12px;
}

.mega-category ul li a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.mega-category ul li a::before {
    content: "•";
    color: #f59e0b;
    /* Yellow bullet point */
    margin-right: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.mega-category ul li a:hover {
    color: #f59e0b;
    /* Hover Yellow */
    padding-left: 4px;
}

/* Contact Box Custom */
.mega-contact-box {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.mega-contact-box h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-contact-box h4 i {
    color: #ef4444;
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-row:last-child {
    margin-bottom: 0;
}

.contact-row i {
    font-size: 20px;
    margin-top: 4px;
}

.contact-row div {
    display: flex;
    flex-direction: column;
}

.contact-row span {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.contact-row a {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.contact-row a:hover {
    color: #f59e0b;
}

/* Responsive */
@media (max-width: 900px) {
    .mega-grid-layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .mega-grid-layout {
        grid-template-columns: 1fr;
    }
}