/* Antigravity-style Navigation */

/* Dropdown Container */
.nav-item {
    position: relative;
    padding: 10px 0;
    /* Increase hit area */
}

.nav-link {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    min-width: 260px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Dropdown */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.3);
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Hover State - The "Antigravity" Lift (Desktop Only) */
@media (min-width: 1025px) {
    .nav-item:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Dropdown Items */
.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--bg-glass-strong);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .nav-item {
        width: 100%;
        text-align: center;
        padding: 0;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        min-width: 100%;
        display: none;
        margin-top: 10px;
    }

    .nav-item.active .dropdown-menu {
        display: flex;
    }

    .dropdown-item {
        background: rgba(255, 255, 255, 0.3);
        margin-bottom: 5px;
    }
}

/* Desktop header nav — logo left, CTA right, links centered between */
@media (min-width: 769px) {
    .main-header .nav-list {
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0;
        margin: 0;
        padding: 0;
    }

    .main-header .nav-item {
        flex-shrink: 1; /* allow shrinking if needed */
        padding: 24px 0.35rem; /* reduced from 0.425rem */
    }

    .main-header .nav-link {
        white-space: nowrap;
        font-size: 0.8125rem;
    }

    .main-header .nav-list .nav-item:has(a.search-trigger) {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-header .nav-list {
        gap: 0;
    }

    .main-header .nav-item {
        padding: 24px 0.2rem;
    }

    .main-header .nav-link {
        font-size: 0.75rem;
    }

    .main-header .header-logo img {
        max-height: 52px;
    }
}

@media (min-width: 1100px) {
    .main-header .nav-list {
        gap: 0;
    }

    .main-header .nav-item {
        padding: 24px 0.5rem;
    }

    .main-header .nav-link {
        font-size: 0.875rem;
    }
}

@media (min-width: 1280px) {
    .main-header .nav-list {
        gap: 0;
    }

    .main-header .nav-item {
        padding: 24px 0.6rem;
    }

    .main-header .nav-link {
        font-size: 0.9375rem;
    }

    .main-header .nav-list .nav-item:has(a.search-trigger) {
        display: block;
    }
}

@media (min-width: 1440px) {
    .main-header .nav-list {
        gap: 0;
    }

    .main-header .nav-item {
        padding: 24px 0.7rem;
    }

    .main-header .nav-link {
        font-size: 1rem;
    }
}

/* --- SHIFTING DROPDOWN (Antigravity Overlay) --- */

/* The container that bounds the shifting absolute overlay */
.shift-container {
    position: relative;
}

/* The overlay wrapper */
.shift-overlay {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    width: 650px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, left 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), height 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    overflow: hidden;
}

/* When active, show the overlay */
.shift-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* The invisible bridge to prevent mouseleave when moving from link to dropdown */
.shift-bridge {
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

/* The rotating nub pointer */
.shift-nub {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    transform: translateX(-50%) rotate(45deg);
    transition: left 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

/* Panes container inside the overlay */
.shift-panes {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual panes */
.shift-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(100px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* When moving left or right */
.shift-pane.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.shift-pane.exit-left {
    opacity: 0;
    transform: translateX(-100px);
}

.shift-pane.exit-right {
    opacity: 0;
    transform: translateX(100px);
}

.shift-pane.enter-left {
    transform: translateX(-100px);
}

.shift-pane.enter-right {
    transform: translateX(100px);
}

/* Pane Grid Styling */
.pane-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.pane-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.pane-grid h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pane-grid a {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.pane-grid a:hover {
    color: var(--primary);
}

.pane-card, .pane-blog {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    transition: background 0.2s ease;
}

.pane-card:hover, .pane-blog:hover {
    background: #f1f5f9;
}

.pane-card h4, .pane-blog h4 {
    margin: 0 0 4px 0;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-main);
}

.pane-card p, .pane-blog p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.shift-tab .chevron {
    transition: transform 0.2s ease;
}
.shift-tab:hover .chevron,
.shift-tab.active .chevron {
    transform: rotate(180deg);
}

/* Mobile Shifting Dropdown Accordion Integration */
@media (max-width: 1024px) {
    .main-header .shift-overlay {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        transform: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        display: none !important;
        padding: 0 !important;
        transition: opacity 0.2s ease !important;
    }
    
    .main-header .shift-overlay.active {
        opacity: 1 !important;
        pointer-events: auto !important;
        height: auto !important;
        display: block !important;
    }
    
    .main-header .shift-panes {
        position: static !important;
        height: auto !important;
    }
    
    .main-header .shift-pane {
        position: static !important;
        opacity: 0 !important;
        transform: none !important;
        padding: 10px 0 20px 20px !important; /* Indent sub-pages */
        display: none !important;
        transition: opacity 0.2s ease !important;
    }
    
    .main-header .shift-pane.active {
        opacity: 1 !important;
        display: block !important;
    }
    
    .main-header .shift-nub, 
    .main-header .shift-bridge {
        display: none !important;
    }
    
    /* Make subpage links stack vertically */
    .main-header .pane-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .main-header .pane-card, 
    .main-header .pane-blog {
        padding: 8px 12px !important;
        background: rgba(0, 0, 0, 0.02) !important;
    }
}

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

.pane-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- STATIC FOOTER LAYOUT --- */
.new-footer-layout {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1fr 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .new-footer-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .new-footer-layout {
        grid-template-columns: 1fr;
    }
}

.new-footer-layout .brand-col {
    padding-right: 20px;
}

.new-footer-layout .list-col h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

.footer-scroll-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 15px; /* space for scrollbar */
}

.footer-scroll-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.footer-scroll-list a:hover {
    color: var(--primary);
}

/* Custom Blue Scrollbar */
.footer-scroll-list::-webkit-scrollbar {
    width: 6px;
}

.footer-scroll-list::-webkit-scrollbar-track {
    background: transparent;
}

.footer-scroll-list::-webkit-scrollbar-thumb {
    background: #3b82f6; /* bright blue */
    border-radius: 6px;
}

.footer-scroll-list::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}
