/* ═══════════════════════════════════════════════════════
   INDEX-V2.CSS — Scenario Library
   Standard LLOS.ai top-nav layout (no sidebar)
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
.iv2-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%);
    padding: 32px 24px 48px; /* Increased bottom padding to give space for autocomplete */
    position: relative;
    overflow: visible; /* CRITICAL: Must be visible for autocomplete dropdown to show */
    z-index: 1; /* Ensure hero is above toolbar when autocomplete is open */
    margin-bottom: 0; /* No gap between hero and toolbar - autocomplete will overlap */
}
.iv2-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 30%, rgba(99,102,241,.15), transparent 60%);
    pointer-events: none;
    z-index: 0; /* Behind content */
}

.iv2-hero-inner {
    max-w: 1440px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 48px;
    overflow: visible; /* CRITICAL: Must be visible for autocomplete dropdown */
}

.iv2-hero-text { 
    flex: 1; 
    overflow: visible; /* CRITICAL: Must be visible for autocomplete dropdown */
    position: relative;
    z-index: 10;
}

.iv2-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 12px;
}
.iv2-hero-accent {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.iv2-hero-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,.6);
    line-height: 1.6;
    max-width: 480px;
    margin-bottom: 20px;
}

/* Hero Search Bar (Prominent) */
.iv2-hero-search {
    margin-top: 20px;
    margin-bottom: 0; /* Remove bottom margin - autocomplete will extend below */
    position: relative;
    z-index: 10; /* Ensure search area is above hero background */
}

.iv2-hero-search-wrap {
    position: relative;
    max-width: 600px;
    z-index: 100; /* Higher z-index to ensure dropdown appears above everything */
    overflow: visible; /* CRITICAL: Must be visible for autocomplete dropdown */
}

.iv2-hero-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.8);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.iv2-hero-search-input {
    width: 100%;
    padding: 16px 50px 16px 52px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #0f172a;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.iv2-hero-search-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.iv2-hero-search-input:focus {
    background: white;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 12px 40px rgba(234, 88, 12, 0.25),
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(234, 88, 12, 0.15);
    border: 2px solid rgba(234, 88, 12, 0.3);
    /* When focused, ensure autocomplete can appear below */
    position: relative;
    z-index: 1;
}

.iv2-hero-search-input:hover:not(:focus) {
    background: white;
    box-shadow: 
        0 10px 36px rgba(0, 0, 0, 0.22),
        0 3px 10px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.iv2-hero-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: #e2e8f0;
    border-radius: 50%;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    z-index: 2;
}

.iv2-hero-search-clear:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.iv2-hero-search-clear.hidden { display: none; }

/* Autocomplete Dropdown */
.iv2-autocomplete {
    position: fixed; /* Fixed positioning to appear relative to viewport, not parent */
    /* Position calculated by JS based on search input position */
    background: white;
    border-radius: 12px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05); /* Subtle border for definition */
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000; /* Very high z-index - appears above toolbar and all content */
    border: 1px solid #e2e8f0;
    /* Ensure it's not clipped by parent containers */
    isolation: isolate;
    /* Width will be set by JS to match search input */
    min-width: 300px;
    max-width: 600px;
}

.iv2-autocomplete.hidden {
    display: none;
}

.iv2-autocomplete-list {
    padding: 4px;
}

.iv2-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    color: #0f172a;
}

.iv2-autocomplete-item:hover,
.iv2-autocomplete-item.selected {
    background: #f1f5f9;
}

.iv2-autocomplete-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: #e2e8f0;
    color: #64748b;
}

.iv2-autocomplete-item-text {
    flex: 1;
    min-width: 0;
}

.iv2-autocomplete-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.iv2-autocomplete-item-title-hi {
    font-size: 12px;
    color: #64748b;
}

.iv2-autocomplete-item-match {
    background: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.iv2-autocomplete-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

@media (max-width: 640px) {
    .iv2-autocomplete {
        max-height: 280px;
    }
    
    .iv2-autocomplete-item {
        padding: 10px 14px;
    }
    
    .iv2-autocomplete-item-title {
        font-size: 13px;
    }
}

/* How it works steps in hero */
.iv2-hero-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    width: 300px;
}

.iv2-step-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    transition: background .2s;
}
.iv2-step-card:hover {
    background: rgba(255,255,255,.1);
}

.iv2-step-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.iv2-step-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}
.iv2-step-desc {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════
   TOOLBAR (Collapsible Filters)
   ═══════════════════════════════════════════════════════ */
.iv2-toolbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    position: sticky;
    top: 64px;
    z-index: 40; /* Lower than autocomplete (1000) so dropdown appears above */
    margin-top: 0; /* No gap - autocomplete can overlap this section */
}

/* Filter Toggle Row */
.iv2-filter-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.iv2-filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.iv2-filter-toggle-btn:hover {
    border-color: #ea580c;
    color: #ea580c;
    background: #fff7ed;
}

.iv2-filter-toggle-btn[aria-expanded="true"] {
    border-color: #ea580c;
    color: #ea580c;
    background: #fff7ed;
}

.iv2-filter-chevron {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.iv2-filter-toggle-btn[aria-expanded="true"] .iv2-filter-chevron {
    transform: rotate(180deg);
}

.iv2-filter-divider {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.iv2-filter-count {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Filters Panel */
.iv2-filters-panel {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.iv2-filters-panel:not(.hidden) {
    max-height: 500px;
    opacity: 1;
    padding: 16px 0;
}

.iv2-filters-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Filter Groups */
.iv2-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 639px) {
    .iv2-filters {
        flex-direction: column;
        gap: 12px;
    }
}

.iv2-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iv2-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex-shrink: 0;
}

.iv2-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.iv2-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.iv2-pill:hover {
    border-color: #cbd5e1;
    color: #0f172a;
    background: #f8fafc;
}
.iv2-pill.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
    font-weight: 600;
}
.iv2-pill i {
    font-size: 11px;
}

/* ── Results Bar ───────────────────────────────────── */
.iv2-results-bar {
    padding: 12px 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.iv2-results-sort {
    font-size: 11px;
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════
   SCENARIO GRID
   ═══════════════════════════════════════════════════════ */
.iv2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding-bottom: 24px;
}

/* ── Scenario Card ─────────────────────────────────── */
.iv2-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.iv2-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    transform: translateY(-2px);
}

/* Color accent strip */
.iv2-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.iv2-card.c-blue::before    { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.iv2-card.c-amber::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.iv2-card.c-green::before   { background: linear-gradient(90deg, #22c55e, #4ade80); }
.iv2-card.c-red::before     { background: linear-gradient(90deg, #ef4444, #f87171); }
.iv2-card.c-cyan::before    { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.iv2-card.c-pink::before    { background: linear-gradient(90deg, #ec4899, #f472b6); }
.iv2-card.c-indigo::before  { background: linear-gradient(90deg, #6366f1, #818cf8); }
.iv2-card.c-purple::before  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* Card Top Row */
.iv2-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.iv2-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
/* Icon bg colors */
.iv2-card.c-blue .iv2-card-icon    { background: #dbeafe; color: #2563eb; }
.iv2-card.c-amber .iv2-card-icon   { background: #fef3c7; color: #d97706; }
.iv2-card.c-green .iv2-card-icon   { background: #dcfce7; color: #16a34a; }
.iv2-card.c-red .iv2-card-icon     { background: #fee2e2; color: #dc2626; }
.iv2-card.c-cyan .iv2-card-icon    { background: #cffafe; color: #0891b2; }
.iv2-card.c-pink .iv2-card-icon    { background: #fce7f3; color: #db2777; }
.iv2-card.c-indigo .iv2-card-icon  { background: #e0e7ff; color: #4f46e5; }
.iv2-card.c-purple .iv2-card-icon  { background: #ede9fe; color: #7c3aed; }

.iv2-card-meta {
    flex: 1;
    min-width: 0;
}

.iv2-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
    line-height: 1.3;
}
.iv2-card-title-hi {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 400;
}

.iv2-card-diff {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}
.iv2-card-diff.beginner     { background: #dcfce7; color: #16a34a; }
.iv2-card-diff.intermediate { background: #fef3c7; color: #d97706; }
.iv2-card-diff.advanced     { background: #fee2e2; color: #dc2626; }

/* Card Preview */
.iv2-card-preview {
    flex: 1;
    margin-bottom: 14px;
}
.iv2-card-preview-en {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 2px;
}
.iv2-card-preview-hi {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

/* Card Footer */
.iv2-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.iv2-card-info {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.iv2-card-info i {
    font-size: 10px;
}

.iv2-card-cta {
    font-size: 12px;
    font-weight: 700;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap .2s;
}
.iv2-card:hover .iv2-card-cta {
    gap: 8px;
}

/* ── No Results ────────────────────────────────────── */
.iv2-no-results {
    text-align: center;
    padding: 48px 24px;
}
.iv2-no-results.hidden { display: none; }
.iv2-no-results i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}
.iv2-no-title {
    font-size: 16px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.iv2-no-sub {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}
.iv2-btn-clear {
    padding: 8px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.iv2-btn-clear:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

/* ── Coming Soon Strip ─────────────────────────────── */
.iv2-coming {
    padding: 16px 20px;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.iv2-coming-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.iv2-coming-items {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.iv2-coming-items span {
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* ── Tablet (< 960px) ──────────────────────────────── */
@media (max-width: 959px) {
    .iv2-hero-inner {
        flex-direction: column;
        gap: 24px;
    }

    .iv2-hero-steps {
        width: 100%;
        flex-direction: row;
    }
    .iv2-step-card {
        flex: 1;
    }
}

/* ── Mobile (< 640px) ─────────────────────────────── */
@media (max-width: 639px) {
    .iv2-hero {
        padding: 28px 16px;
    }

    .iv2-hero-title {
        font-size: 24px;
    }

    .iv2-hero-subtitle {
        font-size: 13px;
    }

    .iv2-hero-steps {
        flex-direction: column;
    }

    .iv2-toolbar {
        padding: 12px 0;
        top: 64px;
    }

    .iv2-filters {
        flex-direction: column;
        gap: 10px;
    }

    .iv2-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .iv2-pills::-webkit-scrollbar { display: none; }

    .iv2-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .iv2-coming {
        flex-direction: column;
        align-items: flex-start;
    }

    .iv2-hero-search {
        margin-top: 16px;
        margin-bottom: 12px;
    }

    .iv2-hero-search-input {
        padding: 14px 48px 14px 50px;
        font-size: 14px;
    }
}

/* ── Scroll to Top Button ─────────────────────────────── */
.iv2-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ea580c;
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.iv2-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.iv2-scroll-top:hover {
    background: #c2410c;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
}

.iv2-scroll-top:active {
    transform: translateY(-2px) scale(1);
}

@media (max-width: 640px) {
    .iv2-scroll-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
        font-size: 16px;
    }
}

/* ── Initial Loading State ───────────────────────────── */
.iv2-loading-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.iv2-loading-initial i {
    font-size: 18px;
    color: #ea580c;
}

/* ── Lazy Load Sentinel (Must be visible) ────────────── */
.iv2-sentinel {
    height: 1px;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    position: relative;
}

.iv2-loading-more {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    color: #94a3b8;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.iv2-sentinel.loading .iv2-loading-more {
    opacity: 1;
}

.iv2-sentinel.hidden {
    display: none;
}

/* ── Very small mobile (< 380px) ───────────────────── */
@media (max-width: 379px) {
    .iv2-hero-title {
        font-size: 20px;
    }

    .iv2-card {
        padding: 16px;
    }

    .iv2-card-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}
