/* Map Container */
#map {
    position: relative;
    background-color: #343434;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none; /* Prevents default touch behaviors */
    cursor: pointer; /* Show that the map is clickable */
}

/* Specific styling for IslamHouse map - shorter height */
.islamhouse #map {
    height: 200px !important;
}

/* Map Elements */
.country {
    transition: fill 0.2s;
    vector-effect: non-scaling-stroke; /* Maintains stroke width during zoom */
}

.country:hover {
    fill: #b2dfb2;
    cursor: pointer;
}

/* Labels */
.map-label {
    font-family: Arial, sans-serif;
    pointer-events: none;
    user-select: none;
}

.ocean-label {
    fill: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 14px;
}

.continent-label {
    fill: rgba(0, 0, 0, 0.2);
    font-size: 16px;
}

/* Bubbles */
.data-bubble {
    transition: all 0.2s ease;
}

.data-bubble:hover {
    stroke: white;
    stroke-width: 2px;
}

/* Tooltip */
.map-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    z-index: 1000;
    white-space: nowrap;
    transition: opacity 0.2s;
    direction: rtl;
    font-family: 'Janna-LT', 'IBM Plex Sans Arabic', sans-serif;
}

.map-tooltip .country-name {
    font-weight: bold;
    margin-bottom: 4px;
}

/* Permanent tooltips for IslamHouse */
.permanent-tooltip {
    background: white !important;
    color: #333 !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1) !important;
    pointer-events: none !important;
    opacity: 1 !important;
    display: block !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    transform: translate(-50%, -100%) !important;
    margin-top: -10px !important;
    direction: rtl;
    font-family: 'Janna-LT', 'IBM Plex Sans Arabic', sans-serif;
}

/* Zoom Controls */
.zoom-controls {
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.zoom-controls rect {
    fill: white;
    stroke: #ccc;
    stroke-width: 1;
    opacity: 0.9;
}

.zoom-controls g:hover rect {
    fill: #f8f9fa;
    stroke: #aaa;
}

.zoom-controls text {
    user-select: none;
    font-family: Arial, sans-serif;
}

/* Loading State */
.map-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Error State */
.map-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

/* SVG base styles */
svg {
    -webkit-tap-highlight-color: transparent;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .zoom-controls {
        transform: scale(0.8);
    }
    
    .map-label {
        font-size: 12px;
    }
    
    /* Adjust height for mobile */
    .islamhouse #map {
        height: 180px !important;
    }
}

/* Full Map Modal Styles */
.modal-fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
}

.modal-fullscreen .modal-content {
    height: 100%;
    border: none;
    border-radius: 0;
    background-color: #191A1A;
}

.modal-fullscreen .modal-body {
    overflow: hidden;
    padding: 0;
}

#fullMapContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

#fullMapContainer svg {
    width: 100%;
    height: 100%;
}

#fullMapContainer .map-tooltip {
    direction: rtl;
    font-family: 'Janna-LT', 'IBM Plex Sans Arabic', sans-serif;
}