@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --deep-navy: #0A1F44;
    --royal-blue: #1E5BFF;
    --soft-blue: #4A7DFF;
    --white: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-light: #6B7280;
    --orange: #FF8A00;
    --border-light: rgba(229, 236, 247, 0.7);
}

.navbar {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 20px;
    padding: 10px 22px;
    box-shadow: 0 18px 45px rgba(10, 31, 68, 0.16);
    z-index: 2000;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo,
.nav-actions,
.nav-links li a,
.btn-finder,
.sidebar-item {
    display: flex;
    align-items: center;
}

.logo {
    margin-right: 30px;
}

.logo-img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

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

.nav-links li a {
    color: #1A1A1A;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: 0.3s;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 12px;
}

.nav-links li a:hover {
    color: var(--royal-blue);
    background: #edf4ff;
}

.arrow {
    font-size: 10px;
    margin-left: 4px;
}

.nav-actions {
    gap: 12px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

.has-mega-menu {
    position: static;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    width: min(1120px, 94vw);
    transform: translate(-50%, 20px);
    background: transparent;
    color: #333;
    box-shadow: none;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 9999;
    padding: 0;
}

.has-mega-menu:hover .mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0);
}

.mega-container {
    display: flex;
    max-width: 1120px;
    margin: 0 auto;
    background: var(--white);
    min-height: 330px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 28px 80px rgba(10, 31, 68, 0.26);
}

.articles-menu .mega-menu {
    width: auto;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
}

.articles-menu:hover .mega-menu {
    transform: translateX(-50%) translateY(0);
}

.articles-menu .mega-container {
    min-height: auto;
    min-width: 400px;
    max-width: 400px;
}

.articles-menu .mega-content-wrapper {
    grid-template-columns: 1fr !important;
    padding: 20px 24px !important;
    gap: 0 !important;
    background: transparent !important;
}

.articles-menu .mega-sidebar {
    display: none;
}

.more-wrapper {
    position: static;
}

.more-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    background: #f5f5f5;
    padding: 30px 60px;
    border-top: 2px solid #ff7a00;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s ease;
    z-index: 999;
}

.more-wrapper:hover .more-dropdown,
.more-wrapper.open .more-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.more-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
}

.more-item a {
    text-decoration: none;
    display: block;
}

.more-item h4 {
    font-size: 16px;
    color: #222;
    margin-bottom: 5px;
    transition: 0.3s;
}

.more-item p {
    font-size: 13px;
    color: #777;
}

.more-item a:hover h4 {
    color: #2a6df4;
    text-decoration: underline;
}

.mega-sidebar {
    display: flex;
    width: 285px;
    background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
    padding: 14px;
    border-right: 1px solid var(--border-light);
    flex-direction: column;
    gap: 8px;
}

.sidebar-item {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 800;
    color: #1f2937;
    cursor: pointer;
    gap: 12px;
    transition: 0.3s;
    border-radius: 14px;
    text-decoration: none !important;
    border: 1px solid transparent;
}

.sidebar-item i,
.sidebar-item svg {
    width: 22px;
    height: 22px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mega-sidebar .sidebar-item:hover,
.mega-sidebar .sidebar-item.active {
    background: #ffffff;
    color: #0A1F44;
    border-color: rgba(30, 91, 255, 0.12);
    box-shadow: 0 12px 28px rgba(30, 91, 255, 0.12);
}

.mega-sidebar .sidebar-item:hover i,
.mega-sidebar .sidebar-item.active i,
.mega-sidebar .sidebar-item:hover svg,
.mega-sidebar .sidebar-item.active svg {
    color: var(--orange);
    stroke: var(--orange);
}

.view-all-btn {
    margin-top: auto;
    background: #0A1F44;
    color: #ffffff !important;
}

.view-all-btn i {
    color: #ffffff;
}

.mega-content-wrapper {
    background:
        radial-gradient(circle at 90% 12%, rgba(30, 91, 255, 0.09), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 34px;
    gap: 26px;
    height: auto;
    align-content: start;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.no-sidebar .standard-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    padding: 30px;
    height: auto !important;
    min-height: auto !important;
}

.col-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.mega-col h3 {
    font-size: 16px;
    font-weight: 800;
    color: #0A1F44;
    border: none;
    margin-bottom: 14px;
    padding: 0;
}

.mega-col ul {
    margin: 0;
    padding: 0;
}

.mega-col ul li {
    margin-bottom: 10px;
    position: relative;
    list-style: none;
}

.mega-col ul li a {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark) !important;
    display: block;
    padding: 12px 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.75);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.mega-col ul li a p {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
    font-weight: 400;
}

.mega-col ul li a:hover {
    color: var(--royal-blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(30, 91, 255, 0.12);
    border-color: rgba(30, 91, 255, 0.18);
}

.view-all {
    color: var(--soft-blue) !important;
    font-weight: 700;
}

.btn-finder {
    gap: 6px;
    padding: 8px 16px;
    background: var(--white);
    color: var(--text-dark);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: 0.3s;
}

.nav-search-svg {
    transition: transform 0.3s ease;
    color: var(--text-dark);
}

.btn-finder:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-finder:hover .nav-search-svg {
    transform: rotate(-15deg) scale(1.2);
    color: var(--orange);
}

.btn-expert {
    background: transparent;
    border: 1px solid var(--orange);
    color: var(--orange);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.4s;
}

.btn-expert:hover {
    background: var(--orange);
    color: var(--text-dark);
    box-shadow: 0 0 15px rgba(255, 138, 0, 0.45);
    transform: translateY(-2px);
}

.btn-finder:active,
.btn-expert:active {
    transform: scale(0.95);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-content {
    animation: fadeInUp 0.4s ease forwards;
}

@media (max-width: 980px) {
    .navbar {
        width: 95%;
        padding: 8px 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.05);
        gap: 0;
        max-height: 85vh;
        overflow-y: auto;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li,
    .nav-links li a {
        width: 100%;
    }

    .nav-links li a {
        padding: 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-actions {
        display: none;
    }

    .nav-actions.active {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 15px;
        background: var(--white);
        border-radius: 0 0 20px 20px;
        position: absolute;
        top: calc(100% + 250px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    }

    /* Mobile Mega Menu Logic - Prevents Shaking and Layout Overflow */
    .has-mega-menu .mega-menu {
        display: none !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.03) !important;
        border-radius: 12px !important;
        margin: 8px 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        transition: none !important;
    }

    .has-mega-menu.open-mobile .mega-menu {
        display: block !important;
    }

    .mega-container {
        flex-direction: column !important;
        min-height: auto !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mega-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding: 10px !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        background: transparent !important;
    }

    .mega-sidebar .sidebar-item {
        flex: 1 1 calc(50% - 8px) !important;
        min-width: 120px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        justify-content: flex-start !important;
        background: #ffffff !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
        border-radius: 10px !important;
        margin: 0 !important;
    }

    .mega-content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px 10px !important;
        width: 100% !important;
        background: transparent !important;
    }

    .mega-col {
        width: 100% !important;
        margin: 0 !important;
    }

    .mega-col h3 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .mega-col ul {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .mega-col ul li {
        margin: 0 !important;
        width: 100% !important;
    }

    .mega-col ul li a {
        padding: 10px 12px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
    }

    /* Articles Menu Mobile Fixes */
    .articles-menu .mega-menu {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        margin: 8px 0 !important;
    }

    .articles-menu .mega-container {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: auto !important;
    }

    /* More Dropdown Mobile Fixes */
    .more-dropdown {
        display: none !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        background: rgba(0, 0, 0, 0.03) !important;
        border: none !important;
        padding: 10px !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
        border-radius: 12px !important;
        margin: 8px 0 !important;
        transition: none !important;
    }

    .more-wrapper.open .more-dropdown {
        display: block !important;
    }

    .more-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .more-item {
        width: 100% !important;
    }

    .more-item a {
        padding: 10px 12px !important;
        background: #ffffff !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
        border-radius: 10px !important;
    }

    .more-item h4 {
        font-size: 14px !important;
        margin: 0 0 4px 0 !important;
    }

    .more-item p {
        font-size: 11px !important;
        margin: 0 !important;
    }
}