body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    /* Sayfa kaydırmasını engelle */
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    z-index: 1;
    cursor: crosshair;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* Kenar çubuğu için özel kaydırma çubuğu stilleri - Emerald Minimal */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #71717a;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #10b981;
}

/* Profesyonel geçiş efektleri */
.sidebar-content {
    padding: 0;
}

/* Gradient hover efektleri */
.gradient-hover:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.1));
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* CBS Araçları için özel stiller */
.cbs-tool-button {
    display: none !important;
}

.cbs-tool-button.active {
    display: flex !important;
}

/* Floating Label Input System */
.floating-input-container {
    position: relative;
}

.floating-input {
    width: 100%;
    padding: 0.625rem 0.625rem;
    border: 1px solid #d4d4d8;
    background-color: #fafafa;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    color: #18181b;
    transition: border-color 50ms ease-out,
        box-shadow 50ms ease-out,
        background-color 50ms ease-out;
    outline: none;
}

.floating-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    background-color: #ffffff;
}

.floating-input::placeholder {
    color: transparent;
    opacity: 0;
}

.floating-label {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translate3d(0, -50%, 0);
    transform-origin: left top;
    font-size: 0.75rem;
    line-height: 1rem;
    color: #71717a;
    pointer-events: none;
    padding: 0 0.25rem;
    background-color: transparent;
    transition: transform 50ms ease-out,
        color 50ms ease-out,
        background-color 50ms ease-out;
    will-change: transform;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.floating-input:focus~.floating-label,
.floating-input:not(:placeholder-shown)~.floating-label {
    transform: translate3d(0, -1.65rem, 0) scale(0.85);
    color: #10b981;
    font-weight: 500;
    background-color: #ffffff;
    padding: 0 0.25rem;
}

/* Sol üst kontrol butonları */
.map-control-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    left: 9.6px;
    /* Default position when sidebar is closed */
}

.control-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.4);
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.control-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
}

.control-button--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
}

.zoom-control-custom {
    display: flex;
    flex-direction: column;
    background: #1c1c1e;
    border-radius: 18px;
    border: none;
    overflow: hidden;
    box-shadow: rgba(34, 34, 34, 0.35) 0px 2px 8px;
}

.zoom-control-custom button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
}

.zoom-control-custom button+button {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.zoom-control-custom button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.zoom-control-custom button:active {
    background: rgba(255, 255, 255, 0.2);
}

.radius-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.radius-dialog {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.5rem;
    padding: 1.25rem;
    width: min(95vw, 350px);
    box-shadow: 0 12px 24px -20px rgba(15, 23, 42, 0.55);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.radius-dialog h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.radius-dialog label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.35rem;
}

.radius-dialog input[type="number"] {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.4rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
}

.radius-dialog input[type="number"]:focus {
    border-color: #6366f1;
    box-shadow: none;
}

.radius-dialog button {
    border: none;
    border-radius: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radius-dialog button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.radius-dialog button.radius-dialog-confirm {
    background: #10b981;
    color: #ffffff;
}

.radius-dialog button.radius-dialog-confirm:hover {
    background: #059669;
}

.radius-dialog button.radius-dialog-cancel {
    background: #e5e7eb;
    color: #1f2937;
}

.radius-dialog .radius-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.radius-dialog .radius-dialog-error {
    color: #b91c1c;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
    padding: 0.5rem;
    background: #fef2f2;
    border-radius: 0.375rem;
    border-left: 3px solid #dc2626;
}

#basemap-panel select {
    background-color: rgba(255, 255, 255, 0.85);
}

#basemap-panel select option {
    background-color: #fff7ed;
    color: #374151;
}

/* Basemap option buttons - vertical list style */
.basemap-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    font-size: 0.8rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    white-space: nowrap;
}

.basemap-option:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
}

.basemap-option.active {
    background: rgba(16, 185, 129, 0.25);
    color: #065f46;
    font-weight: 500;
}

.basemap-option i {
    color: #6b7280;
    font-size: 0.85rem;
}

.basemap-option:hover i,
.basemap-option.active i {
    color: #059669;
}

/* Hide native select but keep for accessibility and existing logic */
#basemap-panel .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.data-select-wrapper {
    position: relative;
}

.data-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.65rem;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid rgba(30, 41, 59, 0.45);
    border-bottom: 2px solid rgba(30, 41, 59, 0.45);
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

/* Custom File Input Styles */
.custom-file-input-wrapper {
    position: relative;
    width: 100%;
}

.custom-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.custom-file-label {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.375rem 0.625rem;
    border: 1px solid #d4d4d8;
    background-color: #fafafa;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-file-label:hover {
    background-color: #f4f4f5;
    border-color: #a1a1aa;
}

.custom-file-input:focus+.custom-file-label {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    background-color: #ffffff;
}

.custom-file-button {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    margin-right: 0.5rem;
    background-color: #18181b;
    color: #ffffff;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.custom-file-label:hover .custom-file-button {
    background-color: #000000;
}

.custom-file-name {
    flex: 1;
    color: #71717a;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#data-type {
    width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-radius: 0.55rem;
    background-color: rgba(255, 255, 255, 0.88);
    padding: 0.45rem 2.25rem 0.45rem 0.75rem;
    font-size: 0.9rem;
    color: #1f2937;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

#data-type:focus {
    outline: none;
    border-color: rgba(251, 146, 60, 0.75);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
    background-color: rgba(255, 255, 255, 0.95);
}

#data-type option {
    background-color: #fff8eb;
    color: #1f2937;
}

/* FAB (Floating Action Button) Styles */
.label-fab {
    position: fixed;
    top: 14rem;
    left: 0.6rem;
    z-index: 1400;
    display: none;
    /* Hidden by default, shown when visualization is created */
    transition: left 0.3s ease;
}

.fab-main-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1c1c1e;
    color: #ffffff;
    border: none;
    box-shadow: rgba(34, 34, 34, 0.35) 0px 2px 8px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    touch-action: none;
    user-select: none;
}

.fab-main-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: rgba(34, 34, 34, 0.35) 0px 2px 8px;
    color: #ffffff;
}

.fab-menu {
    position: absolute;
    top: 45px;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 8px;
    min-width: 220px;
}

.fab-menu-item {
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.fab-menu-item:hover {
    background: #f5f5f5;
}

.fab-menu-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    font-size: 14px;
}

.fab-menu-item input[type="checkbox"] {
    cursor: pointer;
}

/* Map Title Styles */
#map-title-container {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    pointer-events: none;
}

.map-title {
    background: transparent;
    padding: 8px 16px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    cursor: move;
    pointer-events: all;
    min-width: 180px;
    text-align: center;
    outline: none;
    border: none;
    letter-spacing: 0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.map-title:focus {
    cursor: text;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #4285f4;
    padding: 6px 14px;
}

.map-title:empty:before {
    content: 'Harita başlığını düzenlemek için çift tıklayın';
    color: #9ca3af;
    font-weight: 500;
}

/* Distance Measurement Result Popup */
.distance-result-popup .leaflet-popup-content-wrapper {
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: auto;
    background: rgba(255, 255, 255, 0.95);
}

.distance-result-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    min-width: auto;
}

.distance-result-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
}

/* Distance label styles */
.distance-label {
    pointer-events: none;
}

/* Legend Styles */
.legend {
    cursor: move;
    user-select: none;
}

.legend-color-box {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.legend-color-box:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid #333 !important;
}

.legend.horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}

.legend.horizontal>div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend.horizontal i {
    display: inline-block;
}

.legend.horizontal span {
    white-space: nowrap;
}

@media (max-width: 767px) {
    #tools-panel {
        width: min(18rem, calc(100vw - 2rem));
        right: 0.75rem;
        left: auto;
        transform: none;
        max-height: 70vh;
        overflow-y: auto;
        padding: 0.75rem;
    }

    #tools-panel .cbs-tool-button,
    #tools-panel #heat-controls,
    #tools-panel button {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {

    /* Mobile sidebar slide-in transition */
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    #sidebar.active {
        transform: translateX(0);
    }

    /* Keep menu button container visible above sidebar */
    #map-control-container {
        z-index: 1500 !important;
    }

    /* Adjust FAB position on mobile */
    .label-fab {
        top: 12rem;
        left: 0.5rem;
    }

    .fab-main-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .fab-menu {
        min-width: 200px;
        font-size: 13px;
    }

    /* Make map title smaller on mobile */
    .map-title {
        font-size: 15px;
        padding: 8px 14px;
        min-width: 140px;
    }

    /* Adjust legend size on mobile */
    .legend {
        font-size: 11px;
        padding: 6px;
    }

    .legend.horizontal {
        flex-wrap: wrap;
        max-width: 90vw;
    }

    .legend i {
        width: 16px;
        height: 16px;
    }

    /* Prevent label overflow on mobile */
    .marker-label,
    .province-label,
    .value-label {
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .label-fab {
        top: 11rem;
    }

    .fab-main-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .fab-menu {
        min-width: 160px;
    }

    .map-title {
        font-size: 13px;
        padding: 6px 10px;
    }
}