/* Event Interactive Map Styles */

/* Map Container */
.eim-map-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#event-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Map Controls */
.eim-map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.eim-control-group {
    display: flex;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

#eim-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#eim-type-filter {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.eim-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eim-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

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

.eim-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.eim-btn.loading {
    opacity: 0.6;
    cursor: wait;
}

.eim-btn-primary {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.eim-btn-primary:hover {
    background: #005a87;
}

/* Custom Markers */
.eim-marker {
    background: white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid;
}

.eim-marker .dashicons {
    transform: rotate(45deg);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.eim-marker-concert {
    border-color: #9b59b6;
    background: #e8daef;
}

.eim-marker-concert .dashicons {
    color: #9b59b6;
}

.eim-marker-exhibition {
    border-color: #e74c3c;
    background: #fadbd8;
}

.eim-marker-exhibition .dashicons {
    color: #e74c3c;
}

.eim-marker-conference {
    border-color: #3498db;
    background: #d6eaf8;
}

.eim-marker-conference .dashicons {
    color: #3498db;
}

.eim-marker-workshop {
    border-color: #f39c12;
    background: #fef5e7;
}

.eim-marker-workshop .dashicons {
    color: #f39c12;
}

.eim-marker-festival {
    border-color: #e67e22;
    background: #fae5d3;
}

.eim-marker-festival .dashicons {
    color: #e67e22;
}

.eim-marker-sports {
    border-color: #27ae60;
    background: #d5f4e6;
}

.eim-marker-sports .dashicons {
    color: #27ae60;
}

.eim-marker-other {
    border-color: #95a5a6;
    background: #ecf0f1;
}

.eim-marker-other .dashicons {
    color: #95a5a6;
}

.eim-marker-user,
.eim-marker-search {
    background: #0073aa;
    border-color: #005a87;
}

.eim-marker-user .dashicons,
.eim-marker-search .dashicons {
    color: white;
}

/* Popup Styles */
.eim-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.eim-popup .leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.eim-popup-content {
    padding: 15px;
}

.eim-popup-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
    line-height: 1.4;
}

.eim-popup-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.eim-type-concert {
    background: #e8daef;
    color: #9b59b6;
}

.eim-type-exhibition {
    background: #fadbd8;
    color: #e74c3c;
}

.eim-type-conference {
    background: #d6eaf8;
    color: #3498db;
}

.eim-type-workshop {
    background: #fef5e7;
    color: #f39c12;
}

.eim-type-festival {
    background: #fae5d3;
    color: #e67e22;
}

.eim-type-sports {
    background: #d5f4e6;
    color: #27ae60;
}

.eim-type-other {
    background: #ecf0f1;
    color: #95a5a6;
}

.eim-popup-datetime {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.eim-popup-datetime .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.eim-popup-excerpt {
    margin-bottom: 15px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.eim-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.eim-popup-link:hover {
    background: #005a87;
}

.eim-popup-link .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Loading State */
.eim-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.eim-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: eim-spin 1s linear infinite;
}

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

.eim-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Error State */
.eim-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.eim-error p {
    margin: 0 0 15px 0;
    color: #e74c3c;
    font-size: 16px;
    font-weight: 600;
}

/* Marker Clusters */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(0, 115, 170, 0.6);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(0, 115, 170, 0.8);
    color: white;
    font-weight: 600;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .eim-map-controls {
        flex-direction: column;
        top: 5px;
        left: 5px;
        right: 5px;
        padding: 8px;
    }

    .eim-control-group {
        min-width: 100%;
    }

    .eim-popup .leaflet-popup-content {
        min-width: 200px;
    }

    .eim-popup-content h3 {
        font-size: 16px;
    }

    #event-map {
        min-height: 350px;
    }

    .eim-marker {
        width: 35px !important;
        height: 35px !important;
    }

    .eim-marker .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
}

@media screen and (max-width: 480px) {
    .eim-map-controls {
        gap: 8px;
    }

    #eim-search-input,
    #eim-type-filter {
        font-size: 13px;
        padding: 7px 10px;
    }

    .eim-btn {
        padding: 7px 10px;
    }

    #event-map {
        min-height: 300px;
    }

    .eim-loading,
    .eim-error {
        padding: 20px;
        max-width: 90%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .eim-btn,
    #eim-search-input,
    #eim-type-filter {
        min-height: 44px; /* iOS touch target size */
    }

    .leaflet-popup-content-wrapper {
        touch-action: manipulation;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .eim-map-controls {
        background: rgba(45, 45, 45, 0.95);
        border: 1px solid #555;
    }

    #eim-search-input,
    #eim-type-filter {
        background: #333;
        color: #fff;
        border-color: #555;
    }

    .eim-btn {
        background: #333;
        color: #fff;
        border-color: #555;
    }

    .eim-btn:hover {
        background: #444;
    }
}

/* Print styles */
@media print {
    .eim-map-controls {
        display: none;
    }

    .eim-loading,
    .eim-error {
        display: none;
    }
}
