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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    font-size: 14px;
    line-height: 1.5;
}

/* Top Navigation */
.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 600;
    color: #212529;
    cursor: pointer;
    letter-spacing: -0.5px;
}

.nav-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #495057;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-button:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.nav-button.primary {
    background-color: #212529;
    color: white;
}

.nav-button.primary:hover {
    background-color: #000000;
}

/* Search Section */
.search-section {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 16px 0;
}

.search-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0 12px;
    background: white;
    transition: all 0.2s;
    max-width: 600px;
}

.search-bar-wrapper:focus-within {
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 8px;
    font-size: 14px;
    color: #212529;
    background: transparent;
}

.search-input::placeholder {
    color: #6c757d;
}

.search-button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-button:hover {
    color: #212529;
}

.filter-dropdown {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #212529;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-dropdown:hover {
    border-color: #adb5bd;
}

/* Main Layout */
.main-container {
    display: flex;
    height: calc(100vh - 110px);
    max-width: 1600px;
    margin: 0 auto;
    gap: 24px;
    padding: 24px;
}

.map-section {
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: white;
    border: 1px solid #dee2e6;
}

.map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.list-section {
    width: 500px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.list-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.list-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.results-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.facilities-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Facility Cards - Tighter, Professional */
.facility-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.facility-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.facility-card.selected {
    border-color: #212529;
    box-shadow: 0 0 0 2px rgba(33, 37, 41, 0.1);
}

.facility-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.facility-name {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.facility-address {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* Overall Quality Score - Prominent Display */
.quality-score-hero {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
    border-left: 3px solid #212529;
    position: relative;
}

.quality-score-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.quality-score-label {
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.quality-score-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.quality-score-value.high {
    color: #198754;
}

.quality-score-value.medium {
    color: #856404;
}

.quality-score-value.low {
    color: #842029;
}

.quality-score-description {
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Info Buttons and Tooltips */
.info-button, .info-button-small, .info-button-tiny, .info-button-micro {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.info-button:hover, .info-button-small:hover, .info-button-tiny:hover, .info-button-micro:hover {
    background: #e9ecef;
    color: #212529;
}

.info-button {
    width: 20px;
    height: 20px;
}

.info-button-small {
    width: 18px;
    height: 18px;
}

.info-button-tiny {
    width: 16px;
    height: 16px;
}

.info-button-micro {
    width: 14px;
    height: 14px;
}

.info-tooltip, .info-tooltip-small, .info-tooltip-tiny, .info-tooltip-micro {
    display: none;
    background: #212529;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    margin-top: 6px;
    margin-bottom: 8px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10;
}

.info-tooltip.show, .info-tooltip-small.show, .info-tooltip-tiny.show, .info-tooltip-micro.show {
    display: block;
}

.info-tooltip strong, .info-tooltip-small strong, .info-tooltip-tiny strong, .info-tooltip-micro strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}

.info-tooltip {
    font-size: 11px;
}

.info-tooltip-small {
    font-size: 10px;
    padding: 8px;
}

.info-tooltip-tiny {
    font-size: 10px;
    padding: 8px;
}

.info-tooltip-micro {
    font-size: 9px;
    padding: 6px;
}

.group-item-header, .group-item-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.assessment-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Overall Assessment Banner */
.overall-assessment {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid;
}

.overall-assessment.high {
    background: #d1e7dd;
    border-left-color: #198754;
}

.overall-assessment.medium {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.overall-assessment.low {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.assessment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.assessment-label {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
}

.assessment-label strong {
    font-weight: 700;
}

.assessment-score {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
}

.assessment-score.high {
    color: #198754;
}

.assessment-score.medium {
    color: #856404;
}

.assessment-score.low {
    color: #842029;
}

.assessment-factors {
    font-size: 11px;
    color: #495057;
    line-height: 1.4;
}

/* Detailed Metrics Section - Tighter */
.detailed-metrics-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-group {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e9ecef;
}

.group-title {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.group-item {
    background: white;
    padding: 8px 10px;
    border-radius: 5px;
    border-left: 2px solid #dee2e6;
    transition: all 0.2s;
}

.group-item:hover {
    border-left-color: #212529;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.group-item-label {
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    font-weight: 600;
}

.group-item-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.group-item-value.high {
    color: #198754;
}

.group-item-value.medium {
    color: #856404;
}

.group-item-value.low {
    color: #842029;
}

.group-item-value.bonus {
    color: #198754;
}

.group-item-value.penalty {
    color: #842029;
}

.group-item-note {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.3;
}

.group-content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.group-item-compact {
    background: white;
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.group-item-compact:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-color: #dee2e6;
}

.group-item-label-small {
    font-size: 9px;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.group-item-value-small {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.group-item-value-small.high {
    color: #198754;
}

.group-item-value-small.medium {
    color: #856404;
}

.group-item-value-small.low {
    color: #842029;
}

.group-item-note-small {
    font-size: 9px;
    color: #6c757d;
    line-height: 1.2;
}

.facility-details {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #6c757d;
    margin-top: 8px;
    flex-wrap: wrap;
}

.facility-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #212529;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px;
    color: #6c757d;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

/* Map Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #dee2e6;
}

.leaflet-popup-content {
    margin: 0;
    font-size: 13px;
}

.popup-container {
    padding: 12px;
    min-width: 280px;
}

.popup-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.3;
}

.popup-address {
    color: #6c757d;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.4;
}

.popup-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.popup-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.popup-metric-label {
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.popup-metric-value {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.popup-metric-value.high {
    color: #198754;
}

.popup-metric-value.medium {
    color: #856404;
}

.popup-metric-value.low {
    color: #842029;
}

.popup-metric-note {
    font-size: 10px;
    color: #6c757d;
}

.popup-quality-measures {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.popup-measure {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.popup-measure-label {
    color: #6c757d;
    font-weight: 600;
}

.popup-measure-value {
    font-weight: 700;
    font-size: 13px;
}

.popup-measure-value.good {
    color: #198754;
}

.popup-measure-value.moderate {
    color: #856404;
}

.popup-measure-value.poor {
    color: #842029;
}

/* Scrollbar Styling */
.facilities-list::-webkit-scrollbar {
    width: 6px;
}

.facilities-list::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.facilities-list::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.facilities-list::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}
