/* Map Styles for Ad Page */
.ad-map-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    background: white;
}

.ad-map-container:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.ad-map-iframe {
    border: none;
    border-radius: 12px;
    width: 100%;
    height: 420px;
}

.ad-map-click-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    cursor: pointer;
    z-index: 5;
    background: rgba(255, 255, 255, 0);
}

.ad-map-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 420px;
    z-index: 30;
}

.ad-map-fallback:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.ad-map-overlay-top {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.ad-map-overlay-top:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ad-map-overlay-bottom {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    border-radius: 25px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.ad-map-overlay-bottom:hover {
    background: white;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ad-map-overlay-bottom .btn {
    border-radius: 20px;
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 1px;
}

.ad-map-stats {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Full width map container */
.full-width-map {
    height: 420px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: white;
}

.full-width-map .ad-map-iframe {
    height: 420px;
    border-radius: 12px;
}

.full-width-map .ad-map-fallback {
    height: 420px;
    padding: 3rem;
}

/* Location marker overlay */
.ad-map-marker-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
}

.marker-pulse {
    background: #dc3545;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

.marker-pulse i {
    transform: rotate(45deg);
    font-size: 18px;
}

.marker-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Enhanced map options */
.map-options {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.map-options .btn {
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 6px;
}

/* Responsive adjustments for full width map */
@media (max-width: 992px) {
    .full-width-map {
        height: 360px;
    }
    
    .full-width-map .ad-map-iframe {
        height: 360px;
    }
    
    .full-width-map .ad-map-fallback {
        height: 360px;
        padding: 2rem;
    }
    
    .marker-pulse {
        width: 35px;
        height: 35px;
    }
    
    .marker-pulse i {
        font-size: 16px;
    }
    
    .marker-label {
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .full-width-map {
        height: 320px;
    }
    
    .full-width-map .ad-map-iframe {
        height: 320px;
    }
    
    .full-width-map .ad-map-fallback {
        height: 320px;
        padding: 1.5rem;
    }
    
    .marker-pulse {
        width: 30px;
        height: 30px;
    }
    
    .marker-pulse i {
        font-size: 14px;
    }
    
    .marker-label {
        font-size: 12px;
        padding: 4px 8px;
        max-width: 150px;
    }
    
    .map-options .btn {
        font-size: 0.8rem;
        padding: 0.4rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .full-width-map {
        height: 260px;
    }
    
    .full-width-map .ad-map-iframe {
        height: 260px;
    }
    
    .full-width-map .ad-map-fallback {
        height: 260px;
        padding: 1rem;
    }
    
    .marker-pulse {
        width: 25px;
        height: 25px;
    }
    
    .marker-pulse i {
        font-size: 12px;
    }
    
    .marker-label {
        font-size: 11px;
        padding: 3px 6px;
        max-width: 120px;
    }
    
    .map-options .btn {
        font-size: 0.75rem;
        padding: 0.3rem;
        margin-bottom: 0.25rem;
    }
}

/* RTL Support for marker */
[dir="rtl"] .ad-map-marker-overlay {
    transform: translate(50%, -50%);
}

[dir="rtl"] .marker-label {
    text-align: right;
}

/* Location info styling */
.location-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.location-info h6 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.location-info small {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Location buttons */
.location-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.location-buttons .btn {
    flex: 1;
    min-width: 140px;
    font-size: 0.9rem;
    padding: 0.75rem;
}

/* Map options */
.map-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.map-options .btn {
    flex: 1;
    min-width: 140px;
    font-size: 0.9rem;
    padding: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .ad-map-container {
        height: 360px;
    }
    
    .ad-map-iframe {
        height: 360px;
    }
    
    .ad-map-fallback {
        height: 360px;
        padding: 1.5rem;
    }
    
    .ad-map-overlay-top {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }
    
    .ad-map-overlay-bottom {
        bottom: 8px;
        padding: 3px;
    }
    
    .ad-map-overlay-bottom .btn {
        font-size: 11px;
        padding: 3px 6px;
        margin: 0 0.5px;
    }
}

@media (max-width: 768px) {
    .ad-map-container {
        height: 320px;
        margin-bottom: 1rem;
    }
    
    .ad-map-iframe {
        height: 320px;
    }
    
    .ad-map-fallback {
        height: 320px;
        padding: 1rem;
    }
    
    .ad-map-overlay-top {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }
    
    .ad-map-overlay-bottom {
        bottom: 6px;
        padding: 2px;
    }
    
    .ad-map-overlay-bottom .btn {
        font-size: 10px;
        padding: 2px 4px;
        margin: 0 2px;
    }
    
    .ad-map-stats {
        font-size: 0.8rem;
        padding: 0.3rem;
    }
    
    .location-buttons {
        flex-direction: column;
    }
    
    .location-buttons .btn {
        min-width: auto;
        margin-bottom: 0.5rem;
    }
    
    .map-options {
        flex-direction: column;
    }
    
    .map-options .btn {
        min-width: auto;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .ad-map-container {
        height: 260px;
    }
    
    .ad-map-iframe {
        height: 260px;
    }
    
    .ad-map-fallback {
        height: 260px;
        padding: 0.75rem;
    }
    
    .ad-map-overlay-top {
        width: 24px;
        height: 24px;
        top: 4px;
        right: 4px;
    }
    
    .ad-map-overlay-bottom {
        bottom: 4px;
        padding: 1px;
    }
    
    .ad-map-overlay-bottom .btn {
        font-size: 9px;
        padding: 1px 2px;
        margin: 0 1px;
    }
    
    .ad-map-stats {
        font-size: 0.75rem;
        padding: 0.2rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .location-info {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .location-info h6 {
        font-size: 1rem;
    }
    
    .location-info small {
        font-size: 0.8rem;
    }
}

/* RTL Support */
[dir="rtl"] .ad-map-overlay-top {
    left: 10px;
    right: auto;
}

[dir="rtl"] .ad-map-overlay-bottom {
    transform: translateX(50%);
}

[dir="rtl"] .ad-map-overlay-bottom:hover {
    transform: translateX(50%) scale(1.05);
}

[dir="rtl"] .ad-map-stats {
    text-align: center;
}

/* Loading animation */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
}

.map-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced hover effects */
.ad-map-container:hover .ad-map-overlay-top {
    background: white;
    transform: scale(1.1);
}

.ad-map-container:hover .ad-map-overlay-bottom {
    background: white;
    transform: translateX(-50%) scale(1.05);
}

/* Zoom controls styling */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.zoom-controls .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.zoom-controls .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Map info tooltip */
.map-info-tooltip {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-map-container:hover .map-info-tooltip {
    opacity: 1;
}
