/* ------------------------------------------------------
   OVERRIDE: LEAFLET DEFAULT POPUP STİLLERİNİ GEÇERSİZ KIL
------------------------------------------------------ */

/* Harita Wrapper - Full Width */
#ihtiyac-harita-wrapper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

#ihtiyac-harita-wrapper #map,
#map {
    width: 100%;
    height: 500px;
    position: relative;
}

/* Leaflet popup container tamamen sıfırla */
.leaflet-popup-content-wrapper {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
}

/* Popup altındaki üçgen ucu */
.leaflet-popup-tip {
    background: #c8483a !important;
    box-shadow: none !important;
    width: 18px !important;
    height: 18px !important;
}

/* Popup kapatma butonu override */
.leaflet-container a.leaflet-popup-close-button {
    background: #c8483a !important;
    color: #fff !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    margin: -10px -10px 0 0 !important;
    padding: 0 !important;
    line-height: 28px !important;
    text-align: center !important;
}

/* ------------------------------------------------------
   CUSTOM POPUP CARD (GRADIENT TASARIM)
------------------------------------------------------ */

.popup-card {
    width: 260px;
    padding: 18px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(180deg, #df5f4e 0%, #c8483a 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    font-family: Poppins;
}

.popup-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
    color: #fff;
}

.popup-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #FFFFFF;
}

.popup-location {
    font-size: .9rem;
    opacity: .9;
    margin-bottom: 12px;
}

.popup-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: .85rem;
}

.popup-btn {
    display: block;
    padding: 10px;
    text-align: center;
    background: #ffffff22;
    border-radius: 8px;
    border: 1px solid #ffffff55;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
}

/* ------------------------------------------------------
   FİLTRELEME PANELİ
------------------------------------------------------ */

/* Filtre Toggle Butonu */
.filter-toggle-btn {
    position: absolute;
    top: 10px;
    left: 55px;
    z-index: 1000;
    width: 320px;
    background: #F8F8F9;
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    /*box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);*/
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.filter-toggle-btn:hover {
    background: #233E7D;
    color: #fff;
}

.filter-toggle-btn i {
    font-size: 16px;
}

/* Filtreleme Paneli */
.filter-panel {
    position: absolute;
    top: 10px;
    left: 55px;
    z-index: 1001;
    width: 320px;
    max-height: 90vh;
    background: #F8F8F9;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
}

.filter-panel.active {
    display: block;
}

/* Filtre Header */
.filter-header {
    background: #F8F8F9;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Filtre Body */
.filter-body {
    padding: 20px;
    max-height: calc(90vh - 64px);
    overflow-y: auto;
}

/* Filtre Grubu */
.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label i {
    color: #17a2b8;
    font-size: 16px;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #f8f9fa;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #17a2b8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

/* Filtre Butonları */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.filter-apply-btn,
.filter-reset-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-apply-btn {
    background: #233E7D;
    color: #fff;
}

.filter-apply-btn:hover {
    background: #1a2f5f;
}

.filter-reset-btn {
    background: #f1f3f5;
    color: #666;
}

.filter-reset-btn:hover {
    background: #e9ecef;
}

/* Aktif Filtreler */
.active-filters {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #17a2b8;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin: 4px;
}

.filter-tag i {
    cursor: pointer;
    font-size: 14px;
}

.filter-tag i:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-panel {
        width: calc(100vw - 20px);
        max-width: 320px;
    }

    .filter-toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ------------------------------------------------------
   KATMAN KONTROLÜ (LAYER CONTROL)
------------------------------------------------------ */

.layer-control {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.layer-control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    margin: 0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 15px;
    font-weight: 500;
}

.layer-control-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.layer-control-item.active {
    background: #fff;
    border-color: transparent;
}

.layer-control-item .layer-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    flex-shrink: 0;
}

.layer-control-item.layer-ihtiyaclar .layer-icon {
    background: #df5f4e;
}

.layer-control-item.layer-destekler .layer-icon {
    background: #67CE85;
}

.layer-control-item .layer-label {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    flex: 1;
    white-space: nowrap;
}

.layer-control-item .layer-count {
    display: none;
}

/* Inactive state */
.layer-control-item:not(.active) {
    opacity: 0.5;
    background: #f5f5f5;
}

.layer-control-item:not(.active) .layer-label {
    color: #999;
}

.layer-control-item:not(.active) .layer-icon {
    opacity: 0.5;
}

/* ------------------------------------------------------
   TURUNCU POPUP (DESTEKLER İÇİN)
------------------------------------------------------ */

.popup-card-destek {
    background: linear-gradient(180deg, #67CE85 0%, #4fb56e 100%) !important;
}

.popup-card-destek .popup-btn {
    background: #ffffff22;
    border: 1px solid #ffffff55;
}

.popup-card-destek .popup-btn:hover {
    background: #ffffff33;
}

/* Destek popup için tip (üçgen) */
.leaflet-popup-content-wrapper:has(.popup-card-destek)~.leaflet-popup-tip {
    background: #4fb56e !important;
}

/* Destek popup için kapatma butonu (yeşil) */
.leaflet-popup-content-wrapper:has(.popup-card-destek)~.leaflet-container a.leaflet-popup-close-button,
.leaflet-popup:has(.popup-card-destek) .leaflet-popup-close-button {
    background: #43955b !important;
}

@media (max-width: 768px) {
    .layer-control {
        bottom: 15px;
        gap: 8px;
        max-width: calc(100% - 20px);
    }

    .layer-control-item {
        padding: 10px 16px;
        font-size: 14px;
    }

    .layer-control-item .layer-label {
        font-size: 14px;
    }

    .layer-control-item .layer-icon {
        width: 10px;
        height: 10px;
    }
}