:root {
    --primary: #2d5a27;
    --primary-light: #4a8c3f;
    --primary-dark: #1e3d1a;
    --accent: #8bc34a;
    --blue: #1565c0;
    --blue-light: #1e88e5;
    --new-color: #e65100;
    --wbs-color: #6a1b9a;
    --bg: #f5f9f3;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-light: #666;
    --border: #d4e5d1;
    --shadow: rgba(45, 90, 39, 0.1);
}

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

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

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
}

.header-content { max-width: 1200px; margin: 0 auto; }

header h1 { font-size: 1.8rem; font-weight: 700; }

.tagline { margin-top: 0.3rem; opacity: 0.85; font-size: 1rem; }

/* Stadt-Tabs */
.city-tabs {
    display: flex;
    gap: 0;
    background: var(--primary-dark);
    justify-content: center;
    padding: 0 2rem;
}

.city-tab {
    padding: 0.7rem 2rem;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.65);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.city-tab:hover { color: white; }

.city-tab.active {
    color: white;
    border-bottom-color: var(--accent);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}

/* Filter */
.filters { margin-bottom: 1.5rem; }

.filter-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: var(--bg);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.range-inputs { display: flex; align-items: center; gap: 0.4rem; }
.range-inputs input { width: 100%; }
.range-inputs span { color: var(--text-light); flex-shrink: 0; }

.filter-actions { display: flex; gap: 0.6rem; }

.btn-primary, .btn-secondary {
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

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

.btn-secondary { background: var(--bg); color: var(--primary); border: 2px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Stats */
.stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 100px;
}

.stat-card.new-card { border-color: #ffcc80; background: #fff8f0; }
.stat-card.new-card .stat-number { color: var(--new-color); }

.stat-number { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-light); }

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-light);
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* Cards */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.listing-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 3px 15px var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow);
}

.listing-card.is-new {
    border-left: 4px solid var(--new-color);
}

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.badges { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }

.source-badge {
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.source-badge.rostock {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
}

.new-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    color: white;
    background: var(--new-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse 2s ease-in-out infinite;
}

.wbs-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    background: var(--wbs-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.city-label { font-size: 0.78rem; color: var(--text-light); white-space: nowrap; }

.listing-card h3 {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.4;
}

.listing-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.detail { display: flex; align-items: center; gap: 0.4rem; }
.detail-icon { font-size: 0.9rem; }
.detail-value { font-size: 0.9rem; color: var(--text); }

.listing-link {
    display: inline-block;
    background: var(--bg);
    color: var(--primary);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid var(--border);
    margin-top: auto;
    text-align: center;
}

.listing-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* City Sections */
.city-section {
    margin-bottom: 2rem;
}

.city-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border);
}

.city-section-icon {
    font-size: 1.4rem;
}

.city-section-count {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-left: auto;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.error { color: #d32f2f; }

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

@media (max-width: 768px) {
    header h1 { font-size: 1.4rem; }
    main { padding: 1rem; }
    .filter-grid { grid-template-columns: 1fr; }
    .stats { flex-direction: column; }
    .listings-grid { grid-template-columns: 1fr; }
    .listing-details { grid-template-columns: 1fr; }
    .city-tab { padding: 0.6rem 1rem; font-size: 0.85rem; }
}
