/* CAPA Map Page Styles */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    padding: 30px 20px;
    color: white;
}

.page-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 800;
}

.page-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* Map Container */
.map-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Legend */
.legend-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.legend-title {
    font-size: 14px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 12px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-high {
    background: #4CAF50;
}

.color-medium {
    background: #FFC107;
}

.color-limited {
    background: #FF9800;
}

.color-none {
    background: #E0E0E0;
}

/* Map Section */
.map-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.map-container {
    width: 100%;
    height: 400px;
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

#africaMap {
    width: 100%;
    height: 100%;
}

.country {
    stroke: #ffffff;
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: visiblePainted;
}

.country:hover {
    stroke: #003366;
    stroke-width: 2;
    filter: brightness(0.9);
}

.country.selected {
    stroke: #FF8C00;
    stroke-width: 2.5;
    filter: brightness(0.95);
}

.country-high {
    fill: #4CAF50;
}

.country-medium {
    fill: #FFC107;
}

.country-limited {
    fill: #FF9800;
}

.country-none {
    fill: #E0E0E0;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    white-space: nowrap;
}

/* Details Panel */
.details-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.panel-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.panel-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.country-details {
    display: none;
}

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

.country-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.country-flag-large {
    font-size: 40px;
}

.country-title {
    flex: 1;
}

.country-name-large {
    font-size: 24px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 4px;
}

.capacity-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-high {
    background: #d4edda;
    color: #155724;
}

.status-medium {
    background: #fff3cd;
    color: #856404;
}

.status-limited {
    background: #ffe8cc;
    color: #cc6600;
}

.status-none {
    background: #e2e3e5;
    color: #383d41;
}

.facilities-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.facility-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid #0066cc;
}

.facility-name {
    font-size: 16px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 6px;
}

.facility-location {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.facility-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    background: #e8f4fd;
    color: #0066cc;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.facility-info {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.no-facilities {
    padding: 30px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Footer how we get our data link */

.data-source-link {
    color: #FF8C00;
    text-decoration: underline;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
}

/* Tablet+ */
@media (min-width: 641px) {
    .page-header h1 {
        font-size: 32px;
    }

    .page-header p {
        font-size: 16px;
    }

    .map-container {
        height: 500px;
    }

    .legend-items {
        gap: 20px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .map-layout {
        flex-direction: row;
        padding: 30px;
    }

    .left-column {
        flex: 1.2;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .details-panel {
        flex: 0.8;
        max-height: 700px;
        overflow-y: auto;
    }

    .map-container {
        height: 600px;
    }
}