/* style.css */

/* تنظیمات کلی صفحه */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', 'Tahoma', 'Helvetica Neue', sans-serif;
    overflow: hidden;
}

/* کانتینر نقشه */
#map {
    width: 100%;
    height: calc(100% - 60px);
    z-index: 1;
}

/* ===== هدر سایت ===== */
.site-header {
    width: 100%;
    height: 60px;
    background: linear-gradient(to left, #0077b6, #0096c7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1000;
    direction: rtl;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-content i {
    font-size: 24px;
}

.header-content h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

/* ===== استایل دکمه‌های داخل پاپ‌آپ ===== */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    text-align: center;
    padding: 5px;
}


.popup-content h3 {
    margin: 0 0 3px 0;
    color: #0077b6;
    font-size: 15px;
}

.popup-content p {
    margin: 2px 0 6px 0;
    font-size: 12px;
    color: #555;
}


/* دکمه مسیریابی (آبی) */
.navigate-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    background-color: #00b4d8;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s;
    margin-top: 5px;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
}

.navigate-btn:hover {
    background-color: #0077b6;
    color: white;
}

/* دکمه ارسال/اشتراک‌گذاری (سبز) - جدید */
.share-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    background-color: #2a9d8f;
    /* سبز */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s;
    margin-top: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    /* برای ارث‌بری فونت فارسی */

    /* در فایل style.css */
    -webkit-appearance: none;
    /* برای سافاری و آیفون */
    -moz-appearance: none;
    appearance: none;
    border: none;
    /* برای اطمینان */

}

.share-btn:hover {
    background-color: #21867a;
}

.navigate-btn i,
.share-btn i {
    margin-left: 5px;
}

/* استایل آیکون مارکرها */
/* ده هزار لیتری */

.water-icon {
    text-align: center;
    line-height: 32px;
    color: white;
    background: #044eb6;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);

}

/* پنج هزار لیتری */

.water-icon-5k {
    text-align: center;
    line-height: 32px;
    color: white;
    background: #4fa8ff;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}



/* مارکر مدرسه (آبی با آیکون مدرسه) */
.school-icon {
    width: 24px;
    height: 24px;
    background: #0666bf;
    border-radius: 50%;
    color: white;
    line-height: 20px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}



/*legend*/
#legend {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-item:last-child {
    margin-bottom: 0;
}





/*icon legend*/

#legend .water-icon,
#legend .water-icon-5k {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 14px;
    margin-left: 8px;
}



/*delecte liflet logo*/
.leaflet-control-attribution {
    display: none !important;
}

.legend-item .school-icon {
    margin-left: 4px;
}


/* --- دکمه‌های کنترلی جدید --- */


/* مکان دکمه تغییر نقشه (بالا راست) */
.top-right {
    top: 70px;
    /* فاصله از هدر */
    right: 10px;
}

/* مکان دکمه موقعیت یابی (پایین وسط - شناور) */
.bottom-center {
    bottom: 30px;
    /* فاصله از پایین */
    left: 50%;
    transform: translateX(-50%);
    /* برای دقیق وسط چین شدن */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* دایره‌ای */
    background-color: #0077b6;
    color: white;
    font-size: 22px;
    border: 2px solid white;
}

/* اصلاح رنگ کلاسترهای پیش‌فرض برای هماهنگی با تم آبی */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(129, 212, 250, 0.6);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(4, 78, 182, 0.7);
    color: white;
}



/* === استایل دکمه سوییچ جدید === */

/* کادر کلی که دکمه و متن را نگه می‌دارد */
.map-toggle-wrapper {
    position: absolute;
    z-index: 1000;
    background: white;
    padding: 5px 10px;
    border-radius: 30px;
    /* گوشه‌های گرد */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    /* فاصله بین متن و دکمه */
    direction: rtl;
}

/* متن کنار دکمه */
.toggle-label {
    font-size: 13px;
    font-weight: bold;
    color: #444;
}

/* کادر اصلی سوییچ */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    /* عرض دکمه */
    height: 26px;
    /* ارتفاع دکمه */
}

/* مخفی کردن چک‌باکس واقعی */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* ظاهر گرافیکی سوییچ (بخش طوسی رنگ) */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    /* رنگ حالت خاموش (طوسی) */
    transition: .4s;
    border-radius: 34px;
}

/* دایره سفید داخل سوییچ */
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* وقتی دکمه روشن می‌شود (رنگ آبی) */
input:checked+.slider {
    background-color: #0077b6;
}

/* حرکت دایره به سمت راست وقتی روشن می‌شود */
input:checked+.slider:before {
    transform: translateX(22px);
}

/* دکمه دایره‌ای (موقعیت یاب) - نارنجی جذاب */
.custom-control-btn {
    position: absolute;
    background-color: #ff5722;
    /* رنگ نارنجی */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    /* آیکون سفید */
    transition: all 0.2s ease;
    border: 2px solid white;
}

/* حالت کلیک شده */
.custom-control-btn:active {
    background-color: #e64a19;
    transform: translateX(-50%) scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* --- استایل کلاستر سفارشی (برای فایل مدارس) --- */

/* حذف استایل‌های پیش‌فرض دایره‌ای */
.marker-cluster-custom {
    background: none !important;
    border: none !important;
}

/* نگهدارنده آیکون */
.cluster-wrapper {
    position: relative;
    width: 32px;
    /* هم‌اندازه آیکون مدرسه */
    height: 32px;
}

/* اصلاح اندازه آیکون مدرسه داخل کلاستر */
.cluster-wrapper .school-icon {
    width: 32px;
    height: 32px;
    line-height: 28px;
    /* تنظیم وسط‌چین عمودی */
    font-size: 16px;
}

/* عدد قرمز کوچک کنار آیکون */
.cluster-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
    border: 1px solid white;
    z-index: 10;
}



/* --- استایل دکمه پشتیبانی تلگرام --- */

/* مکان: بالا سمت چپ */
.top-left {
    top: 70px;
    /* فاصله از هدر (هم‌تراز با دکمه سوییچ) */
    left: 10px;
}

.support-btn {
    position: absolute;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background-color: #24A1DE;
    /* رنگ اصلی تلگرام */
    color: white;
    border-radius: 50%;
    /* دایره‌ای */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    /* حذف خط زیر لینک */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    transition: transform 0.2s, background-color 0.2s;
}

/* افکت هاور (موس روی دکمه) */
.support-btn:hover {
    background-color: #208bc0;
    transform: scale(1.1);
    /* کمی بزرگ‌تر شود */
}

/* افکت کلیک */
.support-btn:active {
    transform: scale(0.95);
}