/**
 * Frontend Map Styles
 */

/* Map Container */
.tfa-event-map {
    position: relative;
    overflow: hidden;
}

/* Loading State */
.tfa-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.tfa-map-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: tfa-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.tfa-map-loading p {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hide loading when map is ready */
.tfa-event-map.map-loaded .tfa-map-loading {
    display: none;
}

/* Background Mode Specific */
.tfa-map-mode-background {
    pointer-events: none;
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* When used in hero container */
.tfa-map-hero-container .tfa-event-map {
    pointer-events: auto; /* Allow map interaction */
}

/* Interactive Mode Specific */
.tfa-map-mode-interactive {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Custom Info Window Styles */
.tfa-info-window {
    padding: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.tfa-info-window-name {
    font-size: 16px;
    font-weight: bold;
    color: #002147;
    margin-bottom: 5px;
}

.tfa-info-window-location {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.tfa-info-window-count {
    font-size: 14px;
    color: #333;
    padding: 8px 12px;
    background: #f6f7f7;
    border-radius: 4px;
    display: inline-block;
}

.tfa-info-window-count strong {
    color: #002147;
    font-weight: bold;
}

/* Marker Pulse Animation */
@keyframes tfa-marker-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

.tfa-marker-pulse {
    animation: tfa-marker-pulse 2s ease-in-out infinite;
}

/* Cluster Styles */
.tfa-cluster-marker {
    background: rgba(0, 33, 71, 0.8);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

/* New Locations Indicator */
.tfa-new-locations-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 25px;
    display: none;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.tfa-new-locations-indicator.visible {
    display: flex;
}

.tfa-indicator-icon {
    font-size: 18px;
    line-height: 1;
}

.tfa-indicator-text {
    margin: 0;
    white-space: nowrap;
}

.tfa-indicator-button {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 6px 14px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    line-height: 1;
}

.tfa-indicator-button:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.tfa-indicator-button:active {
    transform: scale(0.95);
}

.tfa-indicator-close {
    padding: 4px 10px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */

/* Phone screens (< 480px) */
@media (max-width: 479px) {
    .tfa-map-mode-interactive {
        border-radius: 0;
        min-height: 400px;
        height: 60vh;
    }

    .tfa-info-window {
        max-width: 200px;
        padding: 8px;
    }

    .tfa-info-window-name {
        font-size: 14px;
    }

    .tfa-info-window-location {
        font-size: 12px;
    }

    .tfa-info-window-count {
        font-size: 12px;
        padding: 6px 10px;
    }

    .tfa-new-locations-indicator {
        top: 5px;
        right: 5px;
        font-size: 11px;
        padding: 8px 10px;
        gap: 6px;
    }

    .tfa-indicator-icon {
        font-size: 14px;
    }

    .tfa-indicator-button {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Phone screens and small tablets (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .tfa-map-mode-interactive {
        border-radius: 0;
        min-height: 450px;
        height: 65vh;
    }

    .tfa-info-window {
        max-width: 250px;
    }

    .tfa-new-locations-indicator {
        top: 5px;
        right: 5px;
        font-size: 12px;
        padding: 10px 12px;
        gap: 8px;
    }

    .tfa-indicator-icon {
        font-size: 16px;
    }

    .tfa-indicator-button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .tfa-map-mode-interactive {
        min-height: 500px;
        height: 70vh;
    }

    .tfa-info-window {
        max-width: 280px;
    }
}

/* Ensure touch targets are large enough on mobile */
@media (max-width: 1023px) {
    /* Make map controls more touch-friendly */
    .tfa-event-map .gm-style button {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Ensure info window close button is touch-friendly */
    .gm-style-iw button {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

