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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.search-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

#searchBtn {
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#searchBtn:hover {
    background: #5568d3;
}

.search-info {
    color: #666;
    font-size: 0.9rem;
}

.main-content {
    display: flex;
    gap: 20px;
    height: calc(100vh - 250px);
    min-height: 600px;
}

.map-container {
    flex: 1;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: white;
}

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

.results-panel {
    flex: 0 0 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-header {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.results-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 1.3rem;
}

.results-header #resultsCount {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.results-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: grid;
    gap: 15px;
    align-content: start;
}

/* Custom scrollbar for results panel */
.results-container::-webkit-scrollbar {
    width: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.facility-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.facility-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.facility-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.facility-card .facility-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.facility-card .info-item {
    display: flex;
    flex-direction: column;
}

.facility-card .info-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 3px;
}

.facility-card .info-value {
    font-weight: 500;
    color: #333;
}

.rating {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.rating.excellent {
    background: #4caf50;
    color: white;
}

.rating.above-average {
    background: #8bc34a;
    color: white;
}

.rating.average {
    background: #ffc107;
    color: #333;
}

.rating.below-average {
    background: #ff9800;
    color: white;
}

.rating.poor {
    background: #f44336;
    color: white;
}

.facility-details {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 30px;
    display: none;
    max-height: 80vh;
    overflow-y: auto;
}

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

.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: #2196f3;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
    position: relative;
}

.info-icon:hover {
    background: #1976d2;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 10px 12px;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: normal;
    width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.info-icon:hover .tooltip {
    opacity: 1;
    pointer-events: auto;
}

.data-item-label {
    position: relative;
}

.facility-details.active {
    display: block;
}

.facility-details h2 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.section {
    margin-bottom: 30px;
}

.section h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.2rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem;
}

.data-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f9f9f9;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.data-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.data-item-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
}

.data-item-value {
    font-weight: 500;
    color: #333;
    word-break: break-word;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.1rem;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #c62828;
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }

    .map-container {
        height: 400px;
    }

    .results-panel {
        flex: 1;
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
    }

    #searchBtn {
        width: 100%;
    }

    .facility-card .facility-info {
        grid-template-columns: 1fr;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .main-content {
        flex-direction: column;
    }

    .results-panel {
        flex: 1;
        max-height: 400px;
    }
}

