/* ViralSpin Hub Shared Styles (V1 Style Refinement) v3.0 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --vs-deep: #ffffff;
    --vs-card: #ffffff;
    --vs-text: #0f172a;
    --vs-muted: #475569;
    --vs-neon: #0284c7; /* Sky Blue */
    --vs-accent-emerald: #059669;
    --vs-border: #f1f5f9;
    --sidebar-w: 280px;
    --top-h: 70px;
}

body {
    background-color: var(--vs-deep);
    color: var(--vs-text);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--vs-text);
    text-transform: none; /* No more forced All-Caps */
    letter-spacing: -0.02em;
}

/* LAYOUT */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: #f8fafc;
    border-right: 1px solid var(--vs-border);
    padding: 2.5rem 1.5rem;
    z-index: 50;
    overflow-y: auto;
}

.top-nav {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--top-h);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--vs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 40;
}

.main-container {
    margin-left: var(--sidebar-w);
    padding-top: calc(var(--top-h) + 2rem);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem 10rem 4rem;
}

/* UI COMPONENTS */
.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    color: var(--vs-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--vs-text);
}

.nav-link.active {
    background: white;
    color: var(--vs-neon);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--vs-border);
}

.tag {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--vs-accent-emerald);
    background: rgba(5, 150, 105, 0.08);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    display: inline-block;
    border: 1px solid rgba(5, 150, 105, 0.15);
}

.glass-panel {
    background: white;
    border: 1px solid var(--vs-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 8px 24px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-premium {
    background: var(--vs-text);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    transition: all 0.2s;
    border: none;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

/* MODAL */
#exit-intent-modal {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
}

/* CARDS: RESOURCE HUB ARTICLES */
.resource-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 8px 16px -4px rgba(0,0,0,0.02);
}

.resource-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.08);
    border-color: #bae6fd;
}

.card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #0284c7;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.card-category-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.1);
}

/* TABLES: COMPARISON SHOWDOWNS */
.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: white;
}

.compare-table th {
    background: #0f172a;
    color: white;
    padding: 1.25rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: left;
}

.compare-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.935rem;
    color: #475569;
    vertical-align: top;
    line-height: 1.6;
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: #f8fafc; }
.compare-table .winner { color: #059669; font-weight: 800; }

.price-badge {
    display: inline-block;
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
}

.subsection-label {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    display: block;
}

/* SIDEBAR: GUIDE SUBMENU */
.active-guide-wrapper {
    margin-bottom: 0.5rem;
}

.guide-submenu {
    list-style: none;
    padding: 0.5rem 0 0.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-left: 1px solid #f1f5f9;
    margin-left: 1.5rem;
}

.submenu-link {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.submenu-link:hover {
    color: #0284c7;
    transform: translateX(3px);
}

.submenu-link.active {
    color: #0284c7;
}

/* RESPONSIVE */
.mobile-nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--vs-border);
    color: var(--vs-text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
}

.mobile-nav-toggle:hover {
    background: #f1f5f9;
    color: var(--vs-neon);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .sidebar { 
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(15, 23, 42, 0.1);
    }

    .top-nav { 
        left: 0 !important; 
        right: 0 !important;
        padding: 0 0.75rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: var(--top-h) !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important; /* Default clipping */
        position: fixed !important;
        top: 0 !important;
    }

    /* Allow dropdown to break out of header when search is active */
    .top-nav.search-active {
        overflow: visible !important;
    }

    /* Primary HUD Centering */
    .top-nav span.text-xs,
    .top-nav .current-page-title,
    .top-nav .breadcrumb-item.active span {
        position: absolute !important;
        left: 60% !important; /* Fixed nudge for logo-text clearing */
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        white-space: nowrap !important;
        max-width: 45% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        z-index: 5 !important;
        color: var(--vs-text) !important;
        font-weight: 800 !important;
        font-size: 0.85rem !important;
        letter-spacing: -0.01em !important;
    }

    /* Target redundant breadcrumb pieces without killing the whole container */
    .top-nav a.text-slate-400, 
    .top-nav i.fa-chevron-right,
    .top-nav .breadcrumb-parent,
    .btn-premium,
    .top-nav > div:not(.search-container):not(.sidebar-logo):not(.mobile-logo) > *:not(:last-child) {
        display: none !important;
    }

    /* Ensure structural containers don't collapse or hide their contents */
    .top-nav > div:not(.search-container):not(.sidebar-logo):not(.mobile-logo) {
        display: block !important;
        position: static !important;
        flex: 1 !important;
        pointer-events: none !important; /* Let clicks pass to absolute children */
    }

    .top-nav.search-active > div:not(.search-container) {
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .mobile-nav-toggle {
        display: flex !important;
        position: relative !important;
        z-index: 15 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important;
        align-items: center !important;
    }

    .mobile-logo {
        display: flex !important;
        align-items: center !important;
        margin-left: 0.5rem !important;
        margin-right: 1rem !important; /* Spacing between logo and title */
        transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
        z-index: 10 !important;
        pointer-events: auto !important;
        flex-shrink: 0 !important;
    }

    .mobile-logo img {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }

    /* Hide logo when search is expanded to make room */
    .top-nav.search-active .mobile-logo {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .search-container {
        position: absolute !important;
        right: 0.75rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 2.5rem !important;
        height: 2.5rem !important;
        z-index: 20 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .search-container #nav-search-input {
        width: 2.5rem !important;
        height: 2.5rem !important;
        opacity: 0 !important;
        cursor: pointer !important;
        z-index: 2 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Immersive Mode Header Override */
    .search-container.mobile-expanded {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: var(--top-h) !important;
        background: white !important;
        z-index: 200 !important;
        padding: 0 1rem !important;
        margin: 0 !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .search-container.mobile-expanded #nav-search-input {
        width: 100% !important;
        height: 48px !important;
        opacity: 1 !important;
        padding: 0 3rem 0 3.5rem !important;
        background: #f1f5f9 !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        cursor: text !important;
        box-sizing: border-box !important;
    }

    .search-container.mobile-expanded .search-icon-main {
        left: 2.25rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10 !important;
        color: #64748b !important;
    }

    #nav-search-close { 
        display: none !important; 
    }
    
    .search-container.mobile-expanded #nav-search-close {
        display: flex !important;
        position: absolute !important;
        right: 2rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 210 !important;
        color: #475569 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        font-size: 1.25rem !important;
    }

    #nav-search-btn { display: none !important; }

    /* Hide title when searching */
    .top-nav.search-active span.text-xs {
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* Ensure search dropdown is visible on mobile overlay */
    .search-container.mobile-expanded .search-dropdown {
        position: fixed !important;
        top: var(--top-h) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        min-width: 0 !important;
        max-height: calc(100vh - var(--top-h)) !important;
        overflow-y: auto !important;
        background: white !important;
        z-index: 1000 !important; /* Ensure it's above the fixed header container */
        border-top: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        box-shadow: 0 10px 50px rgba(15, 23, 42, 0.2) !important;
        display: none !important;
        margin: 0 !important;
        padding-bottom: 5rem !important;
    }

    .search-container.mobile-expanded .search-dropdown.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .main-container { 
        margin-left: 0 !important;
        padding-top: calc(var(--top-h) + 1rem) !important;
    }

    .content-inner {
        padding: 0 1rem 8rem 1rem !important;
    }

    /* Stack all multi-column grids vertically on mobile */
    .grid-cols-2, 
    .grid-cols-3, 
    .grid-cols-4, 
    .grid.grid-cols-2, 
    .grid.grid-cols-3, 
    .workflow-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .pipeline-card {
        padding: 2.5rem 1.5rem !important;
    }

    /* Force row flex elements inside pipelines to stack */
    .pipeline-card .flex.items-center.gap-12,
    .pipeline-card .flex.items-center.gap-8 {
        flex-direction: column !important;
        gap: 2rem !important;
    }

    /* Reorient arrows/icons for vertical flow */
    .pipeline-card .fa-play,
    .pipeline-card .fa-arrow-right,
    .pipeline-card .fa-chevron-right {
        transform: rotate(90deg) !important;
        margin: 0.5rem 0 !important;
        color: #94a3b8 !important;
    }

    .pipeline-card .step-box {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Disable carousels and stack slides vertically on mobile */
    .carousel-row {
        position: static !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .carousel-track {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
        overflow: visible !important;
        width: 100% !important;
        padding: 0 !important;
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }

    .workflow-full-slide,
    .carousel-slide {
        width: 100% !important;
        min-width: 100% !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    .carousel-btn {
        display: none !important;
    }
}

/* SEARCH SYSTEM - NAV BAR */
/* UNIVERSAL SEARCH SYSTEM UI */
.search-container {
    position: relative;
    max-width: 440px;
    width: 100%;
    margin-left: auto;
    margin-right: 1.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#nav-search-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.75rem 1rem 0.75rem 3.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vs-text);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

#nav-search-input:focus {
    background: white;
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.08), 0 10px 30px -10px rgba(2, 132, 199, 0.12);
    outline: none;
}

#nav-search-btn {
    transition: all 0.2s;
}

#nav-search-btn:hover {
    transform: scale(1.05);
    background: #0284c7;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.75rem;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.99);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    overflow: hidden;
    padding: 1.5rem;
    min-width: 480px;
}

.search-container.search-open .search-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.search-section-label {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: block;
}

.search-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0;
}

.search-cat-item {
    padding: 0.875rem 0.6rem;
    border-radius: 1rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.search-cat-item:hover {
    background: white;
    border-color: #bae6fd;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.08);
}

.search-cat-item i {
    color: var(--vs-neon);
    font-size: 1rem;
}

.search-cat-item span {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--vs-text);
}

.recent-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--vs-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.recent-search-item:hover {
    background: #f8fafc;
    border-color: #f1f5f9;
    color: var(--vs-text);
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1rem;
    border-radius: 1.25rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    transform: translateX(4px);
}

.result-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.875rem;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vs-neon);
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04), inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.result-meta h4 {
    font-size: 0.935rem;
    font-weight: 800;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
    color: var(--vs-text);
}

.result-meta p {
    font-size: 0.75rem;
    color: var(--vs-muted);
    margin: 0;
    line-height: 1.5;
}

.search-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 1.5rem -1.5rem;
}


/* --- Toolkit & Sidebar Boxes --- */
.toolkit-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.5rem;
    width: 100%;
}
.toolkit-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    color: #475569;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
    font-size: 0.875rem;
}
.toolkit-link:hover { color: #0284c7; background: #fff; transform: translateX(4px); }
.toolkit-link:last-child { border-bottom: none; }

/* Branding & Callouts */
.bg-purple-50\/80 { background-color: rgba(250, 245, 255, 0.8) !important; }
.border-vs-purple { border-color: #8b5cf6 !important; }
.text-vs-purple { color: #8b5cf6 !important; }
.callout-insight-label { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; display: block; margin-bottom: 0.5rem; }

.hidden { display: none !important; }
