/* =========================================================
   GasMemberMap — Shared map styles
   Uses design tokens from gas-design-tokens.css
   ========================================================= */

/* Map container — NO overflow:hidden to preserve Google Maps zoom controls */
.gas-map-container {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: var(--gas-radius-m);
}

/* Marker label (shown below avatar at high zoom) */
.gas-map-marker-label {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--gas-neutral-800) !important;
    padding: 3px 8px !important;
    border-radius: var(--gas-radius-s) !important;
    font-size: 11px !important;
    font-weight: var(--gas-weight-semi) !important;
    text-align: center !important;
    border: var(--gas-border-width) solid var(--gas-neutral-300) !important;
    box-shadow: var(--gas-shadow-s) !important;
    max-width: 140px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    margin-top: 5px !important;
}

.gas-map-marker-label--self {
    background-color: var(--gas-primary, #1473e6) !important;
    color: #ffffff !important;
    border-color: var(--gas-primary-dark, #0f5ab0) !important;
}

/* InfoWindow */
.gas-map-infowindow {
    display: flex;
    gap: var(--gas-space-s);
    padding: var(--gas-space-s);
    max-width: 280px;
    font-family: var(--gas-font-family);
}

.gas-map-iw-image {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
}

.gas-map-iw-image img {
    width: 100%;
    height: 100%;
    border-radius: var(--gas-radius-full);
    object-fit: cover;
    object-position: center;
    border: 2px solid var(--gas-neutral-200);
    display: block;
}

.gas-map-iw-details {
    flex: 1;
    min-width: 0;
}

.gas-map-iw-details h3 {
    margin: 0 0 2px;
    font-size: var(--gas-text-s);
    font-weight: var(--gas-weight-semi);
    line-height: var(--gas-leading-tight);
}

.gas-map-iw-details h3 a {
    color: var(--gas-primary);
    text-decoration: none;
}

.gas-map-iw-details h3 a:hover {
    text-decoration: underline;
}

.gas-map-iw-name {
    font-weight: var(--gas-weight-medium);
    margin: 0 0 2px;
    font-size: var(--gas-text-xs);
    color: var(--gas-neutral-700);
}

.gas-map-iw-name a {
    color: inherit;
    text-decoration: none;
}

.gas-map-iw-self {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: var(--gas-radius-full);
    font-size: 10px;
    font-weight: var(--gas-weight-semi);
    color: #ffffff;
    background: var(--gas-primary);
}

.gas-map-iw-address {
    color: var(--gas-neutral-500);
    font-size: var(--gas-text-xs);
    margin: 0;
}

.gas-map-iw-website {
    margin: 4px 0 0;
    font-size: var(--gas-text-xs);
}

.gas-map-iw-website a {
    color: var(--gas-primary);
    text-decoration: none;
}

.gas-map-iw-website a:hover {
    text-decoration: underline;
}

.gas-map-iw-directions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--gas-neutral-200, #e5e7eb);
}

.gas-map-iw-directions a {
    color: var(--gas-neutral-600, #4b5563);
    text-decoration: none;
    font-size: 11px;
    white-space: nowrap;
}

.gas-map-iw-directions a:hover {
    color: var(--gas-primary);
    text-decoration: underline;
}

/* Cluster text styling (Google Maps) */
.gm-style .gm-cluster div {
    text-align: center;
    line-height: normal;
}

.gm-style div[style*="font"] {
    color: var(--gas-neutral-900) !important;
    font-weight: var(--gas-weight-bold) !important;
    font-size: 14px !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8) !important;
}

/* InfoWindow chrome overrides (Google Maps) */
.gm-style .gm-style-iw-c .gm-style-iw-d {
    overflow: visible !important;
}

/* =========================================================
   Mapbox — Marqueurs avatar
   ========================================================= */

.gas-mapbox-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gas-mapbox-marker--current-user {
    width: 48px;
    height: 48px;
    border-width: 3px;
    border-color: var(--gas-primary, #1473e6);
    box-shadow: 0 0 0 4px rgba(20, 115, 230, 0.22), 0 4px 12px rgba(0, 0, 0, 0.28);
    z-index: 7;
}

.gas-mapbox-marker__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gas-mapbox-marker__you {
    position: absolute;
    top: -10px;
    right: -14px;
    padding: 1px 6px;
    border-radius: var(--gas-radius-full);
    background: var(--gas-primary, #1473e6);
    color: #ffffff;
    font-size: 10px;
    font-weight: var(--gas-weight-semi);
    line-height: 1.2;
    border: 2px solid #ffffff;
    pointer-events: none;
}

/* Label visible au zoom élevé */
.gas-mapbox-marker--with-label {
    overflow: visible;
}

.gas-mapbox-marker-label {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
}

/* Highlight (hover résultat) */
.gas-mapbox-marker--highlighted {
    transform: scale(1.3);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   Mapbox — Popup overrides
   ========================================================= */

.mapboxgl-popup-content {
    padding: 0;
    border-radius: var(--gas-radius-m, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mapboxgl-popup-close-button {
    font-size: 18px;
    padding: 4px 8px;
    color: var(--gas-neutral-500, #6b7280);
}

/* =========================================================
   Mapbox — Autocomplete dropdown (geocoder helper + search)
   ========================================================= */

.gas-mapbox-autocomplete-wrapper {
    position: relative;
}

.gas-mapbox-autocomplete-dropdown {
    position: absolute;
    z-index: 10000;
    background: #fff;
    border: 1px solid var(--gas-border-color, #ccc);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 4px 4px;
}

.gas-mapbox-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    transition: background-color 0.1s ease;
}

.gas-mapbox-autocomplete-item:last-child {
    border-bottom: none;
}

.gas-mapbox-autocomplete-item--hover,
.gas-mapbox-autocomplete-item:hover {
    background-color: #f0f0f0;
}
