/* ===== MAIN CONTENT ===== */
/* C1 FIX: padding-bottom increased to 160px to clear the fixed confidentiality
   footer (~38px) so chat answers are never hidden behind it on any viewport. */
.main {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 24px 160px;
}

/* Tablet responsive - bridge the gap between mobile and desktop */
@media (min-width: 769px) and (max-width: 1023px) {
    .main {
        max-width: 900px;
        padding: 60px 32px 160px;
    }
    .hero-banner .search-box {
        max-width: 100%;
    }
    .hero-banner .context-filters {
        max-width: 100%;
    }
    .wo-inline {
        max-width: 100%;
    }
}

/* Desktop responsive - expand layout on larger screens */
@media (min-width: 1024px) {
    .main {
        max-width: 1000px;
        padding: 60px 40px 160px;
    }
}

@media (min-width: 1440px) {
    .main {
        max-width: 1200px;
        padding: 60px 60px 160px;
    }
}

@media (min-width: 1920px) {
    .main {
        max-width: 1600px;
        padding: 60px 80px 160px;
    }
}

/* Hero Banner - Combined title + search + filters */
.hero-banner {
    text-align: center;
    margin-bottom: 24px;
}

.hero-banner .search-box {
    max-width: 680px;
    margin: 0 auto;
}

.hero-banner .context-filters {
    max-width: 680px;
    margin: 16px auto 0;
}

/* WO Inline Row - hidden by default, shown for JFP users via .visible */
.wo-inline {
    display: none;
    align-items: center;
    gap: 10px;
    max-width: 680px;
    margin: 0 auto 32px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.wo-inline.visible {
    display: flex;
}

.wo-inline .wo-label {
    font-size: 18px;
    flex-shrink: 0;
}

.wo-inline input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.wo-inline input::placeholder {
    color: var(--text-tertiary);
}

.wo-btn {
    padding: 8px 16px;
    font-size: 13px;
}

.wo-skip-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    white-space: nowrap;
}

.wo-skip-btn:hover {
    color: var(--accent);
}

/* Legacy .hero alias (kept for hero-title reuse) */

.hero-title {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--text-primary);
}

[data-theme="light"] .hero-title {
    background: linear-gradient(
        90deg,
        var(--jfp-navy) 0%,
        var(--jfp-blue) 25%,
        var(--jfp-teal) 50%,
        var(--jfp-blue) 75%,
        var(--jfp-navy) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-wave 4s ease-in-out 1;
}

[data-theme="dark"] .hero-title {
    background: linear-gradient(
        90deg,
        #3aa8ff 0%,
        #00d4ff 25%,
        #00ffcc 50%,
        #00d4ff 75%,
        #3aa8ff 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-wave 4s ease-in-out 1;
}

@keyframes gradient-wave {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Search Box */

.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 16px 20px;
    font-size: 17px;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 4px;
}

.search-btn {
    background: var(--accent-cta, var(--accent));
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 175, 210, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

/* C4 FIX: helper text for first-time users - disappears once they select a filter.
   The active-filter-display is before .filter-helper-text in DOM, so the
   general sibling combinator works: when the badge is visible, hide the helper. */
.filter-helper-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
}

/* H1 FIX: Extracted repeated inline styles from filter rows in intake.html.
   Each vendor/equipment/model row had identical inline style= attributes. */
.filter-group {
    margin-bottom: 10px;
}

.filter-group-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.filter-group-label-sm {
    font-size: 11px;
}

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Hide helper when active filter badge is showing (user already understands) */
#active-filter-display[style*="flex"] ~ .filter-helper-text {
    display: none;
}

/* Context Filter Chips */
/* C4 FIX: bumped from 12px to 13px for readability on mobile.
   11px chip labels were too small for field techs (often wearing gloves). */
.filter-chip {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(58, 168, 255, 0.08);
}

.filter-chip.active {
    background: var(--accent-cta);
    color: white;
    border-color: var(--accent-cta);
    box-shadow: 0 2px 8px rgba(0, 175, 210, 0.3);
}

[data-theme="dark"] .filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .filter-chip:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
}

[data-theme="dark"] .filter-chip.active {
    background: linear-gradient(135deg, #0091ff 0%, #00d4ff 100%);
    border-color: transparent;
}

/* Dark mode search box with glassmorphism */
[data-theme="dark"] .search-box {
    background: linear-gradient(135deg, rgba(13, 18, 37, 0.9) 0%, rgba(18, 24, 48, 0.85) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(0, 180, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .search-box:focus-within {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 8px 40px rgba(0, 212, 255, 0.15), 0 0 0 3px rgba(0, 212, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Dark mode search button with glow */
[data-theme="dark"] .search-btn {
    background: linear-gradient(135deg, #0091ff 0%, #00d4ff 100%);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .search-btn:hover {
    background: linear-gradient(135deg, #00a8ff 0%, #00e8ff 100%);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

[data-theme="dark"] .search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.4);
}

/* Quick Actions */
.quick-section {
    margin-bottom: 48px;
}

.section-label {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow: visible;
}

.quick-section {
    overflow: visible;
}

.quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    position: relative;
    overflow: visible;
}

.quick-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-cta);
    transform: scaleY(0);
    transition: transform var(--transition);
}

.quick-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.quick-card:hover::before {
    transform: scaleY(1);
}

.quick-card:active {
    transform: scale(0.98);
}

/* Dark mode quick cards with enhanced glow effect */
[data-theme="dark"] .quick-card {
    background: linear-gradient(135deg, rgba(13, 18, 37, 0.95) 0%, rgba(18, 24, 48, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(0, 180, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .quick-card:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.25), 0 0 20px rgba(0, 212, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-4px) scale(1.02);
}

[data-theme="dark"] .quick-card:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

[data-theme="dark"] .section-label {
    color: #6b7fa8;
}

.quick-card-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.quick-card-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.quick-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== DIAGNOSTIC TOOL TILES (icon-centric app-launcher style) ===== */
.diagnostic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diag-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: visible;
    padding: 8px;
}

.diag-tile-icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 6px;
}

.diag-tile-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

.diag-tile:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.diag-tile:active {
    transform: scale(0.95);
}

[data-theme="dark"] .diag-tile {
    background: linear-gradient(135deg, rgba(13, 18, 37, 0.95) 0%, rgba(18, 24, 48, 0.9) 100%);
    border-color: rgba(0, 180, 255, 0.2);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .diag-tile:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2), 0 0 15px rgba(0, 212, 255, 0.1);
}

/* Tooltip positioning for diag-tiles */
.diag-tile[data-tooltip] {
    z-index: 1;
}

.diag-tile[data-tooltip]:hover,
.diag-tile[data-tooltip].tooltip-active {
    z-index: 100;
}

.diag-tile .card-tooltip {
    min-width: 220px;
}

.diag-tile.tooltip-flip .card-tooltip {
    bottom: auto;
    top: calc(100% + 10px);
}

.diag-tile.tooltip-flip .card-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: rgba(0, 175, 210, 0.35);
}
