/* Parts Browser - OEM Parts Catalog Styles - White Background Theme */

.partsbrowser-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    color: #333;    
    margin: 0;
    min-height: 100vh;
}

/* Split Layout for Home View */
.partsbrowser-split-layout {
    display: flex;
    width: 100%;
    min-height: 60vh;
    gap: 0;
    flex-direction: column;
}

.partsbrowser-left-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.partsbrowser-right-panel {
    flex: 2;
    padding: 30px;
    overflow-y: auto;
}

.partsbrowser-divider {
    width: 1px;
    background-color: #d3d3d3;
    margin: 20px 0;
}

/* VIN Search Large */
.vin-search-container {
    width: 100%;
    max-width: 500px;
}

.vin-search-form-large {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.vin-input-large {
    width: 100%;
    padding: 20px 25px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #333;
    text-align: center;
    transition: border-color 0.3s ease;
}

.vin-input-large:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.vin-input-large::placeholder {
    color: #999;
    font-size: 1.5rem;
}

.partsbrowser-btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 8px;
    min-width: 200px;
}

/* Brands Grid */
.brands-container {
    width: 100%;
}

.brands-title {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.brand-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 15px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 40px;
}

.brand-button:hover {
    background: #e9ecef;
    border-color: #ff8a1e;
    color: #000000 ;    
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.partsbrowser-container a {
    color: #0f1115;
    text-decoration: none;
}

.partsbrowser-container a:hover {
    color: #000000 ;
    text-decoration: none;
}

.partsbrowser-container h1,
.partsbrowser-container h2,
.partsbrowser-container h3 {
    color: #333;
    font-weight: 600;
    margin-top: 0;
}

.partsbrowser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.partsbrowser-logo {
    color: #333;
    text-decoration: none;
}

.partsbrowser-logo-sub {
    font-weight: 300;
    color: #6c757d;
}

.partsbrowser-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.box {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.box-error {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.box-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #d1ecf1;
    border-color: #bee5eb;
}

.box-vehicle-header {
    background: #d1ecf1;
    border-color: #bee5eb;
    margin-bottom: 20px;
    padding: 20px;
}

.box-debug {
    margin-top: 50px;
    border-style: dashed;
    border-color: #6c757d;
}

.box-debug h4 {
    color: #495057;
    margin-top: 0;
}

.debug-box {
    background: #f8f9fa;
    color: #28a745;
    padding: 15px;
    white-space: pre-wrap;
    font-family: monospace;
    max-height: 300px;
    overflow: auto;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.grid-units {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.item {
    display: block;
    padding: 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    text-align: center;
    border-radius: 6px;
    color: #333;
    transition: border 0.2s;
}

.item:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.item-unit {
    padding: 0;
    overflow: hidden;
}

.unit-image {
    background: #f8f9fa;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-image img {
    max-height: 100%;
    max-width: 100%;
}

.unit-name {
    padding: 10px;
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
    background: #fff;
}

/* Wizard Styling */
.wizard-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.wizard-group {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    min-width: 200px;
    flex: 1;
}

.wizard-label {
    display: block;
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: bold;
}

.wizard-select {
    width: 100%;
    padding: 10px;
    background: #fff;
    color: #333;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.wizard-select:hover {
    border-color: #007bff;
}

.wizard-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.wizard-readonly {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
}

.checkmark {
    color: #28a745;
    margin-left: 8px;
}

.wizard-intro {
    color: #6c757d;
    margin-bottom: 15px;
}

.v-tag {
    background: #007bff;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    margin-right: 10px;
}

.vehicle-info {
    display: flex;
    align-items: center;
}

.vehicle-actions {
    margin-left: auto;
}

.vehicle-name-large {
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #202536;    
    letter-spacing: 1px;
}

.vehicle-vin {
    font-size: 1.2rem;
    color: #6c757d;
    font-family: monospace;
}

.vin-value {
    color: #495057;
    font-weight: bold;
}

.vehicle-description {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Buttons */
.partsbrowser-btn {
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.partsbrowser-btn-primary {
  background: #181a1e;
  color: #d4d8e1 !important;
  border: 1px solid #202226;
  border-radius: 8px;   
}

.partsbrowser-btn-primary:hover {
    background: rgb(54, 54, 54);
    color: #28a745 !important;
}

.partsbrowser-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.partsbrowser-btn-secondary:hover {
    background: rgba(255,255,255,.04);
    color: #fff;
}

.partsbrowser-btn-success {
    background: #28a745;
    color: #fff;
    padding: 10px 20px;
}

.partsbrowser-btn-success:hover {
    background: #218838;
    color: #fff;
}

.partsbrowser-btn-sm {
    padding: 5px 15px;
    font-size: 0.9rem;
}

/* Forms */
.vin-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vin-input {
    padding: 10px;
    flex: 1;
    max-width: 300px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #333;
    font-size: 1rem;
}

.vin-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

.vehicles-table td,
.vehicles-table th,
.parts-table td,
.parts-table th {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

.vehicles-table th,
.parts-table th {
    color: #6c757d;
    font-weight: 500;
    background: #f8f9fa;
}

.part-number {
    color: #007bff;
    font-weight: bold;
}

.part-oem {
    color: #007bff;
    font-weight: bold;
}

.part-footnote {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Tree Navigation */
.tree-container {
    margin-top: 10px;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.tree-item:hover {
    background-color: #f8f9fa;
}

.tree-indent {
    display: inline-block;
    width: 20px;
}

.tree-toggle {
    display: inline-block;
    width: 20px;
    cursor: pointer;
    text-align: center;
    color: #6c757d;
    user-select: none;
}

.tree-toggle:hover {
    color: #007bff;
}

.tree-children {
    display: none;
    margin-left: 20px;
}

.tree-children.expanded {
    display: block;
}

.tree-link {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
}

.tree-link:hover {
    color: #007bff;
    text-decoration: underline;
}

.tree-link.disabled {
    color: #6c757d;
    cursor: default;
}

/* Details View */
.details-title {
    margin-bottom: 15px;
    color: #333;
}

.details-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.details-image {
    flex: 2;
    max-width: 40%;
}

.details-image img {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.details-parts {
    flex: 1;
    height: 80vh;
    overflow: auto;
    min-width: 300px;
    padding: 0;
}

/* Mobile layout: stack image above parts list */
@media (max-width: 768px) {
    .details-container {
        flex-direction: column;
    }
    
    .details-image {
        max-width: 100%;
        flex: none;
        order: 1;
    }
    
    .details-parts {
        order: 2;
        min-width: 100%;
        height: auto;
        max-height: 60vh;
    }
}

.parts-table {
    margin: 0;
    width: 100%;
}

.parts-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

/* Quick Detail */
.quick-detail-header {
    margin-bottom: 15px;
}

.breadcrumb {
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 0.9rem;
    padding-left: 15px;
}

.breadcrumb-link {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-link.breadcrumb-active {
    color: #6c757d;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #6c757d;
}

.quick-detail-title {
    margin: 0;
    color: #333;
}

/* Text Utilities */
.text-muted {
    color: #6c757d;
}

/* Marketplace Column */
.part-marketplace {
    min-width: 200px;
    vertical-align: top;
}

.marketplace-loading {
    color: #6c757d;
    font-size: 0.9rem;
    padding: 8px 0;
}

.marketplace-content {
    padding: 4px 0;
}

.marketplace-single {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.marketplace-prices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.marketplace-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 0.9rem;
}

.marketplace-price-type {
    font-weight: 600;
    color: #333;
}

.marketplace-price {
    color: #28a745;
    font-weight: 600;
}

.marketplace-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.marketplace-link:hover {
    text-decoration: underline;
}

.marketplace-view-all {
    margin-top: 8px;
    align-self: flex-start;
}

.marketplace-status {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Match Badge Styles (reused from sparekey) */
.vf-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
    white-space: nowrap;
}

.vf-badge--exact {
    background: #e6ffed;
    border-color: #b7f5c3;
    color: #065f46;
}

.vf-badge--exact-alt {
    background: #e6f4ff;
    border-color: #bcdcff;
    color: #1e40af;
}

.vf-badge--partial {
    background: #fff7e6;
    border-color: #ffe0a6;
    color: #92400e;
}

.vf-badge--partial-alt {
    background: #fff7e6;
    border-color: #ffd58a;
    color: #92400e;
}

.vf-badge--title {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

.vf-badge--term {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #a6a6a6;
}

.apm-badge__icon {
    font-size: 0.7rem;
}
