:root {
    --primary-green: #228B22;
    --primary-green-dark: #1a6b1a;
    --accent-blue: #007BFF;
    --rating-red: #FF0000;
    --rating-orange: #FFA500;
    --rating-yellow: #FFFF00;
    --rating-green: #00FF00;
    --bg-main: #F0F0F0;
    --bg-white: #FFFFFF;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --text-primary: #212529;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition-speed: 0.3s;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    color: var(--text-primary);
}

main {
    flex: 1;
}

.navbar {
    background: var(--primary-green);
    padding: 0.75rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    color: white !important;
}

.navbar-brand i {
    color: white;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color var(--transition-speed);
}

.nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.search-container {
    width: 280px;
}

.search-input {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 2.2rem 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-top: 4px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-speed);
}

.autocomplete-item:hover {
    background: var(--bg-main);
}

.autocomplete-item .city-name {
    font-weight: 500;
}

.autocomplete-item .city-score {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.score-high { background: rgba(0, 255, 0, 0.2); color: #006600; }
.score-mid { background: rgba(255, 165, 0, 0.2); color: #995500; }
.score-low { background: rgba(255, 0, 0, 0.2); color: #990000; }

.hero-section {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    padding: 2.5rem 0 0 0;
    margin-bottom: 0;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.hero-search {
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

.hero-search-input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--text-primary);
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.hero-search-input::placeholder {
    color: var(--text-muted);
}

.hero-search-input:focus {
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

#map {
    height: 450px;
    width: 100%;
    border-radius: 0;
}

.hero-compact {
    background: var(--primary-green);
    padding: 1.5rem 0;
}

.hero-title-sm {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.hero-subtitle-sm {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.hero-search-compact {
    max-width: 500px;
}

.tagline-section {
    background: white;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tagline-box {
    padding: 0.5rem 0;
}

.tagline-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
}

.search-cta-box {
    background: var(--bg-main);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.search-cta-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.75rem;
}

.stats-vertical {
    background: var(--bg-main);
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label-inline {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value-inline {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.9rem;
}

.podium-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.podium-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-main);
    border-radius: 6px;
    font-size: 0.9rem;
}

.podium-1 { background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%); }
.podium-2 { background: linear-gradient(135deg, #f3f4f6 0%, #d1d5db 100%); }
.podium-3 { background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); }

.podium-rank {
    font-weight: 700;
    color: var(--text-primary);
    width: 20px;
    text-align: center;
}

.podium-city {
    flex: 1;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
}

.podium-city:hover {
    text-decoration: underline;
}

.podium-score {
    font-weight: 600;
    color: var(--primary-green);
}

.main-content-section {
    padding: 1.5rem 0;
}

.homepage-map {
    height: 380px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.homepage-map-sm {
    height: 200px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.homepage-map-lg {
    height: 450px;
    width: 100%;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--border-color);
    border-top: none;
}

.map-title-bar {
    background: var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.tagline-box {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.stats-box {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.podium-box {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.search-cta-box {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--primary-green);
}

.search-cta-title {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.section-title-sm {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rank-badge-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-main);
    color: var(--text-muted);
}

.rank-badge-sm.rank-1 { background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%); color: #92400e; }
.rank-badge-sm.rank-2 { background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%); color: #374151; }
.rank-badge-sm.rank-3 { background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%); color: #7c2d12; }

.city-link-sm {
    color: var(--primary-green);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.85rem;
}

.city-link-sm:hover {
    text-decoration: underline;
}

.score-badge-sm {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.score-badge-sm.high { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.score-badge-sm.mid { background: rgba(234, 179, 8, 0.15); color: #a16207; }
.score-badge-sm.low { background: rgba(239, 68, 68, 0.15); color: #dc2626; }

.recent-reviews-sidebar {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.recent-reviews-list {
    max-height: 280px;
    overflow-y: auto;
}

.recent-review-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--bg-main);
    font-size: 0.8rem;
}

.recent-review-item:last-child {
    border-bottom: none;
}

.review-date-sm {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.review-city-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
}

.review-city-link:hover {
    text-decoration: underline;
}

.category-averages-box {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.category-averages-table table {
    min-width: 900px;
}

.category-header-row th {
    padding: 0.25rem;
    vertical-align: middle;
}

.category-name-row th {
    padding: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    vertical-align: top;
}

.category-col {
    width: 80px;
    max-width: 80px;
}

.rank-badge-cat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--primary-green);
    color: white;
}

.rank-badge-cat.score-high {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #166534;
}

.rank-badge-cat.score-mid {
    background: linear-gradient(135deg, #fde047, #facc15);
    color: #854d0e;
}

.rank-badge-cat.score-low {
    background: linear-gradient(135deg, #fca5a5, #f87171);
    color: #991b1b;
}

.category-name-sm {
    display: block;
    font-size: 0.65rem;
    line-height: 1.2;
    color: var(--text-muted);
}

.category-score {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    min-width: 45px;
    text-align: center;
}

.category-score.high { 
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #166534;
}
.category-score.mid { 
    background: linear-gradient(135deg, #fde047, #facc15);
    color: #854d0e;
}
.category-score.low { 
    background: linear-gradient(135deg, #fca5a5, #f87171);
    color: #991b1b;
}

.category-grid-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.category-btn-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.category-btn-sm:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.category-btn-sm i {
    font-size: 0.75rem;
}

.population-filter {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.green { background: #22c55e; }
.legend-dot.yellow { background: #eab308; }
.legend-dot.red { background: #ef4444; }
.legend-dot.gray { background: #9ca3af; }

.ranking-table.compact {
    font-size: 0.9rem;
}

.ranking-table.compact td {
    padding: 0.5rem 0.25rem;
}

.city-link {
    color: var(--primary-green);
    font-weight: 500;
    text-decoration: none;
}

.city-link:hover {
    text-decoration: underline;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.category-btn:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.category-btn i {
    font-size: 0.9rem;
}

.stats-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: 6px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

@media (max-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .homepage-map {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .hero-title-sm {
        font-size: 1.4rem;
    }
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-green);
}

.content-section {
    padding: 2rem 0;
}

.city-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    overflow: hidden;
    height: 100%;
}

.city-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
}

.city-card .card-body {
    padding: 1rem;
}

.city-card .city-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.city-card .city-state {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

.city-card .score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.score-badge.high { background: var(--rating-green); color: #004400; }
.score-badge.mid { background: var(--rating-orange); color: #442200; }
.score-badge.low { background: var(--rating-red); color: white; }
.score-badge.none { background: #ccc; color: #666; }

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

.review-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    margin-bottom: 0.75rem;
}

.review-card:hover {
    box-shadow: var(--card-hover-shadow);
}

.review-card .card-body {
    padding: 1rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.review-city {
    font-weight: 600;
    color: var(--primary-green);
}

.review-category {
    background: var(--bg-main);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.review-text {
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

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

.city-hero {
    position: relative;
    height: 320px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    margin-bottom: 0;
}

.city-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.city-hero-content {
    position: relative;
    z-index: 10;
    padding-bottom: 2rem;
}

.city-hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    letter-spacing: -1px;
}

.city-hero-state {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-weight: 400;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.city-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.city-hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.city-hero-badge.city-hero-score {
    background: rgba(0, 128, 0, 0.8);
    border-color: rgba(0, 200, 0, 0.5);
}

.city-hero-badge.city-hero-score.score-high {
    background: rgba(0, 128, 0, 0.85);
}

.city-hero-badge.city-hero-score.score-mid {
    background: rgba(180, 130, 0, 0.85);
}

.city-hero-badge.city-hero-score.score-low {
    background: rgba(180, 0, 0, 0.85);
}

.city-hero-badge.city-hero-link {
    text-decoration: none;
}

.city-hero-badge.city-hero-link:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .city-hero {
        height: 260px;
    }
    
    .city-hero-title {
        font-size: 2rem;
    }
    
    .city-hero-state {
        font-size: 1rem;
    }
    
    .city-hero-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

.city-detail-header {
    background: var(--primary-green);
    padding: 2rem 0;
    margin-bottom: 1.5rem;
}

.city-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.city-detail-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    height: 100%;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stat-value.score-high { color: #006600; }
.stat-value.score-mid { color: #996600; }
.stat-value.score-low { color: #990000; }
.stat-value.score-none { color: var(--text-muted); }

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.rating-form-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 80px;
}

.rating-form-header {
    background: var(--primary-green);
    color: white;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 1rem;
}

.rating-form-body {
    padding: 1.25rem;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    transition: all var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.15);
}

.btn-primary {
    background: var(--accent-blue);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--primary-green);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-success:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.chart-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.reviews-section {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.reviews-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1rem;
    background: var(--bg-main);
}

.review-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-speed);
}

.review-item:last-child {
    border-bottom: none;
}

.review-item:hover {
    background: var(--bg-main);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.review-content {
    position: relative;
}

.review-content.collapsed {
    max-height: 70px;
    overflow: hidden;
}

.review-content.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: linear-gradient(transparent, white);
}

.review-toggle {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.review-toggle:hover {
    text-decoration: underline;
}

.review-item-badges {
    display: flex;
    gap: 0.4rem;
}

.ville-ideale-review {
    padding: 1.25rem;
}

.ville-ideale-review .review-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.ville-ideale-review .review-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ville-ideale-review .review-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ville-ideale-review .review-pseudo {
    font-size: 0.9rem;
}

.ville-ideale-review .review-overall-score {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
}

.review-category-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.review-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    padding: 0.4rem;
}

.review-cat-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    max-width: 70px;
}

.review-cat-score {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}

.review-cat-score.score-high {
    background: #e8f5e9;
    color: #2e7d32;
}

.review-cat-score.score-mid {
    background: #fff8e1;
    color: #f57c00;
}

.review-cat-score.score-low {
    background: #ffebee;
    color: #c62828;
}

.review-cat-score.score-none {
    background: #f5f5f5;
    color: #9e9e9e;
}

.review-pros, .review-cons {
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .review-category-scores {
        gap: 0.25rem;
    }
    .review-cat-item {
        min-width: 45px;
        padding: 0.25rem;
    }
    .review-cat-name {
        font-size: 0.55rem;
        max-width: 50px;
    }
    .review-cat-score {
        font-size: 0.75rem;
        padding: 0.15rem 0.35rem;
    }
}

.mini-map {
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.footer-section {
    background: var(--dark-bg);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 0 1rem;
    margin-top: 2rem;
}

.footer-section h5, .footer-section h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-section a:hover {
    color: var(--accent-blue);
}

.footer-section .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section ul li {
    color: rgba(255, 255, 255, 0.7);
}

.footer-section hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0 1rem;
}

.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.marker-pin:hover {
    transform: scale(1.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.marker-pin.has-ratings {
    animation: pulse 2s infinite;
}

.marker-pin.has-ratings:hover {
    animation: none;
}

.marker-green { background: var(--rating-green); }
.marker-yellow { background: var(--rating-orange); }
.marker-red { background: var(--rating-red); }
.marker-gray { background: #999; }

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 180px;
}

.popup-content {
    padding: 0.75rem;
}

.popup-content h6 {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.popup-content p {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.popup-content .btn {
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.4rem;
    font-size: 0.85rem;
}

.search-results-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.search-results-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}

.search-results-header h4 {
    font-weight: 600;
    margin-bottom: 0;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
}

.table td {
    padding: 0.75rem 1.25rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-speed);
}

.table tbody tr:hover {
    background: var(--bg-main);
}

.rating-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.75rem;
}

.rating-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.rating-btn:hover {
    transform: scale(1.1);
}

.rating-btn.selected {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
}

.rating-btn-0, .rating-btn-1 { background: #FF0000; }
.rating-btn-2, .rating-btn-3 { background: #FF4400; }
.rating-btn-4, .rating-btn-5 { background: #FFA500; }
.rating-btn-6, .rating-btn-7 { background: #FFFF00; color: #333; }
.rating-btn-8, .rating-btn-9 { background: #88DD00; color: #333; }
.rating-btn-10 { background: #00FF00; color: #004400; }

.category-rating-row {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.category-rating-row:last-child {
    border-bottom: none;
}

.category-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.category-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.category-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-bar-fill.no-rating {
    background: repeating-linear-gradient(
        45deg,
        #ddd,
        #ddd 5px,
        #ccc 5px,
        #ccc 10px
    );
    width: 100%;
}

.category-score {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
}

.ranking-table {
    width: 100%;
}

.ranking-table th {
    background: var(--bg-main);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.ranking-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.ranking-table tr:hover {
    background: var(--bg-main);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-1 { background: #FFD700; color: #664400; }
.rank-2 { background: #C0C0C0; color: #444; }
.rank-3 { background: #CD7F32; color: white; }
.rank-other { background: var(--bg-main); color: var(--text-muted); }

.state-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.state-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.state-btn:hover, .state-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

@media (max-width: 992px) {
    .search-container {
        width: 100%;
        margin-top: 0.75rem;
    }
}

@media (max-width: 768px) {
    #map {
        height: 300px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .city-detail-title {
        font-size: 1.5rem;
    }
    
    .rating-form-card {
        position: relative;
        top: 0;
        margin-top: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .rating-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

.bulk-rating-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bulk-rating-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.bulk-rating-row:last-child {
    border-bottom: none;
}

.bulk-rating-label {
    min-width: 140px;
    font-weight: 500;
    font-size: 0.9rem;
}

.bulk-rating-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.bulk-btn {
    width: 30px;
    height: 30px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    color: white;
}

.bulk-btn:hover {
    transform: scale(1.1);
    z-index: 1;
}

.bulk-btn.selected {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4);
    transform: scale(1.15);
    z-index: 2;
}

.bulk-btn-0, .bulk-btn-1 { background: #FF0000; }
.bulk-btn-2, .bulk-btn-3 { background: #FF4400; }
.bulk-btn-4, .bulk-btn-5 { background: #FFA500; }
.bulk-btn-6, .bulk-btn-7 { background: #FFFF00; color: #333; }
.bulk-btn-8, .bulk-btn-9 { background: #88DD00; color: #333; }
.bulk-btn-10 { background: #00FF00; color: #004400; }

.bulk-rating-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .bulk-rating-row {
        flex-wrap: wrap;
    }
    
    .bulk-rating-label {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .bulk-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
}

.neighborhood-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.neighborhood-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
    border: 1px solid transparent;
}

.neighborhood-item:hover {
    background: var(--bg-white);
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateX(4px);
}

.neighborhood-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Quick Stats Section */
.quick-stat-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.quick-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
}

.quick-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.contribute-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px dashed var(--border-color);
}

.contribute-section h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.review-item-full {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.review-item-full:last-child {
    border-bottom: none;
}


/* Bottom Stats Section - Separate from main content */
.bottom-stats-section {
    background: white;
    padding: 2rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}


/* Navbar Logo */
.navbar-logo {
    height: 28px;
    width: auto;
}

/* Explore Hub Styles */
.explore-cta-card {
    display: block;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
    height: 100%;
}

.explore-cta-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.15);
    transform: translateY(-2px);
}

.explore-cta-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--primary-green);
}

.explore-cta-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.explore-cta-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.explore-section-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
}

.explore-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.explore-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aspect-browse-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.aspect-browse-card:hover {
    background: #e8f5e9;
}

.aspect-browse-info h4 {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
}

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

.aspect-score {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.aspect-score.high { background: linear-gradient(135deg, #4ade80, #22c55e); color: #166534; }
.aspect-score.mid { background: linear-gradient(135deg, #fde047, #facc15); color: #854d0e; }
.aspect-score.low { background: linear-gradient(135deg, #fca5a5, #f87171); color: #991b1b; }

.state-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.state-browse-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-main);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all var(--transition-speed);
}

.state-browse-item.has-data {
    color: var(--text-primary);
    background: #e8f5e9;
}

.state-browse-item:hover {
    background: var(--primary-green);
    color: white;
}

.state-browse-item.more-link {
    background: var(--primary-green);
    color: white;
}

.state-abbr {
    font-weight: 600;
    font-size: 0.9rem;
}

.state-count {
    font-size: 0.65rem;
}

.recent-cities-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-city-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.recent-city-item:hover {
    background: #e8f5e9;
}

.recent-city-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
}

.recent-city-reviews {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-city-score {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.recent-city-score.high { background: linear-gradient(135deg, #4ade80, #22c55e); color: #166534; }
.recent-city-score.mid { background: linear-gradient(135deg, #fde047, #facc15); color: #854d0e; }
.recent-city-score.low { background: linear-gradient(135deg, #fca5a5, #f87171); color: #991b1b; }

/* States Hub */
.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.state-card {
    display: block;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.state-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.12);
}

.state-card.has-data {
    border-left: 3px solid var(--primary-green);
}

.state-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.state-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.aspect-card {
    display: block;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.aspect-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.12);
}

.aspect-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.aspect-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.aspect-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.aspect-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* City List Table */
.city-list-table {
    width: 100%;
}

.city-list-table th {
    background: var(--bg-main);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
}

.city-list-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.city-list-table tr:hover td {
    background: #f8f9fa;
}

.noindex-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #856404;
    margin-bottom: 1rem;
}

/* Similar Cities Cards */
.similar-city-card {
    display: block;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
    height: 100%;
}

.similar-city-card:hover {
    border-color: var(--primary-green);
    background: #e8f5e9;
    transform: translateY(-2px);
}

.similar-city-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.similar-city-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.similar-city-score {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.similar-city-score.high { background: linear-gradient(135deg, #4ade80, #22c55e); color: #166534; }
.similar-city-score.mid { background: linear-gradient(135deg, #fde047, #facc15); color: #854d0e; }
.similar-city-score.low { background: linear-gradient(135deg, #fca5a5, #f87171); color: #991b1b; }

.similar-city-reviews {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .state-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .states-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aspects-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   MOBILE RESPONSIVE FIXES
   =========================================== */

/* Mobile-specific styles (phones) */
@media (max-width: 576px) {
    /* Prevent horizontal overflow on mobile only */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .container, .container-fluid {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Hero section adjustments */
    .hero-section {
        padding: 1.5rem 0 0 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .hero-title-sm {
        font-size: 1.2rem;
    }
    
    .hero-subtitle-sm {
        font-size: 0.8rem;
    }
    
    /* Map responsive height */
    #map, .homepage-map-lg {
        height: 280px !important;
    }
    
    .homepage-map {
        height: 220px;
    }
    
    .homepage-map-sm {
        height: 180px;
    }
    
    .map-title-bar {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    /* Map legend adjustments */
    .map-legend {
        gap: 0.5rem;
        font-size: 0.7rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .legend-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Sidebar boxes */
    .tagline-box, .stats-box, .podium-box, .search-cta-box,
    .recent-reviews-sidebar, .category-averages-box {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    /* Quick stat boxes on homepage */
    .quick-stat-box {
        padding: 0.5rem !important;
    }
    
    .quick-stat-value {
        font-size: 1.1rem !important;
    }
    
    .quick-stat-label {
        font-size: 0.65rem !important;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .section-title-sm {
        font-size: 0.85rem;
    }
    
    /* Category averages - mobile card view */
    .category-averages-box {
        padding: 0.75rem;
    }
    
    .category-averages-box .section-title-sm {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    /* Mobile cards grid */
    .category-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .category-card-item {
        display: flex;
        align-items: center;
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .category-card-rank .rank-circle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        font-size: 0.7rem;
        font-weight: 600;
        color: #fff;
    }
    
    .rank-circle.score-high {
        background: var(--rating-green);
    }
    
    .rank-circle.score-mid {
        background: var(--rating-yellow);
        color: #333;
    }
    
    .rank-circle.score-low {
        background: var(--rating-red);
    }
    
    .category-card-info {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
    }
    
    .category-card-name {
        font-size: 0.7rem;
        font-weight: 500;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .category-card-score {
        font-size: 0.85rem;
        font-weight: 700;
        padding: 0.1rem 0.3rem;
        border-radius: 4px;
        display: inline-block;
        width: fit-content;
    }
    
    .category-card-score.high {
        background: rgba(34, 139, 34, 0.15);
        color: var(--rating-green);
    }
    
    .category-card-score.mid {
        background: rgba(255, 193, 7, 0.2);
        color: #b8860b;
    }
    
    .category-card-score.low {
        background: rgba(220, 53, 69, 0.15);
        color: var(--rating-red);
    }
    
    /* Hide filter controls on mobile for this section */
    .category-averages-box .d-flex.gap-1 {
        display: none !important;
    }
    
    /* Filter controls - stack on mobile */
    .filter-row, .filters-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-row select, .filters-row select,
    .population-filter {
        width: 100%;
        font-size: 0.75rem;
    }
    
    /* Category grid */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .category-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .category-btn {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .category-btn-sm {
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
    }
    
    /* Ranking tables */
    .ranking-table {
        font-size: 0.85rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.5rem 0.4rem;
    }
    
    .ranking-table.compact {
        font-size: 0.75rem;
    }
    
    .ranking-table.compact td {
        padding: 0.35rem 0.2rem;
    }
    
    /* State filter on rankings page */
    .state-filter {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .state-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .rank-badge-sm {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
    
    .city-link-sm {
        font-size: 0.75rem;
    }
    
    .score-badge-sm {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }
    
    /* Podium items */
    .podium-item {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .podium-rank {
        width: 16px;
        font-size: 0.75rem;
    }
    
    /* Recent reviews */
    .recent-review-item {
        font-size: 0.7rem;
    }
    
    .review-city-link {
        font-size: 0.7rem;
    }
    
    .review-date-sm {
        font-size: 0.6rem;
    }
    
    /* Stats cards */
    .stats-card {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .stat-item {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Contribute section */
    .contribute-section {
        padding: 0.75rem;
    }
    
    .contribute-section h6 {
        font-size: 0.85rem;
    }
    
    .contribute-section p {
        font-size: 0.75rem;
    }
    
    .contribute-section .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Navigation adjustments */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .search-container {
        width: 100%;
        max-width: 200px;
    }
    
    .search-input {
        padding: 0.4rem 2rem 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Content sections padding */
    .main-content-section {
        padding: 1rem 0;
    }
    
    .content-section {
        padding: 1rem 0;
    }
    
    /* Reduce overall container padding on mobile */
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Similar cities on city page */
    .similar-city-card {
        padding: 0.75rem;
    }
    
    .similar-city-name {
        font-size: 0.85rem;
    }
    
    .similar-city-score {
        font-size: 0.75rem;
    }
    
    .similar-city-reviews {
        font-size: 0.65rem;
    }
    
    /* City page hero adjustments */
    .city-hero {
        height: 200px;
    }
    
    .city-hero-title {
        font-size: 1.6rem;
    }
    
    .city-hero-state {
        font-size: 0.9rem;
    }
    
    .city-hero-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .city-hero-meta {
        gap: 0.5rem;
    }
    
    /* State grid adjustments */
    .state-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
    
    .states-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) and (min-width: 577px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    #map, .homepage-map-lg {
        height: 350px;
    }
    
    .category-averages-table table {
        min-width: 800px;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

