/**
 * Bodenrichtwerte NRW - Premium Design
 * Modern, professionell, datenorientiert
 */

/* ============================================
   GOOGLE FONTS - Optimiert für Performance
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

/* ============================================
   CSS VARIABLEN
   ============================================ */
:root {
    /* Primärfarben - Tiefes Petrol/Teal */
    --primary-50: #f0fdfa;
    --primary-100: #ccfbf1;
    --primary-200: #99f6e4;
    --primary-300: #5eead4;
    --primary-400: #2dd4bf;
    --primary-500: #14b8a6;
    --primary-600: #0d9488;
    --primary-700: #0f766e;
    --primary-800: #115e59;
    --primary-900: #134e4a;
    
    /* Akzent - Warmes Orange */
    --accent-400: #fb923c;
    --accent-500: #f97316;
    --accent-600: #ea580c;
    
    /* Grautöne - Warm */
    --gray-50: #fafaf9;
    --gray-100: #f5f5f4;
    --gray-200: #e7e5e4;
    --gray-300: #d6d3d1;
    --gray-400: #a8a29e;
    --gray-500: #78716c;
    --gray-600: #57534e;
    --gray-700: #44403c;
    --gray-800: #292524;
    --gray-900: #1c1917;
    
    /* Semantische Farben */
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    /* Typografie */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Schatten */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 40px rgba(20, 184, 166, 0.15);
    
    /* Radien */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Container */
    --container-xl: 1200px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & GRUNDLAGEN
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-50) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

/* ============================================
   TYPOGRAFIE
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.875rem, 5vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, 1.875rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 1.5rem;
}

main {
    flex: 1;
    padding: 2.5rem 0 4rem;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 50%, var(--primary-900) 100%);
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(20, 184, 166, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.site-header .container {
    position: relative;
    z-index: 1;
}

.site-header h1 {
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header .subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    font-weight: 400;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb span {
    opacity: 0.5;
}

/* Navigation Links */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ============================================
   STATISTIK-KARTEN
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-700);
    line-height: 1.2;
}

.stat-card .label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #57534e;
    margin-top: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    border: none;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-card.highlight .value {
    color: white;
}

.stat-card.highlight .label {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   GEMEINDE-GRID
   ============================================ */
.gemeinde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.gemeinde-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.gemeinde-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
    opacity: 0;
    transition: opacity var(--transition);
}

.gemeinde-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-200);
}

.gemeinde-card:hover::before {
    opacity: 1;
}

.gemeinde-card h2,
.gemeinde-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.gemeinde-card .brw {
    font-family: var(--font-mono);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-700);
    line-height: 1;
}

.gemeinde-card .brw small {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: #57534e;
    margin-left: 0.25rem;
}

.gemeinde-card .range {
    font-size: 0.8rem;
    color: #57534e;
    margin-top: 0.5rem;
    font-weight: 500;
}

.gemeinde-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.85rem;
    color: #57534e;
}

.gemeinde-card .trend {
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius);
}

.gemeinde-card .trend.up {
    color: var(--danger);
    background: var(--danger-light);
}

.gemeinde-card .trend.down {
    color: var(--success);
    background: var(--success-light);
}

/* ============================================
   KREIS-SEKTION
   ============================================ */
.kreis-section {
    margin-bottom: 2rem;
}

.kreis-section-header {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kreis-section-header h2 {
    color: white;
    font-size: 1.125rem;
    margin: 0;
    font-weight: 600;
}

.kreis-section-header .count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.kreis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    overflow: hidden;
}

.kreis-card {
    background: white;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

.kreis-card:hover {
    background: var(--primary-50);
}

.kreis-card h3 {
    font-size: 1rem;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.kreis-card .typ {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kreis-card .typ.kreisfrei {
    background: var(--primary-100);
    color: var(--primary-700);
}

.kreis-card .stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.625rem;
    font-size: 0.875rem;
}

.kreis-card .stat .value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-700);
}

.kreis-card .stat .label {
    color: #57534e;
    font-size: 0.75rem;
}

/* ============================================
   RANKING-KARTEN
   ============================================ */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.ranking-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-100);
}

.ranking-card h2 {
    padding: 1.125rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: white;
    margin: 0;
}

.ranking-card h2.teuer { 
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); 
}
.ranking-card h2.guenstig { 
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%); 
}
.ranking-card h2.steigung { 
    background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-600) 100%); 
}
.ranking-card h2.rueckgang { 
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); 
}

.ranking-list {
    list-style: none;
}

.ranking-list li {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
}

.ranking-list li:hover {
    background: var(--gray-50);
}

.ranking-list li:last-child {
    border-bottom: none;
}

.rank {
    width: 28px;
    height: 28px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-right: 1rem;
    flex-shrink: 0;
}

.ranking-list li:nth-child(1) .rank {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.ranking-list li:nth-child(2) .rank {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.ranking-list li:nth-child(3) .rank {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: white;
}

.ranking-list a {
    flex: 1;
    color: var(--gray-800);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.ranking-list a:hover {
    color: var(--primary-600);
}

.ranking-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-700);
    text-align: right;
    min-width: 90px;
}

.ranking-value.up { color: var(--danger); }
.ranking-value.down { color: var(--success); }

.ranking-subvalue {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: #57534e;
    font-weight: 500;
}

/* ============================================
   TABELLEN
   ============================================ */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

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

thead {
    background: var(--gray-50);
}

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    border-bottom: 2px solid var(--gray-200);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--primary-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   FORMULARE
   ============================================ */
.search-box {
    margin-bottom: 1.5rem;
}

.search-box input,
.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: white;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.search-box input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.search-box input::placeholder {
    color: #57534e;
}

/* ============================================
   ALPHABET-NAVIGATION
   ============================================ */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.alphabet-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.alphabet-nav a:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
    transform: scale(1.1);
}

/* ============================================
   SORT-LINKS
   ============================================ */
.sort-links {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-links span {
    font-weight: 500;
}

.sort-links a {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sort-links a:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.sort-links a.active {
    background: var(--primary-100);
    color: var(--primary-700);
}

/* ============================================
   INTRO-BOX
   ============================================ */
.intro-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}

.intro-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
}

.intro-box h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.intro-box p {
    color: var(--gray-600);
    line-height: 1.7;
}

.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.stats-bar .stat-item .value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-700);
}

.stats-bar .stat-item .label {
    font-size: 0.8rem;
    color: #57534e;
    font-weight: 500;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: #e0f2fe;
    color: #0284c7;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.section-header h2::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
    border-radius: 2px;
}

/* ============================================
   NACHBAR-KARTEN
   ============================================ */
.nachbar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.nachbar-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.nachbar-card:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.nachbar-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.375rem;
}

.nachbar-card .value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-700);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: auto;
}

.site-footer .container {
    text-align: center;
}

.site-footer p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--primary-300);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: #57534e; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary-600); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rankings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 2rem 0;
    }
    
    .site-header h1 {
        font-size: 1.75rem;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .gemeinde-grid {
        grid-template-columns: 1fr;
    }
    
    .kreis-grid {
        grid-template-columns: 1fr;
    }
    
    .alphabet-nav {
        padding: 0.75rem;
    }
    
    .alphabet-nav a {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    
    main {
        padding: 1.5rem 0 3rem;
    }
    
    .intro-box {
        padding: 1.25rem;
    }
    
    .stats-bar {
        gap: 1.25rem;
    }
    
    .stats-bar .stat-item .value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .value {
        font-size: 1.375rem;
    }
    
    .gemeinde-card {
        padding: 1.25rem;
    }
    
    .gemeinde-card .brw {
        font-size: 1.5rem;
    }
    
    .ranking-list li {
        padding: 0.75rem 1rem;
    }
    
    .ranking-value {
        min-width: 75px;
        font-size: 0.9rem;
    }
}

/* ============================================
   STADT-SEITE SPEZIFISCH
   ============================================ */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
}

.hero-stat {
    text-align: center;
    padding: 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.hero-stat .value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
}

.hero-stat .label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.highlight {
    color: var(--primary-600);
    font-weight: 600;
    background: var(--primary-50);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.section {
    margin-bottom: 2.5rem;
}

.section h2 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
    border-radius: 2px;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.price-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}

.price-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.price-card.highlight-card {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border: none;
}

.price-card .label {
    font-size: 0.8rem;
    color: #57534e;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.price-card.highlight-card .label {
    color: rgba(255, 255, 255, 0.8);
}

.price-card .value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-700);
}

.price-card.highlight-card .value {
    color: white;
}

.price-card .sub {
    font-size: 0.75rem;
    color: #57534e;
    margin-top: 0.25rem;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.trend-badge.up {
    background: var(--danger-light);
    color: var(--danger);
}

.trend-badge.down {
    background: var(--success-light);
    color: var(--success);
}

/* Calculator */
.calculator {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calc-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.375rem;
}

.calc-row input,
.calc-row select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.calc-row input:focus,
.calc-row select:focus {
    border-color: var(--primary-400);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-100);
}

.calc-result {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 1.25rem;
    text-align: center;
    border: 1px solid var(--primary-200);
}

.calc-result .value {
    font-family: var(--font-mono);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-700);
}

.calc-result .label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Zones Table */
.zones-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.zones-table th,
.zones-table td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.zones-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.zones-table tbody tr:hover {
    background: var(--primary-50);
}

/* Chart */
.chart-container {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
    border: 1px solid var(--gray-100);
}

.chart-title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#preisentwicklungChart {
    max-height: 350px;
}

/* Compare Grid */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.compare-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.compare-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.compare-card h4 {
    font-size: 1rem;
    margin-bottom: 0.375rem;
}

.compare-card .brw {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-700);
}

/* Hochschulen */
.hochschulen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.hochschule-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.hochschule-card h4 {
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.hochschule-card .typ {
    font-size: 0.8rem;
    color: #57534e;
}

/* FAQ */
.faq-list {
    margin-top: 1rem;
}

.faq-item {
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--gray-100);
}

.faq-question {
    padding: 1.125rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-fast);
}

.faq-question:hover {
    background: var(--gray-50);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: #57534e;
    transition: transform var(--transition-fast);
}

.faq-item.open .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.25rem;
    color: var(--gray-600);
    line-height: 1.7;
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
}

@media (max-width: 768px) {
    .calc-row {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-stat {
        padding: 1rem 0.75rem;
    }
    
    .hero-stat .value {
        font-size: 1.375rem;
    }
    
    .price-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calc-result .value {
        font-size: 1.75rem;
    }
}

/* ============================================
   LEGAL PAGES (Impressum, Datenschutz)
   ============================================ */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.legal-section h2 {
    font-size: 1.375rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-100);
    color: var(--gray-900);
}

.legal-section h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.legal-section h3:first-of-type {
    margin-top: 0;
}

.legal-section p {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-section ul {
    color: var(--gray-600);
    line-height: 1.8;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-section li {
    margin-bottom: 0.5rem;
}

.legal-section a {
    color: var(--primary-600);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-section a:hover {
    color: var(--primary-700);
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .site-header {
        background: white;
        color: black;
        padding: 1rem 0;
    }
    
    .site-header h1 { color: black; }
    
    .nav-links, .search-box, .alphabet-nav, .sort-links, .calculator {
        display: none;
    }
    
    .card, .stat-card, .gemeinde-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .site-footer {
        background: white;
        color: black;
    }
}
