:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --accent-color: #8b5cf6;
    --success-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 20px 0;
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

.logo svg {
    stroke: var(--accent-color);
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Search Card */
.search-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 850px;
    /* Slightly increased width */
    margin: 0 auto;
}

/* Tabs */
.search-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

.search-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    height: auto;
    min-width: auto;
}

.search-tab:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    transform: none;
}

.search-tab.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-color);
}

.search-tab svg {
    stroke: currentColor;
}

#searchForm {
    display: grid;
    grid-template-columns: 2fr 2fr 1.2fr auto;
    /* Adjusted column ratio */
    gap: 15px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

input,
select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

button[type="submit"] {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    height: 46px;
    /* Match input height roughly */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

button.loading .btn-text {
    display: none;
}

button.loading .loader {
    display: block;
}

/* Results */
.results-section {
    margin-top: 40px;
    padding-bottom: 60px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.results-section.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

.results-header h2 {
    font-size: 1.5rem;
}

.rank-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rank-badge.hidden {
    display: none;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.result-item:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.result-item.highlight {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.result-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

.result-item.highlight .result-rank {
    color: var(--success-color);
}

.result-content {
    flex: 1;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 4px;
    text-decoration: none;
    display: block;
}

.result-title:hover {
    text-decoration: underline;
}

.result-url {
    font-size: 0.85rem;
    color: var(--success-color);
    margin-bottom: 8px;
    display: block;
}

.result-snippet {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Map Specific Styles */
.map-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.map-rating {
    color: #fbbf24;
    /* Amber for stars */
    font-weight: 600;
}

.map-address {
    display: flex;
    align-items: center;
    gap: 4px;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    #searchForm {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }
}