.lookup-layout {
    max-width: 1200px;
    margin: 40px auto 40px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: 1fr;
    gap: 28px;
    height: 680px;
    max-height: calc(100vh - 320px);
    min-height: 520px;
    flex-shrink: 0;
    overflow: hidden;
}

@media (max-width: 968px) {
    .lookup-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: auto;
        max-height: none;
        margin: 20px auto 40px auto;
    }
    .details-panel {
        height: auto;
        min-height: auto;
        overflow: visible;
    }
    .detail-content {
        height: auto;
        overflow: visible;
        padding: 24px;
    }
    .search-panel {
        height: auto;
        min-height: auto;
    }
    .results-container {
        max-height: 380px;
    }
}

/* Tabs Navigation */
.tabs-header {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 24px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: #000;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
}

/* Search Card Panel */
.search-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    min-height: 0;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    padding: 12px 42px 12px 40px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.clear-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Filter Pills */
.filters-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.filter-pill.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.08);
}

/* Results List styling */
.results-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.result-item {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.result-item.selected {
    background: rgba(0, 242, 254, 0.05);
    border-left: 3px solid var(--accent-cyan);
    padding-left: 15px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.result-item.selected .result-code {
    color: var(--accent-cyan);
}

.result-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-powertrain { background: rgba(245, 166, 35, 0.1); color: var(--accent-orange); border: 1px solid rgba(245, 166, 35, 0.2); }
.badge-body { background: rgba(57, 255, 20, 0.1); color: var(--accent-lime); border: 1px solid rgba(57, 255, 20, 0.2); }
.badge-chassis { background: rgba(0, 112, 243, 0.1); color: var(--accent-blue); border: 1px solid rgba(0, 112, 243, 0.2); }
.badge-network { background: rgba(255, 59, 48, 0.1); color: var(--accent-red); border: 1px solid rgba(255, 59, 48, 0.2); }
.badge-pid { background: rgba(0, 242, 254, 0.1); color: var(--accent-cyan); border: 1px solid rgba(0, 242, 254, 0.2); }

.result-name {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-results {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Details Card Panel */
.details-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.details-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    opacity: 0;
    transition: var(--transition-fast);
}

.details-panel.loaded::before {
    opacity: 1;
}

.detail-placeholder {
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 36px;
    margin: auto;
}

.placeholder-icon {
    color: rgba(255, 255, 255, 0.05);
}

.detail-content {
    display: none;
    flex-direction: column;
    gap: 28px;
    animation: fadeIn 0.3s ease-out;
    flex: 1;
    overflow-y: auto;
    padding: 36px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 20px;
    gap: 20px;
}

.detail-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-code-badge {
    font-family: monospace;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
    line-height: 1;
}

.detail-category {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.detail-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

/* Detail Stats Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-stat-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.value-formula {
    font-family: monospace;
    color: var(--accent-lime);
    word-break: break-all;
}

/* Detail Section Text */
.detail-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-orange);
    letter-spacing: 0.5px;
}

.detail-section-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.detail-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-list li {
    margin-bottom: 0;
}

/* Loading Indicator */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 8, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 242, 254, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    animation: spin 1s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Prevent header, hero, and footer from squeezing and causing overlaps in flex column */
.page-header,
.site-footer,
.header-nav {
    flex-shrink: 0;
}

