:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --border: #475569;
    --radius: 10px;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

/* Search Panel */
.search-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.flex-2 {
    flex: 2;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.form-group input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.65rem 1.8rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Alerts */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Status Panel */
.status-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.status-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.status-log {
    max-height: 180px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-message {
    color: var(--text-muted);
    padding: 2px 0;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.status-message:last-child {
    color: var(--success);
    font-weight: 500;
}

/* Map */
.map-container {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

#map {
    height: 400px;
    width: 100%;
    background: #1a1a2e;
}

.custom-marker {
    background: none !important;
    border: none !important;
}

/* Results */
.results-panel {
    margin-bottom: 2rem;
}

.results-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.location-result {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.location-result.searching {
    border-color: var(--warning);
}

.location-result.has-results {
    border-color: var(--success);
}

.location-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.location-name {
    font-weight: 600;
    font-size: 1rem;
}

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

.badge {
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

.badge-searching {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-found {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-empty {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.error-detail {
    color: #fca5a5;
    font-size: 0.8rem;
    padding: 0.3rem 0;
}

/* Listings Grid */
.listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.listing-card {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-input);
    border-radius: 8px;
    padding: 0.7rem;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.listing-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.listing-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.listing-title {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-price {
    color: var(--success);
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0.15rem 0;
}

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

/* Responsive */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .listings {
        grid-template-columns: 1fr;
    }
}

/* Default Blazor styles kept */
h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDki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jEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}