@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

.pajero-faults-container {
    max-width: 900px;
    margin: 30px auto;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    padding: 0 15px;
}

/* Header styling */
.pajero-faults-search-box h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.pajero-faults-search-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    margin-bottom: 35px;
}

.pajero-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* Form controls */
.pajero-search-form input[type="text"].pajero-text-control {
    flex-grow: 2;
    min-width: 250px;
    height: 50px !important;
    padding: 0 20px !important;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    background-color: #f8fafc;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box !important;
    line-height: normal !important;
}

.pajero-search-form input[type="text"].pajero-text-control:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.pajero-search-form select.pajero-select-control {
    flex-grow: 1;
    min-width: 180px;
    height: 50px !important;
    padding: 0 40px 0 20px !important;
    line-height: normal !important;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #334155;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    box-sizing: border-box !important;
}

.pajero-search-form select.pajero-select-control:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.pajero-search-form button.pajero-search-button {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    font-weight: 600;
    border: none;
    height: 50px !important;
    padding: 0 28px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
}

.pajero-search-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(15, 23, 42, 0.25);
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.pajero-search-form button:active {
    transform: translateY(0);
}

/* Results section */
.pajero-faults-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pajero-faults-results > p {
    font-size: 1.1rem;
    color: #64748b;
    text-align: center;
    margin: 40px 0;
}

/* Result Cards styling */
.fault-result-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fault-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: #e2e8f0;
}

/* Dynamic Left Borders based on Fault Type */
.fault-result-card.fault-type-code {
    border-left: 5px solid #ef4444; /* Alert Crimson for codes */
}

.fault-result-card.fault-type-sensor {
    border-left: 5px solid #0ea5e9; /* Electric Blue for sensors */
}

/* Header of card containing Badges */
.fault-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

/* Badge Base Style */
.fault-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Badge colors */
.badge-type-code {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

.badge-type-sensor {
    background-color: #f0f9ff;
    color: #0284c7;
    border: 1px solid #e0f2fe;
}

.badge-system {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #f1f5f9;
}

.badge-engine {
    background-color: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

/* Title */
.fault-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* Meta Pills (ECU Code / OEM Part) */
.fault-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.meta-pill {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.85rem;
    border: 1.5px solid #e2e8f0;
}

.pill-label {
    background-color: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    font-weight: 500;
}

.pill-value {
    background-color: #ffffff;
    padding: 6px 12px;
    font-weight: 700;
}

.pill-code .pill-value {
    color: #dc2626;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.pill-oem .pill-value {
    color: #025a87;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.pill-compatibility .pill-value {
    color: #059669;
}

/* Content block styling */
.fault-content {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px dashed #e2e8f0;
}

.content-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.content-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    margin: 0;
}

.content-body p:last-child {
    margin-bottom: 0;
}

/* Related items section */
.related-diagnostics {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1.5px solid #f1f5f9;
}

.related-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-item-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.related-item-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.related-item-badge.badge-code {
    background-color: #fef2f2;
    color: #ef4444;
    border-color: #fee2e2;
}

.related-item-badge.badge-code:hover {
    border-color: #fca5a5;
    background-color: #fff5f5;
}

.related-item-badge.badge-sensor {
    background-color: #f0f9ff;
    color: #0284c7;
    border-color: #e0f2fe;
}

.related-item-badge.badge-sensor:hover {
    border-color: #bae6fd;
    background-color: #f0f9ff;
}

/* Responsiveness */
@media (max-width: 600px) {
    .pajero-search-form {
        flex-direction: column;
    }
    .pajero-search-form input[type="text"],
    .pajero-search-form select,
    .pajero-search-form button {
        width: 100%;
        flex-grow: 1;
    }
    .fault-result-card {
        padding: 20px;
    }
}