/* ===== استایل‌های نقشه برای Admin ===== */

/* جعبه جستجو */
.map-search-box {
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f4f8 100%);
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
    transition: all 0.3s ease;
}

.map-search-box:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    border-color: #d0d9e8;
}

.map-search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6f2;
    border-radius: 8px;
    font-size: 14px;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    background: #ffffff;
    color: #333;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.map-search-box input::placeholder {
    color: #a0aac0;
}

.map-search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #fafbff;
}

/* جعبه اطلاعات */
.map-info-box {
    padding: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border-left: 5px solid #667eea;
    border-radius: 10px;
    font-size: 13px;
    direction: rtl;
    text-align: right;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
    transition: all 0.3s ease;
}

.map-info-box:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.18);
    transform: translateY(-2px);
}

.map-info-box strong {
    color: #667eea;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

.map-info-box div {
    color: #555;
    line-height: 1.8;
    font-weight: 500;
}

/* نقشه در Admin */
.map-picker-wrapper {
    margin-top: 15px;
}

.map-picker {
    height: 450px;
    border: 3px solid #e0e6f2;
    border-radius: 12px;
    margin: 15px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}


/* ===== استایل‌های Popup نقشه ===== */

.leaflet-popup-content-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafb 100%) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border: 2px solid #e8ecf1 !important;
    backdrop-filter: blur(10px);
}

.leaflet-popup-content {
    color: #333 !important;
    margin: 0 !important;
    padding: 16px !important;
    direction: rtl;
    text-align: right;
    font-size: 13px;
    width: max-content !important;
}

.leaflet-popup-content strong {
    font-size: 15px;
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    background: linear-gradient(180deg, #EF5B2A 0%, #9D1C21 100%);
    background-clip: text;
    color: transparent !important;
}

.leaflet-popup-content a {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.leaflet-popup-content a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.leaflet-popup-tip {
    background: #ffffff !important;
    border: 2px solid #e8ecf1 !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}


/* ===== کنترل‌های زوم ===== */

.leaflet-control-zoom {
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    background: #fff !important;
    border: 2px solid #e8ecf1 !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: #fff !important;
    border: 1px solid #e8ecf1 !important;
    color: #EF5B2A !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    text-align: center !important;
    display: block;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.leaflet-control-zoom a:first-child {
    border-bottom: 1px solid #e8ecf1;
}

.leaflet-control-zoom a:hover {
    background: linear-gradient(180deg, #EF5B2A 0%, #9D1C21 100%) !important;
    color: white !important;
}

.leaflet-control-zoom a.leaflet-disabled {
    background: #f5f5f5 !important;
    color: #ccc !important;
    cursor: not-allowed !important;
}


/* ===== کنترل Layer ===== */

.leaflet-control-layers {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    border: 2px solid #e8ecf1 !important;
    width: auto !important;
    overflow: hidden;
}

.leaflet-control-layers-toggle {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22><path fill=%22%23667eea%22 d=%22M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z%22/></svg>") !important;
    background-size: 18px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: #fff !important;
    width: 40px !important;
    height: 40px !important;
    border: 2px solid #e8ecf1 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.leaflet-control-layers-toggle:hover {
    background-color: #f5f7fa !important;
    border-color: #667eea !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.leaflet-control-layers-list {
    direction: rtl;
    text-align: right;
    padding: 8px 0;
}

.leaflet-control-layers label {
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
    user-select: none;
}

.leaflet-control-layers label:last-child {
    border-bottom: none;
}

.leaflet-control-layers label:hover {
    background: #f9fafb;
    color: #667eea;
    font-weight: 600;
}

.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}
.leaflet-control-layers span {
    font-size: 13px;
    color: #333;
    flex: 1;
    display: flex;
    gap: 10px;
}

/* ===== کانتینر نقشه‌ها ===== */

.project-map-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    direction: rtl;
    margin: 0;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

#project-map-container,
#all-projects-map-container {
    margin: 25px 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12);
    background: #fff;
    border: 2px solid #e8ecf1;
    transition: all 0.3s ease;
}

#project-map-container:hover,
#all-projects-map-container:hover {
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.18);
    transform: translateY(-4px);
}

/* اضافه کردن ارتفاع برای کانتینرهای نقشه */

/* نقشه Single */
#project-map-container > div:nth-child(2),
#project-map {
    height: 500px !important;
    width: 100% !important;
    border-radius: 0 0 12px 12px;
    margin: 0 !important;
}

/* نقشه جمعی */
#all-projects-map-container > div:nth-child(2),
#all-projects-map {
    height: 600px !important;
    width: 100% !important;
    border-radius: 0 0 12px 12px;
    margin: 0 !important;
}

/* Selector برای تمام نقشه‌های دینامیک */
div[id*="project-map-"] {
    height: 500px !important;
    width: 100% !important;
    min-height: 500px !important;
    font-family: 'YekanBakh';
    border-radius: 18px;
    z-index: 6;
}

div[id*="all-projects-map-"] {
    height: 600px !important;
    width: 100% !important;
    min-height: 600px !important;
    font-family: 'YekanBakh';
    border-radius: 18px;
    z-index: 1;
    position: relative;
}

/* Leaflet container - کلید مهم */
.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
	font-family: 'YekanBakh';
}


/* ===== استایل مارکر ===== */

.custom-marker {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.custom-marker:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transform: scale(1.1);
}

.leaflet-marker-icon.custom-marker {
    background: transparent;
    border: none;
}

.leaflet-marker-icon.custom-marker svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.leaflet-marker-icon.custom-marker:hover svg {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}


/* ===== Responsive ===== */

@media (max-width: 768px) {
    .map-picker {
        height: 300px;
    }

    #project-map-container > div:last-child {
        height: 350px;
    }

    #all-projects-map-container > div:last-child {
        height: 400px;
    }

    .leaflet-control-zoom a {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
        font-size: 16px !important;
    }

    .leaflet-control-layers-toggle {
        width: 36px !important;
        height: 36px !important;
    }

    .project-map-header {
        font-size: 13px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .map-picker {
        height: 250px;
    }

    #project-map-container > div:last-child {
        height: 280px;
    }

    #all-projects-map-container > div:last-child {
        height: 300px;
    }

    .map-search-box input {
        font-size: 16px;
    }

    .project-map-header {
        font-size: 12px;
        padding: 12px;
    }

    .leaflet-control-zoom a {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        font-size: 14px !important;
    }

    .leaflet-control-layers-toggle {
        width: 32px !important;
        height: 32px !important;
    }

    .leaflet-control-layers label {
        padding: 10px 12px;
        font-size: 12px;
    }
}