/**
 * SKN Unified Map Styling
 * Consistent styling for all maps across the theme
 */

/* Custom marker styling */
.custom-marker {
    background: transparent;
    border: none;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0;
    font-family: inherit !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-content-wrapper * {
    font-family: var(--font-sans, var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji")) !important;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
    max-width: 320px;
    font-family: inherit !important;
}

.leaflet-popup-content * {
    font-family: inherit !important;
}

.leaflet-popup-tip {
    background: white;
}

/* Project popup styling */
.project-popup {
    width: 100%;
    text-align: center;
    font-family: inherit !important;
}

.project-popup * {
    font-family: inherit !important;
}

.popup-image-container {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #f3f4f6;
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.popup-placeholder {
    width: 100%;
    height: 120px;
    background: #f3f4f6;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    padding: 16px;
    text-align: center;
}

.popup-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    font-family: inherit !important;
}

.popup-status {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 16px;
    font-family: inherit !important;
}

.popup-address {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    font-family: inherit !important;
}

/* Dark mode popup styles */
.dark .leaflet-popup-content-wrapper {
    background: #171717;
}

.dark .leaflet-popup-tip {
    background: #171717;
}

.dark .popup-title {
    color: #f9fafb;
}

.dark .popup-status,
.dark .popup-address {
    color: #9ca3af;
}

.dark .popup-placeholder {
    background: #1f2937;
}

.dark .popup-image-container {
    background: #1f2937;
}

.popup-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    background: var(--wp--preset--color--primary, #2563eb);
    color: white !important;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit !important;
}

.popup-cta:hover {
    opacity: 0.8;
    color: white !important;
    text-decoration: none;
}

.popup-maps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 12px;
    background: var(--wp--preset--color--primary, #2563eb);
    color: white !important;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit !important;
    margin-top: 8px;
    gap: 6px;
}

.popup-maps-btn:hover {
    opacity: 0.8;
    color: white !important;
    text-decoration: none;
}

.popup-maps-text {
    flex: 1;
    text-align: center;
}

.popup-maps-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* RTL specific adjustments */
[dir="rtl"] .popup-maps-btn {
    flex-direction: row;
}

[dir="rtl"] .popup-maps-text {
    text-align: center;
}

.popup-arrow {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Static popup styling (for office locations) */
.static-popup {
    text-align: center;
    font-family: inherit !important;
}

.static-popup * {
    font-family: inherit !important;
}

.static-popup .popup-title {
    margin-bottom: 8px;
}

.static-popup .popup-address {
    margin-bottom: 0;
}

/* Map container styling */
.skn-map-container {
    width: 100%;
    z-index: 1;
}

/* Legacy legend styles - replaced by Tailwind component */

/* Loading animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaflet-popup-content {
        min-width: 250px;
        max-width: 280px;
    }
}
