/**
 * Contact Page Map Styles
 * OpenStreetMap/Leaflet optimized styles
 * 
 * @package MaloneyJa_Professional
 * @since 1.0.0
 */

/* =Map Container Styles
-------------------------------------------------------------- */
.map-wrapper {
    position: relative;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: #f0f0f0;
}

/* Placeholder Styles */
.map-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: opacity 0.3s ease;
}

.map-placeholder:hover {
    opacity: 0.95;
}

.map-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
}

.map-loading p {
    margin: 0;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

/* =Overlay Box Styles
-------------------------------------------------------------- */
.map-overlay-box {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
    z-index: 400;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 250px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.map-overlay-box:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.overlay-content {
    position: relative;
}

.overlay-text {
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    opacity: 0.9;
    text-transform: uppercase;
    font-weight: 400;
}

.overlay-location {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
    line-height: 1.2;
}

.overlay-emoji {
    font-size: 24px;
    line-height: 1;
    margin-top: 5px;
}

/* =Expand Button
-------------------------------------------------------------- */
.map-expand-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 401;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.map-expand-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-expand-btn:active {
    transform: scale(0.95);
}

.map-expand-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* =Interactive Map Container
-------------------------------------------------------------- */
#contact-map {
    width: 100%;
    height: 400px;
    position: relative;
    background: #f0f0f0;
}

.leaflet-container {
    font-family: inherit;
}

/* Custom marker styles */
.custom-map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dropIn 0.5s ease;
}

@keyframes dropIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =Modal Styles
-------------------------------------------------------------- */
.map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

.modal-map-container {
    width: 100%;
    height: 100%;
}

/* =Leaflet Control Overrides
-------------------------------------------------------------- */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom a {
    background: white !important;
    color: #333 !important;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background: #f0f0f0 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 4px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 13px 19px;
    font-size: 14px;
}

/* =Mobile Responsive
-------------------------------------------------------------- */
@media (max-width: 768px) {
    .map-wrapper {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .map-placeholder,
    #contact-map {
        height: 300px;
    }
    
    .map-overlay-box {
        bottom: 20px;
        padding: 15px 20px;
        min-width: 200px;
    }
    
    .overlay-text {
        font-size: 11px;
        letter-spacing: 1.5px;
    }
    
    .overlay-location {
        font-size: 16px;
    }
    
    .overlay-emoji {
        font-size: 20px;
    }
    
    .map-expand-btn {
        top: 15px;
        right: 15px;
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        height: 70%;
        border-radius: 4px;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .map-placeholder,
    #contact-map {
        height: 250px;
    }
    
    .map-overlay-box {
        bottom: 15px;
        padding: 12px 18px;
        min-width: 180px;
    }
    
    .overlay-text {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .overlay-location {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .overlay-emoji {
        font-size: 18px;
    }
}

/* =Print Styles
-------------------------------------------------------------- */
@media print {
    .map-wrapper {
        page-break-inside: avoid;
    }
    
    .map-expand-btn,
    .map-modal {
        display: none !important;
    }
    
    #contact-map {
        display: block !important;
        height: 300px;
    }
    
    .map-placeholder {
        display: none;
    }
}

/* =Loading States
-------------------------------------------------------------- */
.map-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* =Accessibility
-------------------------------------------------------------- */
.map-wrapper:focus-within {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.map-expand-btn:focus,
.modal-close:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .map-overlay-box {
        background: black;
        border: 2px solid white;
    }
    
    .map-expand-btn {
        background: white;
        border: 2px solid black;
    }
}