/* 
 * JCD Auctions - Clean Modern Design
 * Palette: Steel Blue #0582ca, Baltic Blue #006494, Cyan #2dc2bd, White #fff, Onyx #0f0f0f
 */

:root {
    --steel-blue: #0582ca;
    --baltic-blue: #006494;
    --cyan: #2dc2bd;
    --white: #ffffff;
    --onyx: #0f0f0f;
    
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 6px;
    --radius-lg: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    
    /* New spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Status colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    scroll-behavior: smooth;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--onyx);
    color: var(--white);
    padding: 0.5rem 1rem;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Navigation */
.navbar {
    background: var(--onyx);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover { color: var(--cyan); }

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.navbar-menu a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
}

.navbar-menu a:hover { color: var(--cyan); }

.nav-user {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nav-logout-form {
    margin: 0;
}

/* Header */
.page-header {
    padding: 2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    background: var(--white);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--onyx);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    font-size: 0.85rem;
}

.stats-left {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.stats-status.ok {
    color: var(--success);
}

.stats-status.error {
    color: var(--error);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.625rem;
    background: rgba(45, 194, 189, 0.1);
    color: #0d9488;
    border-radius: 100px;
    margin-top: 0.75rem;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

/* Filters */
.filters-wrapper {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow);
}

.share-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.share-banner-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.sticky-filters {
    position: sticky;
    top: 64px;
    z-index: 90;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.sticky-filters-content {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    font-size: 0.85rem;
}

.sticky-summary {
    color: var(--text-muted);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.filters-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--onyx);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filters-icon {
    font-size: 1.1rem;
}

.filter-count-badge {
    background: var(--steel-blue);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    min-width: 1.25rem;
    text-align: center;
}

.filters-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.filters-subtitle kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.125rem 0.375rem;
    font-family: inherit;
    font-size: 0.75rem;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Scope Pills */
.scope-section {
    margin-bottom: var(--space-sm);
}

.scope-pills {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg);
    padding: 3px;
    border-radius: var(--radius);
    width: fit-content;
}

.scope-pill {
    padding: 0.375rem 0.875rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.15s;
}

.scope-pill:hover {
    color: var(--text);
}

.scope-pill.active {
    background: var(--white);
    color: var(--steel-blue);
    box-shadow: var(--shadow);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

/* Collapsible Filter Groups */
.filter-group-collapsible {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.filter-group-collapsible[open] {
    background: var(--white);
}

.filter-group-header {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
}

.filter-group-header::-webkit-details-marker {
    display: none;
}

.filter-group-header::after {
    content: '▼';
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: transform 0.2s;
}

.filter-group-collapsible[open] .filter-group-header::after {
    transform: rotate(180deg);
}

.filter-group-icon {
    font-size: 0.9rem;
}

.filter-group-content {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.search-group {
    grid-column: span 2;
}

/* Range Inputs */
.range-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.range-separator {
    color: var(--text-muted);
    font-weight: 500;
}

.input-with-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
}

.input-suffix {
    position: absolute;
    right: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.input-with-suffix input {
    width: 100%;
    padding-right: 2.5rem;
}

.input-with-suffix input[name*="price"] {
    padding-left: 1.75rem;
}

.input-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Form Inputs */
.filter-group-content input,
.filter-group-content select,
.filters input,
.filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.filter-group-content input:focus,
.filter-group-content select:focus,
.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--steel-blue);
    box-shadow: 0 0 0 3px rgba(5, 130, 202, 0.1);
}

.filter-group-content input::placeholder,
.filters input::placeholder {
    color: #94a3b8;
}

.filter-group-content input:hover,
.filters input:hover {
    border-color: #cbd5e1;
}

/* Input Validation */
.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px var(--error-bg) !important;
}

.error-message {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 2px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.preset-btn,
.preset-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.preset-btn:hover,
.preset-link:hover {
    background: var(--steel-blue);
    border-color: var(--steel-blue);
    color: var(--white);
}

.reset-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.reset-link:hover {
    color: var(--error);
}

/* Search Input */
.search-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-input-wrap input {
    font-size: 0.9rem;
}

.search-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* More Filters */
.more-filters-section {
    border-top: 1px solid var(--border);
    padding-top: var(--space-md);
}

.more-filters-toggle {
    background: none;
    border: none;
    color: var(--steel-blue);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}

.more-filters-toggle:hover {
    text-decoration: underline;
}

.more-filters-panel {
    display: none;
    padding-top: var(--space-md);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.more-filters-panel.expanded {
    display: flex;
}

/* Toggle Switches */
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
}

.toggle-input {
    display: none;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 100px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--white);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: var(--shadow);
}

.toggle-input:checked + .toggle-switch {
    background: var(--steel-blue);
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(16px);
}

/* Limit Group */
.limit-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.limit-group label {
    font-size: 0.85rem;
    color: var(--text);
}

.limit-group select {
    width: auto;
    min-width: 80px;
}

.limit-warning {
    font-size: 0.7rem;
    color: var(--warning);
}

/* Recent Filters */
.recent-filters {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.recent-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.recent-filters-list {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.recent-filter-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-filter-btn:hover {
    border-color: var(--steel-blue);
    color: var(--steel-blue);
}

.filter-actions {
    display: flex;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

/* Filter Chips */
.filter-chips {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg);
    border-radius: var(--radius);
    margin-top: var(--space-md);
}

.chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    flex: 1;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.75rem;
}

.chip-label {
    color: var(--text-muted);
}

.chip-value {
    color: var(--text);
    font-weight: 500;
}

.chip-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
}

.chip-remove:hover {
    color: var(--error);
}

.btn-link {
    background: none;
    border: none;
    color: var(--steel-blue);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--baltic-blue);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--steel-blue);
    color: var(--white);
    box-shadow: 0 1px 2px rgba(5, 130, 202, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--baltic-blue);
    box-shadow: 0 2px 4px rgba(5, 130, 202, 0.3);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    color: var(--text);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Auth */
.auth-container {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.auth-form {
    display: grid;
    gap: 0.75rem;
}

.auth-submit {
    margin-top: 0.5rem;
}

.auth-error {
    margin-bottom: 1rem;
}

/* Results */
.results {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: visible;
}

.results.loading-fade {
    opacity: 0.6;
    pointer-events: none;
}

.results-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.results-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.results-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.results-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.results-count strong {
    color: var(--text);
}

.results-summary {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.results-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: center;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    margin-left: 4px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
    min-width: 150px;
    z-index: 50;
    display: none;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-menu label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 3px;
}

.dropdown-menu label:hover {
    background: var(--bg);
}

/* Table */
.table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

/* Horizontal scroll shadow indicator */
.table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.table-wrap.has-scroll::after {
    opacity: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

/* Caption for accessibility */
table caption {
    text-align: left;
    padding: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
}

thead {
    background: var(--onyx);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

th:hover {
    background: #1a1a1a;
}

th[data-sort] {
    position: relative;
    padding-right: 1.5rem;
}

.sort-icon::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    opacity: 0.4;
    font-size: 0.7rem;
}

th.sort-asc .sort-icon::after {
    content: '▲';
    opacity: 1;
}

th.sort-desc .sort-icon::after {
    content: '▼';
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.1s;
}

/* Zebra striping */
tbody tr.even {
    background: var(--white);
}

tbody tr.odd {
    background: #fafbfc;
}

tbody tr:hover {
    background: #f1f5f9;
}

tbody tr.selected {
    background: var(--info-bg);
}

tbody tr.pinned {
    background: var(--warning-bg);
}

td {
    padding: 0.75rem 1rem;
    vertical-align: top;
}

/* Numeric columns */
.numeric {
    text-align: right;
    font-family: "SF Mono", "Menlo", "Monaco", monospace;
    font-size: 0.8rem;
}

/* Column-specific styles */
.col-actions {
    width: 80px;
    text-align: center;
}

.row-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
    color: var(--text-muted);
}

.row-action-btn:hover,
.row-action-btn.active {
    opacity: 1;
}

.row-action-btn.auction-link {
    text-decoration: none;
    font-size: 0.9rem;
}

.copy-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-left: 4px;
    color: var(--text-muted);
    transition: all 0.15s;
}

.copy-btn:hover {
    background: var(--steel-blue);
    border-color: var(--steel-blue);
    color: var(--white);
}

/* Date badges */
.date-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 4px;
    text-transform: uppercase;
}

.date-badge.today {
    background: var(--success-bg);
    color: var(--success);
}

.date-badge.tomorrow {
    background: var(--info-bg);
    color: var(--info);
}

.col-date.date-past {
    color: var(--text-muted);
}

/* Image column */
.col-image {
    width: 170px;
    min-width: 170px;
    text-align: center;
    padding: 4px !important;
    position: relative;
    overflow: visible;
}

.image-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.image-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 8px;
}

.listing-thumb {
    width: 50px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transform-origin: left center;
}

.listing-thumb:hover {
    transform: scale(2.5);
    box-shadow: var(--shadow-lg);
    z-index: 20;
}

.no-image {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.vehicle-title {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.125rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Search highlight */
.search-highlight {
    background: rgba(5, 130, 202, 0.15);
    color: var(--baltic-blue);
    padding: 0 2px;
    border-radius: 2px;
}
    color: var(--text-muted);
}

.grade {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--bg);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--baltic-blue);
}

.price {
    font-weight: 600;
    color: var(--text);
}

.price-sold,
.sold-price {
    color: var(--cyan);
    font-weight: 600;
}

.mileage {
    white-space: nowrap;
}

/* Skeleton Loading */
.skeleton-row td {
    padding: 0.75rem 1rem;
}

.skeleton-cell {
    height: 16px;
    background: linear-gradient(90deg, var(--border) 25%, #e8ecf0 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-cell.wide {
    width: 180px;
}

.skeleton-cell.narrow {
    width: 50px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* States */
.loading, .no-results, .error-msg {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--steel-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 0.75rem;
}

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

.error-msg {
    background: var(--error-bg);
    color: #991b1b;
    border-radius: var(--radius);
    margin: 1rem;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.error-icon {
    font-size: 2rem;
}

.error-text {
    font-weight: 500;
}

/* No Results */
.no-results-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.no-results-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.no-results-content h3 {
    color: var(--text);
    font-size: 1.1rem;
}

.no-results-suggestions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.hidden { display: none !important; }

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--onyx);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--steel-blue);
    transform: translateY(-2px);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--onyx);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning);
    color: var(--onyx);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateY(-100%);
    transition: transform 0.3s;
    z-index: 1000;
}

.offline-indicator.visible {
    transform: translateY(0);
}

/* Compare Modal */
.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--space-lg);
}

.compare-modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.compare-header h2 {
    font-size: 1.1rem;
    color: var(--onyx);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text);
}

.compare-body {
    overflow: auto;
    padding: var(--space-lg);
}

/* Image Gallery Modal */
body.modal-open {
    overflow: hidden;
}

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: var(--space-lg);
}

.image-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.image-modal-stage {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-main {
    max-width: 95vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    background: #111;
    box-shadow: var(--shadow-lg);
}

.image-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    transform: translateY(-40px);
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-nav:hover {
    background: rgba(0,0,0,0.7);
}

.image-modal-nav.prev { left: 10px; }
.image-modal-nav.next { right: 10px; }

.image-modal-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0.9;
}

.image-modal-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75%;
}

.image-modal-thumbs {
    width: 100%;
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-xs);
}

.image-modal-thumb {
    width: 110px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    flex: 0 0 auto;
}

.image-modal-thumb.active {
    border-color: var(--cyan);
    opacity: 1;
}

.compare-table {
    width: 100%;
}

.compare-table th,
.compare-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.compare-table .field-label {
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.compare-table tr.highlight-diff td:not(.field-label) {
    background: var(--warning-bg);
}

/* Footer */
.footer {
    margin-top: 3rem;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* About page */
.content-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.content-section h2 {
    font-size: 1.125rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--onyx);
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p, .content-section ul {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-section li {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 2rem;
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.error-page p {
    color: var(--text-muted);
}

/* Compact View Mode */
.compact-view table {
    font-size: 0.8rem;
}

.compact-view th,
.compact-view td {
    padding: 0.5rem 0.75rem;
}

.compact-view .vehicle-title {
    font-size: 0.85rem;
}

.compact-view .vehicle-meta {
    font-size: 0.7rem;
}

/* Lot Number Column */
.col-lot {
    width: 80px;
    text-align: center;
}

.lot-number {
    display: inline-block;
    font-family: "SF Mono", "Menlo", "Monaco", monospace;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--baltic-blue);
    text-decoration: none;
}

.lot-number:hover {
    text-decoration: underline;
}

/* Pagination & Results Footer */
.results-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination-actions {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

#load-more-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Error Page Styles */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: var(--space-xl);
}

.error-page .error-content {
    text-align: center;
    max-width: 400px;
}

.error-page .error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--steel-blue);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.error-page h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.error-page .error-message {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.error-page .error-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* Print Styles */
@media print {
    .navbar,
    .filters-wrapper,
    .results-header-right,
    .results-footer,
    .back-to-top,
    .filter-chips,
    .col-actions {
        display: none !important;
    }
    
    .results {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    thead {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    tbody tr:nth-child(even) {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .search-group {
        grid-column: span 1;
    }
    
    .filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .scope-pills {
        width: 100%;
    }
    
    .scope-pill {
        flex: 1;
        text-align: center;
    }
    
    .filter-actions {
        position: sticky;
        bottom: 0;
        background: var(--white);
        padding: var(--space-md);
        margin: 0 calc(-1 * var(--space-lg));
        margin-bottom: calc(-1 * var(--space-lg));
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    th, td {
        padding: 0.625rem 0.75rem;
    }
    
    .page-header {
        padding: 1.5rem 0 1rem;
    }
    
    .toggle-group {
        flex-direction: column;
    }
    
    .filter-chips {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .compare-modal-content {
        max-height: 90vh;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .preset-buttons {
        display: none;
    }
    
    .more-filters-panel {
        flex-direction: column;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}
