/**
 * @package     Joomla.Site
 * @subpackage  mod_googlemap
 *
 * @copyright   Copyright (C) 2026. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

/* Module wrapper */
.mod-googlemap {
    position: relative;
    width: 100%;
}

/* Map container */
.googlemap-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    background-color: #f0f0f0;
}

/* Loading indicator */
.googlemap-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.googlemap-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #4285f4;
    border-radius: 50%;
    animation: googlemap-spin 1s linear infinite;
}

.googlemap-loading-text {
    font-size: 14px;
    color: #666;
}

@keyframes googlemap-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Overlay styles */
.googlemap-overlay {
    position: absolute;
    padding: 10px 15px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 100;
    pointer-events: auto;
}

/* Overlay positions */
.googlemap-overlay-top-left {
    top: 10px;
    left: 10px;
}

.googlemap-overlay-top-center {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.googlemap-overlay-top-right {
    top: 10px;
    right: 10px;
}

.googlemap-overlay-bottom-left {
    bottom: 10px;
    left: 10px;
}

.googlemap-overlay-bottom-center {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.googlemap-overlay-bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Info window custom styles (Google Maps) */
.gm-style .gm-style-iw-c {
    padding: 12px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
}

/* Leaflet popup custom styles (OpenStreetMap) */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
}

.leaflet-popup-content {
    margin: 12px;
}

/* Ensure Leaflet map fills container */
.googlemap-container .leaflet-container {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .googlemap-overlay {
        max-width: 200px;
        font-size: 12px;
        padding: 8px 12px;
    }

    .googlemap-overlay-top-center,
    .googlemap-overlay-bottom-center {
        max-width: calc(100% - 40px);
    }
}

/* Print styles */
@media print {
    .googlemap-container {
        page-break-inside: avoid;
    }

    .googlemap-overlay {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .googlemap-overlay {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .googlemap-loading-spinner {
        animation: none;
    }
}
