/* Map Container Optimization */
#cancellation-map {
    position: relative;
    width: 100%;
    height: 100%; /* Fixed height to prevent excessive whitespace */
    overflow: hidden !important;
    border-radius: 8px;
}

.card-body#cancellation-map {
  height: 100%;
  max-height: 100%; 
  overflow: hidden;
}

.map-card {
  height: auto;
  width: 100%;
  max-height: 400px; /* Capped the max height at 500px */
}

#cancellation-map svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
}

/* Map and Stats Layout */
.map-stats-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    height: 400px;
    overflow: hidden;
    /* height: 649px; */
}

.map-container {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 100%;
    /* Allows flex item to shrink and positions legend */
}

.map-svg {
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    display: block;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-size: 12px;
    z-index: 15;
    min-width: 110px;
    backdrop-filter: blur(8px);
}

.map-legend h6 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-item div {
    width: 15px;
    height: 15px;
    margin-right: 6px;
    border: 1px solid #ddd;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-item span {
    font-size: 11px;
    color: #555;
    line-height: 1.2;
}

/* Statistic Sidebar */
.stats-sidebar {
    flex: 0 0 220px;
    padding: 0;
    height: 100%;
}

/* Country Styles */
.country {
    stroke: #ffffff;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country:hover {
    stroke: #2c3e50;
    stroke-width: 2px;
}

/* Enhanced Tooltip */
.map-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 250px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    line-height: 1.4;
}

.map-tooltip strong {
    color: #ffffff;
}

/* Vertical Stats Panel */
.stats-panel-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.stat-card-vertical {
    background: #0d6efd;
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card-vertical:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
}

.stat-value-vertical {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffffff;
}

.stat-label-vertical {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.3;
    color: #f1f5f9;
}

/* Map Info Section */
.map-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.map-info h6 {
    color: #6c757d;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 13px;
}

.map-info p {
    margin-bottom: 8px;
    text-align: justify;
    line-height: 1.4;
}

.map-info p:last-child {
    margin-bottom: 0;
}