/**
 * Frontend Styles - Futuristic Theme
 */

/* Map Container */
.sojem-events-map-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.sojem-map {
    background: #0a0e27;
}

/* Search Bar */
.sojem-search-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
}

.sojem-search-input-wrapper {
    display: flex;
    gap: 10px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 50px;
    padding: 8px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.sojem-search-input-wrapper:focus-within {
    border-color: rgba(52, 211, 153, 0.6);
    box-shadow: 0 10px 40px rgba(52, 211, 153, 0.2);
}

.sojem-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f3f4f6;
    font-size: 15px;
    padding: 8px 15px;
    outline: none;
}

.sojem-search-input::placeholder {
    color: #9ca3af;
}

.sojem-search-btn {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    border: none;
    color: #0a0e27;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sojem-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.4);
}

.sojem-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sojem-search-clear {
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.sojem-search-clear.active {
    display: block;
}

.sojem-search-clear:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-2px);
}

.sojem-search-results-count {
    position: absolute;
    top: -30px;
    left: 0;
    color: #34d399;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(17, 24, 39, 0.9);
    padding: 4px 12px;
    border-radius: 12px;
    display: none;
}

.sojem-search-results-count.active {
    display: block;
    animation: sojem-fade-in 0.3s ease-out;
}

/* Loading State */
.sojem-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: rgba(10, 14, 39, 0.95);
    padding: 40px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.sojem-loader {
    border: 4px solid rgba(52, 211, 153, 0.2);
    border-top: 4px solid #34d399;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: sojem-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes sojem-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.sojem-map-loading p {
    color: #34d399;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Custom Marker */
.sojem-custom-marker {
    background: none;
    border: none;
}

.sojem-marker-inner {
    position: relative;
    animation: sojem-marker-pulse 2s ease-in-out infinite;
}

@keyframes sojem-marker-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.marker-pin {
    display: block;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50% 50% 50% 0;
    position: relative;
    transform: rotate(-45deg);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

.marker-pin::after {
    content: '';
    width: 12px;
    height: 12px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Marker Clusters */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    color: #fff;
    font-weight: bold;
}

/* Popup Styles */
.sojem-leaflet-popup .leaflet-popup-content-wrapper {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #f3f4f6;
    padding: 0;
    overflow: hidden;
    max-width: 750px !important;
    min-width: 650px !important;
}

.sojem-leaflet-popup .leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
    min-width: 650px;
}

.sojem-leaflet-popup .leaflet-popup-tip {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-top: none;
    border-right: none;
}

.sojem-popup {
    padding: 25px;
    max-width: 750px;
    min-width: 650px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    min-height: 300px;
}

.sojem-popup-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sojem-popup-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sojem-popup-logo {
    text-align: center;
    margin-bottom: 10px;
}

.sojem-popup-logo img {
    max-width: 100px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sojem-popup-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #34d399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.sojem-popup-city,
.sojem-popup-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #d1d5db;
}

.sojem-popup-city .dashicons,
.sojem-popup-dates .dashicons {
    color: #34d399;
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.sojem-popup-description {
    padding: 12px;
    background: rgba(31, 41, 55, 0.6);
    border-left: 3px solid #34d399;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #e5e7eb;
    max-height: 120px;
    overflow-y: auto;
}

/* Photo Carousel */
.sojem-popup-photos {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sojem-photo-carousel {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    flex: 1;
}

.sojem-photo-carousel .carousel-item {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sojem-photo-carousel .carousel-item:first-child {
    display: block;
    opacity: 1;
    z-index: 1;
}

.sojem-photo-carousel .carousel-item.active {
    display: block;
    opacity: 1;
    z-index: 1;
}

.sojem-photo-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

.sojem-photo-carousel img:hover {
    transform: scale(1.05);
}

.carousel-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    pointer-events: none;
    z-index: 10;
}

.carousel-nav button {
    pointer-events: all;
    background: rgba(52, 211, 153, 0.9);
    border: none;
    color: #0a0e27;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-nav button:hover {
    background: #34d399;
    transform: scale(1.1);
}

/* Weather Data */
.sojem-popup-weather {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    flex: 1;
}

.sojem-popup-weather h4 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: #60a5fa;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sojem-popup-weather h4 .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.6));
}

.weather-summary {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.6;
}

/* Weather Cards */
.sojem-weather-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.4) 100%);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sojem-weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(59, 130, 246, 0.8) 0%,
            rgba(139, 92, 246, 0.8) 50%,
            rgba(59, 130, 246, 0.8) 100%);
}

.sojem-weather-card:hover {
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.weather-card-date {
    font-size: 13px;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.weather-card-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Weather Metric */
.weather-metric {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 8px;
    padding: 12px;
    position: relative;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.weather-metric.precipitation {
    border-left-color: #3b82f6;
}

.weather-metric.wind {
    border-left-color: #10b981;
}

.weather-metric.temperature {
    border-left-color: #f59e0b;
}

.weather-metric:hover {
    background: rgba(30, 41, 59, 0.6);
    transform: translateX(4px);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.metric-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    filter: drop-shadow(0 0 6px currentColor);
    animation: pulse-glow 3s ease-in-out infinite;
}

.weather-metric.precipitation .metric-icon {
    color: #60a5fa;
}

.weather-metric.wind .metric-icon {
    color: #34d399;
}

.weather-metric.temperature .metric-icon {
    color: #fbbf24;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 6px currentColor);
    }

    50% {
        filter: drop-shadow(0 0 12px currentColor);
    }
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value-group {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
    line-height: 1;
}

.weather-metric.precipitation .metric-value {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-metric.wind .metric-value {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-metric.temperature .metric-value {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-value.temp-high {
    font-size: 20px;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-value.temp-low {
    font-size: 20px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-separator {
    font-size: 20px;
    color: #64748b;
    font-weight: 300;
}

.metric-unit {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.metric-sublabel {
    font-size: 10px;
    color: #64748b;
    margin-bottom: 6px;
}

/* Progress Bar */
.metric-bar {
    height: 4px;
    background: rgba(71, 85, 105, 0.3);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.metric-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease-out;
    position: relative;
    box-shadow: 0 0 10px currentColor;
}

.metric-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.precipitation-fill {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.wind-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.temperature-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

/* No Events Message */
.sojem-no-events-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 24, 39, 0.95);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: #cbd5e1;
    border: 1px solid rgba(52, 211, 153, 0.3);
    z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
    .sojem-popup {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 15px;
        min-height: auto;
    }

    .sojem-popup-title {
        font-size: 18px;
    }

    .sojem-photo-carousel {
        height: 200px;
    }

    .carousel-nav button {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    .sojem-leaflet-popup .leaflet-popup-content-wrapper {
        max-width: 350px !important;
    }
}

/* Glassmorphism enhancements */
@supports (backdrop-filter: blur(10px)) {
    .sojem-leaflet-popup .leaflet-popup-content-wrapper {
        background: rgba(17, 24, 39, 0.85);
    }
}

/* Animations */
.sojem-popup {
    animation: sojem-popup-fade-in 0.4s ease-out;
}

@keyframes sojem-popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}