
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.location-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    -webkit-box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    -moz-box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-size: 14px;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.location-link:hover {
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    -webkit-box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    -moz-box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    background: -webkit-linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    background: -moz-linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.location-link:active {
    transform: translateY(0px);
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
    -webkit-box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
    -moz-box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.location-link::before {
    content: "📍";
    font-size: 18px;
    display: inline-block;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
}

/* map Overlay */
.map-overlay {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
    -webkit-animation: fadeIn 0.3s ease-in-out;
    -moz-animation: fadeIn 0.3s ease-in-out;
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

.map-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-moz-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* map Container */
.map-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 80vh;
    max-height: 700px;
    display: flex;
    display: -webkit-flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    -webkit-animation: slideUp 0.3s ease-out;
    -moz-animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@-webkit-keyframes slideUp {
    from {
        -webkit-transform: translateY(30px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
        opacity: 1;
    }
}

@-moz-keyframes slideUp {
    from {
        -moz-transform: translateY(30px);
        opacity: 0;
    }
    to {
        -moz-transform: translateY(0);
        opacity: 1;
    }
}

/* map Header */
.map-header {
    display: flex;
    display: -webkit-flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    gap: 15px;
    -webkit-gap: 15px;
}

.map-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.map-header .location-info {
    font-size: 14px;
    font-weight: 400;
    margin-top: 5px;
    word-break: break-word;
    -webkit-word-break: break-word;
}

/* map Body */
.map-body {
    flex: 1;
    -webkit-flex: 1;
    overflow: hidden;
    display: flex;
    display: -webkit-flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    min-height: 0;
}

/* Map Container */
#map {
    flex: 1;
    -webkit-flex: 1;
    width: 100%;
    height: 100%;
    border-radius: 0;
    min-height: 300px;
}

/* Info Box */
.info-box {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    word-break: break-word;
    -webkit-word-break: break-word;
}

.info-box strong {
    color: #333;
}

.info-box::before {
    content: "•";
    color: #333;
    font-weight: bold;
    margin-right: 8px;
}

/* Leaflet Popup Custom Styles */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    font-size: 13px;
    color: #333;
    margin: 0;
    padding: 10px;
}

.popup-title {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 15px;
    text-align: left;
}

.popup-address {
    color: #666;
    font-size: 13px;
    text-align: left;
    margin-bottom: 12px;
}

/* Info Tarif et Date */
.popup-info-row {
    display: flex;
    display: -webkit-flex;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 13px;
    text-align: left;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    gap: 8px;
    -webkit-gap: 8px;
}

.popup-info-label {
    display: flex;
    display: -webkit-flex;
    -webkit-align-items: center;
    align-items: center;
    font-weight: 600;
    color: #667eea;
    min-width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
}

.popup-info-value {
    color: #333;
    font-weight: 500;
    flex: 1;
    -webkit-flex: 1;
    min-width: 150px;
    word-break: break-word;
    -webkit-word-break: break-word;
}

.popup-icon {
    margin-right: 6px;
    font-size: 16px;
    display: inline-block;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    color: #333;
}

/* Instructions Popup */
.popup-instructions {
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 12px;
    color: #666;
}

.popup-instructions-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.popup-instructions-text {
    font-size: 11px;
    line-height: 1.4;
    color: #666;
}

.popup-tags {
    color: #888;
}

/* Loading state */
.loading {
    display: flex;
    display: -webkit-flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    color: #667eea;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 10px;
    -webkit-gap: 10px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    -webkit-animation: spin 1s linear infinite;
    -moz-animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@-moz-keyframes spin {
    0% { -moz-transform: rotate(0deg); }
    100% { -moz-transform: rotate(360deg); }
}

/* Compatibility for older browsers */
.leaflet-container {
    -webkit-touch-callout: none;
}

/* Tablet and larger screens (1024px and up) */
@media screen and (min-width: 1025px) {
    .map-container {
        height: 80vh;
    }
    
    .map-header {
        padding: 20px;
    }

    .map-header h2 {
        font-size: 22px;
    }
}

/* iPad and medium tablets (768px to 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .map-container {
        max-height: 80vh;
    }

    .map-header {
        padding: 16px;
    }

    .map-header h2 {
        font-size: 20px;
    }

    .info-box {
        padding: 12px 16px;
        font-size: 12px;
    }

    .location-link {
        padding: 9px 18px;
        font-size: 13px;
        gap: 7px;
    }

    .location-link::before {
        font-size: 17px;
    }
}

/* Large mobile phones (481px to 767px) */
@media screen and (min-width: 481px) and (max-width: 767px) {
    .map-overlay {
        padding: 8px;
    }
    
    .map-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    
    .map-header {
        padding: 12px 15px;
        border-radius: 0;
        gap: 12px;
    }
    
    .map-header h2 {
        font-size: 18px;
    }
    
    .map-header .location-info {
        font-size: 12px;
        margin-top: 3px;
    }
    
    .info-box {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .location-link {
        padding: 8px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .location-link::before {
        font-size: 16px;
    }

    .popup-title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .popup-address {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .popup-info-row {
        margin-bottom: 8px;
        font-size: 12px;
    }

    .popup-info-label {
        font-size: 12px;
    }

    .popup-info-value {
        font-size: 12px;
        min-width: 120px;
    }
    
    .popup-icon {
        font-size: 14px;
        margin-right: 4px;
    }

    #map {
        min-height: 250px;
    }
}

/* Small mobile phones (up to 480px) */
@media screen and (max-width: 480px) {
    html, body {
        overflow: hidden;
    }

    .map-overlay {
        padding: 0;
    }

    .map-overlay.active {
        padding: 0;
    }

    .map-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .map-header {
        padding: 10px 12px;
        border-radius: 0;
        gap: 10px;
    }

    .map-header h2 {
        font-size: 16px;
    }

    .map-header .location-info {
        font-size: 11px;
        margin-top: 2px;
    }

    .info-box {
        padding: 10px 12px;
        font-size: 11px;
    }

    .location-link {
        padding: 7px 14px;
        font-size: 12px;
        gap: 5px;
    }

    .location-link::before {
        font-size: 14px;
    }

    .popup-title {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .popup-address {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .popup-info-row {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .popup-info-label {
        font-size: 11px;
    }

    .popup-info-value {
        font-size: 11px;
        min-width: 100px;
    }

    .popup-icon {
        font-size: 13px;
        margin-right: 3px;
    }

    #map {
        min-height: 200px;
    }
}

/* Landscape mode */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .map-container {
        height: 95vh;
        max-height: 95vh;
    }

    #map {
        min-height: 150px;
    }

    .map-header {
        padding: 8px 12px;
    }

    .map-header h2 {
        font-size: 16px;
    }

    .info-box {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .map-container {
        display: -moz-flex;
    }

    .map-body {
        display: -moz-flex;
    }

    .location-link {
        display: -moz-inline-flex;
    }
}

/* Safari/iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .map-overlay {
        position: fixed;
        top: 0;
        left: 0;
    }

    .map-container {
        height: 90vh;
        -webkit-transform: translate3d(0, 0, 0);
    }

    .map-body {
        -webkit-overflow-scrolling: touch;
    }

    body {
        -webkit-user-select: none;
    }

    .location-link {
        -webkit-user-select: none;
    }
}

/* Edge and IE compatibility */
@supports (-ms-ime-align: auto) {
    .map-container {
        height: 90vh;
        display: -ms-flexbox;
        -ms-flex-direction: column;
    }

    .map-body {
        display: -ms-flexbox;
        -ms-flex-direction: column;
        -ms-flex: 1;
    }
}
