/* Konutta Kampanya — emlak piyasası haritası */
:root {
    --kk-red-50: #fef2f2;
    --kk-red-100: #fee2e2;
    --kk-red-200: #fecaca;
    --kk-red-400: #f87171;
    --kk-red-500: #ef4444;
    --kk-red-600: #dc2626;
    --kk-red-700: #b91c1c;
    --kk-red-800: #991b1b;
}

.ej-market-section {
    background: #fff;
    padding: 2.5rem 0 3.5rem;
}

.ej-market-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.ej-market-header h2 {
    font-size: clamp(1.65rem, 3.5vw, 2rem);
    font-weight: 800;
    color: #1f2937;
    letter-spacing: -0.02em;
}

.ej-market-header p {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: #6b7280;
}

/* Skala — harita üzerinde sol alt kart (Emlakjet benzeri, marka uyarlamalı) */
.kk-map-legend {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 7;
    display: flex;
    max-width: 228px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 28px rgba(127, 29, 29, 0.14);
    border: 1px solid rgba(254, 202, 202, 0.9);
    pointer-events: none;
}

.kk-map-legend__accent {
    width: 4px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--kk-red-400) 0%, var(--kk-red-700) 100%);
}

.kk-map-legend__body {
    flex: 1;
    padding: 12px 14px 10px;
    min-width: 0;
}

.kk-map-legend__title {
    margin: 0 0 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--kk-red-700);
}

.kk-map-legend__bar {
    height: 9px;
    border-radius: 999px;
    margin-bottom: 8px;
    background: linear-gradient(
        90deg,
        #fff5f5 0%,
        #fecaca 20%,
        #fca5a5 40%,
        #f87171 60%,
        #ef4444 80%,
        #991b1b 100%
    );
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.1);
}

.kk-map-legend__labels {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.kk-map-legend__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kk-map-legend__item--end {
    text-align: right;
    align-items: flex-end;
}

.kk-map-legend__hint {
    font-size: 10px;
    color: #9ca3af;
    line-height: 1.2;
}

.kk-map-legend__item strong {
    font-size: 11px;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
    white-space: nowrap;
}

.kk-map-legend__source {
    margin: 8px 0 0;
    font-size: 9px;
    font-weight: 600;
    color: #b91c1c;
    opacity: 0.75;
    letter-spacing: 0.02em;
}

.ej-market-widget {
    display: flex;
    align-items: stretch;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(127, 29, 29, 0.08);
    background: #fff;
    height: 520px;
    isolation: isolate;
}

.ej-market-map-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    background: #e8eaed;
}

.ej-market-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ej-market-map .maplibregl-canvas {
    outline: none;
}

.ej-market-map .maplibregl-ctrl {
    display: none !important;
}

.ej-market-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(254, 242, 242, 0.88);
    color: var(--kk-red-800);
    font-size: 0.95rem;
    font-weight: 500;
}

.ej-market-panel {
    position: relative;
    flex: 0 0 340px;
    width: 340px;
    max-height: none;
    overflow-y: auto;
    background: #fff;
    padding: 22px 22px 20px;
    border-left: 1px solid var(--kk-red-100);
    z-index: 2;
}

.ej-market-panel__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

#emlak-piyasasi .ej-market-panel__icon svg {
    width: 52px !important;
    height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    flex-shrink: 0;
}

.ej-market-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 18px;
    border-radius: 999px;
    padding: 3px;
    border: 1.5px solid var(--kk-red-100);
    background: #fff;
}

.ej-market-toggle button {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ej-market-toggle button.is-active {
    color: var(--kk-red-600);
    background: var(--kk-red-50);
    box-shadow: inset 0 0 0 2px var(--kk-red-500);
}

.ej-market-panel__title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 14px;
    line-height: 1.35;
}

.ej-market-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.ej-market-stat {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #f3f4f6;
}

.ej-market-stat--wide {
    grid-column: 1 / -1;
}

.ej-market-stat__label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 3px;
}

.ej-market-stat__value {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ej-market-stat__value.is-positive {
    color: var(--kk-red-600);
}

.ej-market-stat__suffix {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.ej-market-cities-label {
    font-size: 12px;
    color: #6b7280;
    margin: 16px 0 10px;
}

.ej-market-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ej-market-city-btn {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.ej-market-city-btn:hover,
.ej-market-city-btn.is-active {
    border-color: var(--kk-red-500);
    color: var(--kk-red-600);
    background: var(--kk-red-50);
}

.ej-market-attribution {
    position: absolute;
    left: 12px;
    bottom: 8px;
    z-index: 6;
    font-size: 9px;
    color: rgba(55, 65, 81, 0.65);
    line-height: 1.35;
    pointer-events: none;
    max-width: 55%;
}

.ej-market-tooltip {
    position: absolute;
    z-index: 12;
    background: #fff;
    border-radius: 8px;
    padding: 7px 11px;
    box-shadow: 0 6px 18px rgba(127, 29, 29, 0.14);
    border: 1px solid var(--kk-red-100);
    font-size: 11px;
    font-weight: 600;
    color: #111827;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
    opacity: 0;
    transition: opacity 0.12s ease;
}

.ej-market-tooltip.is-visible {
    opacity: 1;
}

.ej-market-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #fff;
}

.ej-market-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.ej-market-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--kk-red-600), var(--kk-red-500));
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ej-market-cta a:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.32);
}

@media (max-width: 900px) {
    .kk-map-legend {
        left: 10px;
        bottom: 10px;
        max-width: 200px;
    }

    .kk-map-legend__body {
        padding: 10px 11px 9px;
    }

    .ej-market-widget {
        flex-direction: column;
        height: auto;
    }

    .ej-market-map-wrap {
        height: 300px;
        min-height: 300px;
        flex: none;
    }

    .ej-market-panel {
        flex: none;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--kk-red-100);
    }

    .ej-market-attribution {
        display: none;
    }

    .ej-market-cta {
        flex-direction: column;
        align-items: stretch;
        padding: 0 0.5rem;
    }

    .ej-market-cta a {
        width: 100%;
        justify-content: center;
    }
}
