/* ===== LEAFLET TÉRKÉP MODERN DESIGN SYSTEM ===== */

:root {
    /* Színpaletta */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --neutral-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --dark-gradient: linear-gradient(135deg, #434343 0%, #000000 100%);

    /* Egyedi színek */
    --royal-blue: #4a90e2;
    --deep-purple: #6c5ce7;
    --mint-green: #00b894;
    --coral-red: #e17055;
    --golden-yellow: #fdcb6e;

    /* Térközök és méretek */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Árnyékok */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    --shadow-colored: 0 10px 40px rgba(74, 144, 226, 0.3);

    /* Animációk */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-fast: all 0.2s ease-out;

    /* Tipográfia */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ===== FŐKONTÉNER ===== */
.map-container {
    height: 600px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
    margin: var(--spacing-xl) 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--primary-gradient);
    position: relative;
    backdrop-filter: blur(10px);
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.leaflet-container {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    border-radius: 20px;
    font-weight: var(--font-weight-regular);
}

/* ===== VEZÉRLŐ GOMBOK ===== */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-medium) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    backdrop-filter: blur(20px) !important;
}

.leaflet-control-zoom a {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--royal-blue) !important;
    border: none !important;
    font-weight: var(--font-weight-semibold) !important;
    transition: var(--transition-smooth) !important;
    backdrop-filter: blur(20px) !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
    background: var(--royal-blue) !important;
    color: white !important;
    transform: scale(1.05) !important;
    box-shadow: var(--shadow-colored) !important;
}

/* ===== IDŐJÁRÁS MARKEREK ===== */
.weather-marker {
    background: transparent;
    border: none;
}

.weather-marker-content {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-semibold);
    box-shadow: var(--shadow-strong);
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition-bounce);
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
}

.weather-marker-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: rotate 3s linear infinite;
    opacity: 0.7;
}

.weather-marker-content::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: inherit;
    z-index: 1;
}

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

.weather-marker-content:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: var(--shadow-colored);
    border-color: rgba(255, 255, 255, 0.6);
}

.weather-marker-content i {
    font-size: 1.6rem;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.weather-marker-content .temp {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
    letter-spacing: 0.5px;
}

/* ===== CLUSTER MARKEREK ===== */
.weather-cluster {
    background: var(--accent-gradient);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-strong);
    transition: var(--transition-bounce);
    backdrop-filter: blur(15px);
}

.weather-cluster:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: var(--shadow-colored);
}

.cluster-content {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: 1.4rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
}

/* ===== POPUP STÍLUSOK ===== */
.weather-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: var(--shadow-strong);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(20px);
    min-width: 320px;
}

.weather-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: auto !important;
}

.weather-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

.weather-popup-content {
    padding: var(--spacing-lg);
}

/* ===== POPUP FEJLÉC ===== */
.popup-header {
    background: var(--primary-gradient);
    color: white;
    padding: var(--spacing-lg);
    margin: calc(-1 * var(--spacing-lg));
    margin-bottom: var(--spacing-lg);
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: var(--font-weight-semibold);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.popup-header .county {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-top: var(--spacing-xs);
    font-weight: var(--font-weight-regular);
    position: relative;
    z-index: 2;
}

/* ===== IDŐJÁRÁS FŐ RÉSZ ===== */
.weather-main {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--neutral-gradient);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.weather-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    pointer-events: none;
}

.weather-main .temperature {
    font-size: 3rem;
    font-weight: var(--font-weight-light);
    color: var(--deep-purple);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--deep-purple), var(--royal-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-main .description {
    color: #666;
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    position: relative;
    z-index: 2;
    text-transform: capitalize;
}

/* ===== IDŐJÁRÁS RÉSZLETEK ===== */
.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.weather-details .detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.weather-details .detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(74, 144, 226, 0.1) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-smooth);
}

.weather-details .detail:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    background: rgba(255, 255, 255, 0.9);
}

.weather-details .detail:hover::before {
    opacity: 1;
}

.weather-details .detail i {
    color: var(--royal-blue);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    filter: drop-shadow(0 2px 4px rgba(74, 144, 226, 0.3));
}

.weather-details .detail span {
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    color: #333;
    text-align: center;
}

/* ===== GOMBOK ===== */
.popup-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.btn-sm {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 0.9rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    flex: 1;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-sm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition-smooth);
}

.btn-sm:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(245, 87, 108, 0.3);
}

/* ===== KOORDINÁTA ALAPÚ POPUP ===== */
.location-weather-popup .leaflet-popup-content-wrapper {
    background: var(--accent-gradient);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
}

.location-popup-content {
    padding: var(--spacing-lg);
    min-width: 320px;
    position: relative;
}

.location-popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.location-popup-content .coordinates {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    margin-top: var(--spacing-sm);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== AI ELEMZÉS ===== */
.ai-analysis-container {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    justify-content: center;
    padding: var(--spacing-lg);
}

.ai-result {
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-lg);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-result h4 {
    color: white;
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.ai-result p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== ANIMÁCIÓK ===== */
.spinner-sm {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.weather-popup {
    animation: popupSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.8) rotateX(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.weather-marker-content {
    animation: markerBounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes markerBounceIn {
    0% {
        opacity: 0;
        transform: scale(0) translateY(-100px) rotate(-180deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) translateY(-20px) rotate(-90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

/* ===== TOOLTIP ===== */
.leaflet-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #333 !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-medium) !important;
    font-weight: var(--font-weight-semibold) !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
    backdrop-filter: blur(10px) !important;
    font-size: 0.9rem !important;
}

/* ===== SÖTÉT TÉMA ===== */
[data-theme="dark"] {
    --primary-gradient: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --secondary-gradient: linear-gradient(135deg, #553c9a 0%, #ee5a24 100%);
    --accent-gradient: linear-gradient(135deg, #0f3460 0%, #e94560 100%);
    --neutral-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

[data-theme="dark"] .weather-popup .leaflet-popup-content-wrapper {
    background: rgba(45, 55, 72, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .weather-details .detail {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .weather-main .temperature {
    color: #60a5fa;
}

[data-theme="dark"] .weather-main .description {
    color: #cbd5e0;
}

/* ===== RESZPONZÍV DESIGN ===== */
@media (max-width: 768px) {
    .map-container {
        height: 400px;
        margin: var(--spacing-md) 0;
        border-radius: 16px;
    }

    .weather-marker-content {
        width: 70px;
        height: 70px;
    }

    .weather-marker-content i {
        font-size: 1.4rem;
    }

    .weather-marker-content .temp {
        font-size: 0.9rem;
    }

    .weather-popup-content,
    .location-popup-content {
        min-width: 280px;
        padding: var(--spacing-md);
    }

    .popup-header {
        padding: var(--spacing-md);
        margin: calc(-1 * var(--spacing-md));
        margin-bottom: var(--spacing-md);
    }

    .weather-main .temperature {
        font-size: 2.5rem;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }

    .popup-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 350px;
        border-radius: 12px;
    }

    .weather-marker-content {
        width: 60px;
        height: 60px;
    }

    .weather-popup-content {
        min-width: 260px;
    }
}

/* ===== NYOMTATÁS ===== */
@media print {
    .leaflet-control-container {
        display: none;
    }

    .leaflet-popup {
        display: none;
    }

    .map-container {
        height: 400px;
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #333;
    }
}