/* Backend-Integrated Map Styles */

.map-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.color-scheme-selector .form-label {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.color-scheme-selector .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.color-scheme-selector .form-select:focus {
    border-color: var(--aptia-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Map Legend Styles */
.map-legend {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.legend-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.legend-label {
    color: #6c757d;
    font-weight: 500;
}

/* Map Statistics Styles */
.map-statistics {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.stats-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    color: #495057;
    font-weight: 600;
}

/* Loading Indicator Styles */
.map-loading {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #6c757d;
}

.map-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--aptia-green);
}

.map-loading p {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.map-loading small {
    color: #6c757d;
    font-style: italic;
}

/* Error Message Styles */
.map-container .alert {
    margin: 2rem;
    border-radius: 8px;
}

.map-container .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.map-container .alert-heading {
    color: #721c24;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-controls {
        padding: 0.75rem;
    }
    
    .legend-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stats-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }
}

@media (max-width: 576px) {
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .stats-content {
        grid-template-columns: 1fr;
    }
}

/* Map Container Enhancements */
.map-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Plotly Map Customizations */
.js-plotly-plot .plotly .modebar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px;
}

.js-plotly-plot .plotly .modebar-btn {
    color: #495057;
}

.js-plotly-plot .plotly .modebar-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: var(--aptia-green);
}

/* Animation for smooth transitions */
.map-controls,
.map-legend,
.map-statistics {
    transition: all 0.3s ease;
}

.map-controls:hover,
.map-legend:hover,
.map-statistics:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Aptia Footer - Fixed Layout with Bold White Title and Equal Spacing */
.aptia-footer-fixed {
    background: white !important;
    border-top: 3px solid var(--aptia-green) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.footer-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 15px 20px !important;
    margin: 0 !important;
    min-height: 50px !important;
}

.quick-links-title {
    color: white !important;
    background: var(--aptia-green) !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 8px 15px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.quick-links-nav {
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
}

.quick-links-nav a {
    color: var(--aptia-green) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.quick-links-nav a:hover {
    color: white !important;
    background: var(--aptia-green) !important;
    border-color: var(--aptia-green) !important;
    transform: translateY(-2px) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .quick-links-title {
        margin-bottom: 10px !important;
    }
    
    .quick-links-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    .quick-links-nav a {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}



/* Legend Formatting Enhancements - Industry Sector Improvements */
.legend-colors-multi {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important; /* Wider columns - increased from 200px to 250px */
    gap: 4px !important; /* Tighter spacing between items */
    max-height: 300px !important; /* Increased height to accommodate more items */
    overflow-y: auto !important;
}

.legend-item {
    font-size: 0.7rem !important; /* Smaller font size - reduced from 0.75rem to 0.7rem */
    line-height: 1.2 !important; /* Tighter line height for compact display */
    margin-bottom: 2px !important; /* Reduced margin between items */
}

/* Ensure the legend color circles remain visible with smaller text */
.legend-color {
    width: 10px !important;
    height: 10px !important;
    margin-right: 6px !important;
    flex-shrink: 0 !important;
}

/* Apply multi-column layout specifically for Industry Sector when it has many items */
#legendColors.legend-colors-multi .legend-item {
    display: flex !important;
    align-items: center !important;
    padding: 1px 0 !important;
}

