/**
 * Modern Business Map Styles for UKM Directory
 * Uses Leaflet.js with OpenStreetMap for modern, responsive maps
 * 
 * @package UKM_Directory
 * @since 1.3.0
 */

/* ===== MAP CONTAINER ===== */
.ukm-business-map-section {
    margin: 2rem 0;
    background: var(--ukm-bg-primary, #ffffff);
    border-radius: var(--ukm-radius-lg, 16px);
    box-shadow: var(--ukm-shadow-md, 0 8px 32px rgba(0, 0, 0, 0.08));
    overflow: hidden;
    border: 1px solid var(--ukm-border-light, #e8ecef);
}

.ukm-business-map-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--ukm-border-light, #f1f3f4);
    background: linear-gradient(135deg, var(--ukm-primary, #fdc316) 0%, var(--ukm-primary-dark, #e6b014) 100%);
    color: var(--ukm-text-on-primary, #1f1f1f);
}

.ukm-business-map-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ukm-business-map-header h3::before {
    content: "📍";
    font-size: 1.1rem;
}

/* ===== MAP CONTAINER ===== */
.ukm-map-container {
    position: relative;
    height: 450px;
    background: #f8f9fa;
    z-index: 10;
}

#ukm-business-map {
    height: 100%;
    width: 100%;
    border: none;
    z-index: 11;
}

/* ===== LOADING STATE ===== */
.ukm-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6c757d;
    font-weight: 500;
}

.ukm-map-loading::before {
    content: "";
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* ===== ERROR STATE ===== */
.ukm-map-error {
    padding: 2rem;
    text-align: center;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    margin: 1rem;
}

.ukm-map-error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.ukm-map-error h4 {
    color: #e53e3e;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.ukm-map-error p {
    color: #744949;
    margin: 0;
    font-size: 0.9rem;
}

/* ===== ADDRESS INFO ===== */
.ukm-map-address-info {
    padding: 1.5rem 2rem;
    background: var(--ukm-bg-secondary, #f8f9fa);
    border-top: 1px solid var(--ukm-border-light, #e9ecef);
}

.ukm-map-address {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ukm-map-address-icon {
    font-size: 1.2rem;
    color: var(--ukm-primary, #fdc316);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.ukm-map-address-text {
    flex: 1;
}

.ukm-map-address-text strong {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ukm-map-address-text span {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== MAP ACTIONS ===== */
.ukm-map-actions {
    padding: 1.25rem 2rem;
    background: var(--ukm-bg-secondary, #f8f9fa);
    border-top: 1px solid var(--ukm-border-light, #e9ecef);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ukm-map-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--ukm-primary, #fdc316);
    color: var(--ukm-text-on-primary, #1f1f1f);
    text-decoration: none;
    border-radius: var(--ukm-radius, 10px);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: var(--ukm-transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: var(--ukm-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.ukm-map-action-btn:hover {
    background: var(--ukm-primary-dark, #e6b014);
    transform: translateY(-2px);
    box-shadow: var(--ukm-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
    color: var(--ukm-text-on-primary, #1f1f1f);
    text-decoration: none;
}

.ukm-map-action-btn:active {
    transform: translateY(0);
}

/* Secondary button style */
.ukm-map-action-btn:nth-child(2) {
    background: var(--ukm-bg-primary, #ffffff);
    color: var(--ukm-text-primary, #1f1f1f);
    border: 2px solid var(--ukm-border, #e9ecef);
}

.ukm-map-action-btn:nth-child(2):hover {
    background: var(--ukm-bg-secondary, #f8f9fa);
    border-color: var(--ukm-primary, #fdc316);
    color: var(--ukm-primary, #fdc316);
}

/* ===== CUSTOM LEAFLET STYLES ===== */
.leaflet-container {
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: none;
}

.leaflet-popup-content {
    margin: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.leaflet-popup-tip {
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Custom marker styles */
.ukm-custom-marker {
    background: linear-gradient(135deg, var(--ukm-primary, #fdc316) 0%, var(--ukm-primary-dark, #e6b014) 100%);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    color: var(--ukm-text-on-primary, #1f1f1f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    transition: var(--ukm-transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.ukm-custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .ukm-business-map-section {
        margin: 1rem 0;
        border-radius: 12px;
    }
    
    .ukm-business-map-header {
        padding: 1rem 1.5rem;
    }
    
    .ukm-business-map-header h3 {
        font-size: 1.2rem;
    }
    
    .ukm-map-container {
        height: 350px;
    }
    
    .ukm-map-address-info,
    .ukm-map-actions {
        padding: 1rem 1.5rem;
    }
    
    .ukm-map-actions {
        flex-direction: column;
    }
    
    .ukm-map-action-btn {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ukm-business-map-section {
        margin: 0.5rem 0;
        border-radius: 8px;
    }
    
    .ukm-map-container {
        height: 300px;
    }
    
    .ukm-map-address {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.ukm-map-action-btn:focus {
    outline: 2px solid var(--ukm-primary, #fdc316);
    outline-offset: 2px;
}

.ukm-business-map-section:focus-within {
    box-shadow: var(--ukm-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.16));
}

/* ===== PRINT STYLES ===== */
@media print {
    .ukm-business-map-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .ukm-map-container {
        height: 300px;
        background: #f5f5f5;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .ukm-map-container::after {
        content: "Map location available online";
        color: #666;
        font-style: italic;
    }
    
    .ukm-map-actions {
        display: none;
    }
}
