/* ============================================
   MODERN HEADER STYLES - TRUECARECOST
   Primary Colors from Logo: #2196F3 to #1976D2
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors from Logo */
    --primary-blue:#368368;
    --primary-dark-blue: #138f82;
    --accent-cyan: #1bb58b;
    --gradient-blue: linear-gradient(
        135deg,
        #2dc97c 0%,
        #1bb58b 50%,    
        #138f82 100%
    );

    /* Neutral Colors */
    --white: #ffffff;
    --black: #000000;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-700: #495057;
    --gray-900: #212529;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.2s ease;
}

body {
    line-height: 1.6;
    color: var(--gray-900);
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.header-area {
    background-color: var(--white);
    padding: 4px 0;
    position: relative;
    z-index: 1000;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    overflow-x: clip;
}

.header-area.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

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

/* ============================================
   LOGO STYLES
   ============================================ */

.header-logo {
    flex-shrink: 0;
    z-index: 1001;
}

.header-logo a {
    display: block;
    line-height: 0;
}

.logo-img {
    height: 71px;
    width: auto;
    transition: var(--transition-base);
    padding: 4px;
}

.header-area.sticky .logo-img {
    height: 76px;
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

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

.nav-menu li a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition-fast);
}

/* .sticky .nav-menu li a {
    color: #fff;    
} */
.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-blue);
    transition: width 0.3s ease;
}

.nav-menu li a:hover {
    color: var(--primary-blue);
}

.nav-menu li a:hover::after {
    width: 100%;
}

/* ============================================
   HEADER ACTIONS (Auth Buttons)
   ============================================ */

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.btn-login,
.btn-signup {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-login {
    color: var(--primary-blue);
    background-color: transparent;
    border: 2px solid var(--primary-blue);
}

.btn-login:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-signup {
    color: var(--white);
    background: var(--gradient-blue);
    border: 2px solid transparent;
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.4);
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: var(--transition-base);
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 3px;
    transition: var(--transition-base);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

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

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

.mobile-nav {
    display: none;
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav.active {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.mobile-menu {
    list-style: none;
    padding: 20px;
}

.mobile-menu li {
    margin-bottom: 0;
}

.mobile-menu li a {
    display: block;
    padding: 16px 20px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.mobile-menu li a:hover {
    background-color: var(--gray-100);
    color: var(--primary-blue);
}

.mobile-auth {
    padding: 20px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-login-mobile,
.btn-signup-mobile {
    display: block;
    text-align: center;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-login-mobile {
    color: var(--primary-blue);
    background-color: transparent;
    border: 2px solid var(--primary-blue);
}

.btn-signup-mobile {
    color: var(--white);
    background: var(--gradient-blue);
    border: 2px solid transparent;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large Tablets and Below (1024px) */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 30px;
    }

    .nav-menu li a {
        font-size: 14px;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .btn-login,
    .btn-signup {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    .header-area.sticky {
        padding: 10px 0;
    }

    .logo-img {
        height: 45px;
    }

    .header-area.sticky .logo-img {
        height: 38px;
    }
}

/* Mobile Phones (480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header-area {
        padding: 15px 0;
    }

    .logo-img {
        height: 40px;
    }

    .header-area.sticky .logo-img {
        height: 35px;
    }

    .mobile-nav {
        top: 70px;
    }

    .mobile-menu {
        padding: 15px;
    }

    .mobile-menu li a {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* Extra Small Phones (360px) */
@media (max-width: 360px) {
    .logo-img {
        height: 36px;
    }

    .header-area.sticky .logo-img {
        height: 32px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.no-scroll {
    overflow: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header-area {
        position: static;
        box-shadow: none;
    }
}

/* ============================================
   SEARCH MEGA MENU - ADD-ON STYLES ONLY
   Add this to your existing header CSS
   ============================================ */

/* ============================================
   MEGA DROPDOWN CONTAINER
   ============================================ */

/* .has-mega-menu {
    position: static !important;
   
} */

/* INVISIBLE HOVER BRIDGE */
.has-mega-menu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 18px;
    background: transparent;
}
.search-mega > a {
    position: relative;
    z-index: 1001;
}
.search-mega::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 18px;
    background: transparent;
}

/* Hover bridge - invisible area to keep menu open */
/* .has-mega-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    display: none;
}

.has-mega-menu:hover::after {
    display: block;
} */
html,
body {
    overflow-x: hidden;
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: min(1320px, 94%);
    background: #ffffff;
    border-radius: 14px;
    
    /* REMOVE THESE */
    /* opacity: 0;
    visibility: hidden;
    pointer-events: none; */
    
    /* ADD THESE */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none !important; /* Remove CSS transitions, JS handles it */
    
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* .search-mega:hover > .mega-dropdown,
.search-mega .mega-dropdown:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
} */

.mega-dropdown-inner {
    max-width: 1320px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 14px;
}



/* ============================================
   MEGA TABS NAVIGATION
   ============================================ */

.mega-tabs {
    display: flex;
    border-bottom: 3px solid #e9ecef;
    background: #ffffff;
    padding: 0 40px;
    gap: 0;
}

.mega-tab-btn {
    background: #f8f9fa;
    border: none;
    padding: 18px 35px;
    font-size: 15px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    border-right: 1px solid #dee2e6;
    border-radius: 0;
}

.mega-tab-btn:last-child {
    border-right: none;
}

.mega-tab-btn i {
    font-size: 18px;
}

.mega-tab-btn:hover {
    color: #2196F3;
    background: #ffffff;
}

.mega-tab-btn.active {
    color: #519c71;
    border-bottom-color: #519c71;
    background: #ffffff;
    font-weight: 700;
}

/* ============================================
   MEGA CONTENT CONTAINER
   ============================================ */

.mega-content {
    position: relative;
    background: #ffffff;
    min-height: 450px;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.mega-tab-content {
    display: none;
    padding: 35px 40px;
    animation: fadeIn 0.3s ease;
}

.mega-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   SEARCH HEADER
   ============================================ */

.search-header-dropdown {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
background: linear-gradient(180deg, #2dc97c 0%, #138f82 100%);
    padding: 20px 40px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.search-header-dropdown h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 15px;
}

.search-box input {
    width: 100%;
    padding: 11px 18px 11px 44px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.search-box input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #ffffff;
}

.search-box input::placeholder {
    color: #adb5bd;
}

/* ============================================
   SPECIALTIES GRID
   ============================================ */

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.specialty-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.specialty-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.specialty-item:hover {
    background: #f8f9fa;
    border-color: #4e9a71;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    transform: translateX(4px);
}

.specialty-item i {
    font-size: 26px;
    color: #2196F3;
    flex-shrink: 0;
    margin-top: 2px;
    width: 30px;
    text-align: center;
}

.specialty-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.specialty-info span {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

/* ============================================
   PROCEDURES GRID
   ============================================ */

.procedures-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.procedure-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 18px;
}

.column-title {
    font-size: 13px;
    font-weight: 700;
    color: #519c71;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.procedure-item {
    padding: 11px 14px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: block;
    border-left: 3px solid transparent;
    margin-left: -3px;
}

.procedure-item:hover {
    background: #f8f9fa;
    color: #2196F3;
    border-left-color: #2196F3;
    padding-left: 18px;
}

/* ============================================
   MEGA FOOTER
   ============================================ */

.mega-footer {
    border-top: 2px solid #e9ecef;
    padding-top: 22px;
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 36px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.25s ease;
    border: none;
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.35);
}

.view-all-btn i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.view-all-btn:hover i {
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVE DESIGN - MEGA MENU ONLY
   ============================================ */

/* Large Tablets (1024px) */
@media (max-width: 1024px) {
    .mega-dropdown-inner {
        padding: 0 20px;
    }

    .specialties-grid,
    .procedures-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {

    /* Hide mega menu on mobile - use regular mobile navigation instead */
    .has-mega-menu .mega-dropdown {
        display: none;
    }

    .specialties-grid,
    .procedures-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .mega-tabs {
        padding: 0 20px;
    }

    .mega-tab-content {
        padding: 30px 20px;
    }

    .search-header-dropdown {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        max-width: 100%;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {

    .specialties-grid,
    .procedures-grid {
        grid-template-columns: 1fr;
    }

    .mega-tabs {
        padding: 0 15px;
    }

    .mega-tab-btn {
        padding: 16px 20px;
        font-size: 14px;
    }

    .mega-tab-content {
        padding: 20px 15px;
    }

    .search-header-dropdown h3 {
        font-size: 20px;
    }

    .specialty-item {
        padding: 12px;
    }

    .specialty-item i {
        font-size: 20px;
    }

    .specialty-info h4 {
        font-size: 14px;
    }
}

/* ============================================
   STICKY HEADER ADJUSTMENTS
   ============================================ */
.header-area.sticky .mega-dropdown {
    top: 100%;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

.mega-tab-btn:focus,
.specialty-item:focus,
.procedure-item:focus,
.view-all-btn:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Hide mega dropdown from screen readers when not visible */
.mega-dropdown[aria-hidden="true"] {
    display: none;
}

/* Resources specific */
.resources-inner {
    padding: 28px 32px;
}

/* Grid layout */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px 60px;
}

/* Resource item */
.resource-item {
    text-decoration: none;
    padding: 10px 6px;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.resource-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.resource-item p {
    font-size: 14px;
    color: var(--gray-700);
    margin: 0;
    line-height: 1.5;
}

/* Hover effect */
.resource-item:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.resource-item:hover h4 {
    color: var(--primary-blue);
}

/* External arrow */
.resource-item.external span {
    font-size: 14px;
    color: var(--primary-blue);
}

/* Show dropdown only on Resources */
.resources-mega:hover > .mega-dropdown,
.resources-mega .mega-dropdown:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
