/* =========================================
   نقشه تعاملی ایران با مدیریت نمایندگان
   ========================================= */

:root {
    --map-color: #0034ff;
    --rep-card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --rep-card-radius: 8px;
    --border-width: 0.5px; /* ضخامت خطوط مرزی - کاهش یافته */
}

/* -----------------------------
   فونت‌های سفارشی
   ----------------------------- */
@font-face {
    font-family: "iransans";
    font-style: normal;
    font-weight: normal;
    src: url("fonts/IRANSansWeb.eot");
    src: url("fonts/IRANSansWeb.eot?#iefix") format("embedded-opentype"),
         url("fonts/IRANSansWeb.woff2") format("woff2"),
         url("fonts/IRANSansWeb.woff") format("woff"),
         url("fonts/IRANSansWeb.ttf") format("truetype");
}

@font-face {
    font-family: "iransans-bold";
    font-style: normal;
    font-weight: bold;
    src: url("fonts/IRANSansWeb_Bold.eot");
    src: url("fonts/IRANSansWeb_Bold.eot?#iefix") format("embedded-opentype"),
         url("fonts/IRANSansWeb_Bold.woff2") format("woff2"),
         url("fonts/IRANSansWeb_Bold.woff") format("woff"),
         url("fonts/IRANSansWeb_Bold.ttf") format("truetype");
}

/* -----------------------------
   کانتینر اصلی
   ----------------------------- */
.mymap-main-wrapper {
    font-family: iransans, Tahoma, Arial, sans-serif;
    direction: rtl;
}

.mymap-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px;
    border-radius: 12px;
    background: #fff;
}

.map-title {
    width: 100%;
    margin-bottom: 10px;
    font-size: 18px;
    font-family: iransans-bold;
    padding-right: 5px;
    color: #333;
    border-right: 4px solid var(--map-color);
    padding-right: 12px;
}

.mymap-map-area {
    width: 45%;
    padding: 0 10px;
}

.mymap-content-box {
    width: 55%;
    position: relative;
    min-height: 400px;
}

/* -----------------------------
   نقشه (SVG) - تنظیمات خطوط
   ----------------------------- */
.map {
    display: block;
    width: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.map svg {
    height: 100%;
    width: 100%;
}

/* تنظیم ضخامت خطوط برای تمام المان‌های نقشه */
.map .border path,
.map .island path,
.map .province path,
.map .sea path,
.map .lake path {
    stroke-width: 0.1px !important;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* خط مرزی ایران با ضخامت کمتر */
.map .border .iran {
    stroke-width: 0.5px !important;
}

/* رنگ‌های پیش‌فرض */
.map .border path,
.map .island path {
    fill: #ddd;
    transition: all 0.3s ease;
}

.map .province path,
.map .island path {
    fill: #fff;
    transition: all 0.3s ease;
}

.map .sea path,
.map .lake path {
    fill: var(--map-color);
    transition: all 0.3s ease;
}

.mymap-map-link {
    cursor: pointer;
}

.mymap-map-link path {
    transition: all 0.3s ease;
}

.mymap-map-link:hover path {
    cursor: pointer;
}

.mymap-map-link.active path {
    stroke-width: 0.5px !important;
}

/* -----------------------------
   هدر نتایج نمایندگان
   ----------------------------- */
#mymap-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

#mymap-results-header h3 {
    font-family: iransans-bold;
    font-size: 18px;
    font-weight: normal;
    margin: 0;
    color: #333;
}

#mymap-results-header h3 span {
    color: var(--map-color);
}

.mymap-count-badge {
    background: var(--map-color);
    color: #fff;
    border-radius: 50%;
    padding: 2px 10px;
    font-size: 13px;
    margin-right: 8px;
}

/* -----------------------------
   لیست نمایندگان
   ----------------------------- */
.mymap-representatives-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mymap-rep-item {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: var(--rep-card-radius);
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.mymap-rep-item:hover {
    background: #f5f8ff;
    border-color: var(--map-color);
    box-shadow: var(--rep-card-shadow);
}

/* نام نماینده */
.mymap-rep-name {
    font-family: iransans-bold, Tahoma, Arial, sans-serif;
    font-size: 17px;
    color: #222;
    margin-bottom: 8px;
}

.mymap-rep-name a {
    text-decoration: none;
    color: #222;
    transition: color 0.3s ease;
}

.mymap-rep-name a:hover {
    color: var(--map-color, #0034ff);
}

/* آدرس نماینده */
.rep-address {
    font-size: 14px;
    color: #555;
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.rep-address i {
    color: var(--map-color, #0034ff);
    width: 18px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

/* اطلاعات تماس */
.rep-contact {
    font-size: 14px;
    color: #555;
    padding: 4px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 0;
}

.rep-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
}

.rep-contact-item i {
    color: var(--map-color, #0034ff);
    width: 18px;
    text-align: center;
}

.rep-contact-item a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.rep-contact-item a:hover {
    color: var(--map-color, #0034ff);
}

/* جداکننده بین موارد تماس */
.rep-contact .rep-contact-item:not(:last-child)::after {
    content: "|";
    color: #ddd;
    margin: 0 6px;
}

/* -----------------------------
   صفحه‌بندی
   ----------------------------- */
.mymap-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.mymap-pagination .page-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: iransans;
}

.mymap-pagination .page-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.mymap-pagination .page-btn.active {
    background: var(--map-color);
    color: #fff;
    border-color: var(--map-color);
}

.mymap-pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mymap-pagination .page-info {
    font-size: 13px;
    color: #888;
    padding: 0 10px;
}

/* -----------------------------
   وضعیت‌های مختلف
   ----------------------------- */
.mymap-loading {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

.mymap-loading i {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.mymap-no-results {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 16px;
}

.mymap-no-results i {
    font-size: 40px;
    display: block;
    margin-bottom: 15px;
    color: #ddd;
}

.mymap-error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

/* -----------------------------
   ابزارک (Tooltip)
   ----------------------------- */
#mymap-tooltip {
    position: absolute;
    display: none;
    opacity: 0;
    background-color: rgba(34, 34, 34, 0.9);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    pointer-events: none;
    z-index: 999999;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    direction: rtl;
    font-family: iransans;
}

/* -----------------------------
   چیدمان‌های مختلف
   ----------------------------- */
.layout-map-left .mymap-container {
    flex-direction: row-reverse;
}

.layout-map-right .mymap-container {
    flex-direction: row;
}

.map-full-width .mymap-content-box {
    display: none !important;
}

.map-full-width .mymap-map-area {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.map-full-width .mymap-container {
    max-width: 800px;
    margin: 0 auto;
}

.map-full-width .map svg {
    max-height: 600px;
    width: 100%;
    height: auto;
}

/* -----------------------------
   مودال افزودن نماینده
   ----------------------------- */
.iran-map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    font-family: iransans, Tahoma, Arial, sans-serif;
}

.iran-map-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.iran-map-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 550px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: iranMapModalSlide 0.3s ease;
}

@keyframes iranMapModalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.iran-map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    border-bottom: 1px solid #eee;
}

.iran-map-modal-header h3 {
    margin: 0;
    font-family: iransans-bold;
    font-size: 18px;
    color: #333;
}

.iran-map-modal-header h3 i {
    color: var(--map-color);
    margin-left: 10px;
}

.iran-map-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0 8px;
    transition: all 0.3s ease;
}

.iran-map-modal-close:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.iran-map-modal-body {
    padding: 25px;
}

/* فرم */
#iran-map-add-form .iran-map-form-group {
    margin-bottom: 15px;
}

#iran-map-add-form .iran-map-form-group label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    color: #444;
    margin-bottom: 5px;
}

#iran-map-add-form .iran-map-form-group .required {
    color: #e74c3c;
}

#iran-map-add-form .iran-map-form-group input[type="text"],
#iran-map-add-form .iran-map-form-group input[type="tel"],
#iran-map-add-form .iran-map-form-group input[type="email"],
#iran-map-add-form .iran-map-form-group select,
#iran-map-add-form .iran-map-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: iransans;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#iran-map-add-form .iran-map-form-group input:focus,
#iran-map-add-form .iran-map-form-group select:focus,
#iran-map-add-form .iran-map-form-group textarea:focus {
    border-color: var(--map-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 52, 255, 0.1);
}

#iran-map-add-form .iran-map-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.iran-map-form-row {
    display: flex;
    gap: 15px;
}

.iran-map-form-row .iran-map-form-group.half {
    flex: 1;
    margin-bottom: 15px;
}

/* دکمه‌ها */
#iran-map-add-form .iran-map-btn-submit,
#iran-map-add-form .iran-map-btn-cancel {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-family: iransans;
    cursor: pointer;
    transition: all 0.3s ease;
}

#iran-map-add-form .iran-map-btn-submit {
    background: var(--map-color);
    color: #fff;
    margin-left: 10px;
}

#iran-map-add-form .iran-map-btn-submit:hover:not(:disabled) {
    opacity: 0.85;
    transform: translateY(-1px);
}

#iran-map-add-form .iran-map-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#iran-map-add-form .iran-map-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

#iran-map-add-form .iran-map-btn-cancel:hover {
    background: #eee;
}

/* پیام‌ها */
#iran-map-modal-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

#iran-map-modal-message.iran-map-message-success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#iran-map-modal-message.iran-map-message-error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#iran-map-modal-message i {
    margin-left: 8px;
}

/* دکمه افزودن نماینده در لیست */
.iran-map-add-rep-btn {
    background: var(--map-color);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-family: iransans;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.iran-map-add-rep-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.iran-map-add-rep-btn i {
    font-size: 16px;
}

/* -----------------------------
   واکنش‌گرایی (Responsive)
   ----------------------------- */
@media (max-width: 1200px) {
    .mymap-container {
        gap: 15px;
    }
    .mymap-map-area {
        width: 50%;
    }
    .mymap-content-box {
        width: 50%;
    }
}

@media (max-width: 992px) {
    .mymap-container {
        flex-direction: column;
    }
    .mymap-map-area,
    .mymap-content-box {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    .layout-map-left .mymap-container {
        flex-direction: column;
    }
    .layout-map-right .mymap-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .mymap-container {
        padding: 10px;
    }
    .mymap-rep-details {
        flex-direction: column;
        gap: 8px;
    }
    #mymap-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    #mymap-results-header h3 {
        font-size: 16px;
    }
    .map-full-width .map svg {
        max-height: 400px;
    }
    .mymap-pagination {
        flex-wrap: wrap;
    }
    .mymap-pagination .page-btn {
        padding: 4px 10px;
        font-size: 13px;
    }
    .mymap-rep-item {
        padding: 12px 15px;
    }
    .mymap-rep-name {
        font-size: 15px;
    }
    .rep-address {
        font-size: 13px;
    }
    .rep-contact {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    .rep-contact .rep-contact-item:not(:last-child)::after {
        content: "";
        display: none;
    }
    .rep-contact-item {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .mymap-container {
        padding: 8px;
    }
    .map-title {
        font-size: 17px;
    }
    .mymap-rep-item {
        padding: 10px 12px;
    }
    .mymap-rep-name {
        font-size: 14px;
    }
    .rep-address {
        font-size: 12px;
    }
    .rep-contact {
        font-size: 12px;
    }
    .mymap-pagination .page-btn {
        padding: 3px 8px;
        font-size: 12px;
    }
    .iran-map-modal-content {
        max-width: 98%;
        border-radius: 8px;
    }
    .iran-map-modal-header {
        padding: 14px 18px;
    }
    .iran-map-modal-header h3 {
        font-size: 16px;
    }
    .iran-map-modal-body {
        padding: 18px;
    }
    .iran-map-form-row {
        flex-direction: column;
        gap: 0;
    }
    #iran-map-add-form .iran-map-btn-submit,
    #iran-map-add-form .iran-map-btn-cancel {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    #iran-map-add-form .iran-map-btn-submit {
        margin-left: 0;
    }
    .iran-map-add-rep-btn {
        font-size: 13px;
        padding: 6px 14px;
    }
}

@media (max-width: 420px) {
    .mymap-container {
        padding: 5px;
        border-radius: 6px;
    }
    .mymap-rep-item {
        padding: 10px 12px;
    }
    #mymap-results-header h3 {
        font-size: 14px;
    }
    .map-full-width .map svg {
        max-height: 300px;
    }
}




