/* استایل کلی */
.iran-map-container {
    font-family: 'inherit' !important;
    direction: rtl;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #f8f9fa;
}

/* استایل نقشه */
.iran-map-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.iran-map {
    width: 100%;
    height: 600px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.iran-map-svg {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.iran-map-svg path {
    fill: #e9ecef;
    stroke: #ffffff;
    stroke-width: 2;
    transition: all 0.3s ease;
    cursor: pointer;
}

.iran-map-svg path:hover {
    fill: #4dabf7;
    stroke: #339af0;
    stroke-width: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.iran-map-svg path.active {
    fill: #339af0;
    stroke: #1c7ed6;
    stroke-width: 3;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* استایل لیست استان‌ها */
.provinces-list {
    width: 300px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.provinces-list h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 2px solid #f60505;
    padding-bottom: 12px;
    text-align: center;
}

.province-item {
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
	background: #f8f9fa;
}

.province-item:hover {
    background-color: #e7f5ff;
    background: #ffe5e5;
    border-color: #f60505;
    transform: translateX(-4px);
    box-shadow: 0 2px 8px rgba(51, 154, 240, 0.2);
}

.province-item.active {
    background-color: #339af0;
    background: #f60505 !important;
    color: white;
    border-color: #c00404;
    font-weight: bold;
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.4);
}

.province-item.clicked {
    transform: scale(0.98);
    transition: transform 0.1s;
}

/* استایل لیست نمایندگی‌ها */
.agencies-list {
    width: 100%;
    margin-top: 30px;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agencies-list h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2b2d42;
    font-size: 22px;
    font-weight: 700;
    border-bottom: 2px solid #339af0;
    padding-bottom: 12px;
}

.agencies-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.agency-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
	display: flex;
    flex-direction: column;
}

.agency-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: #339af0;
    transition: all 0.3s ease;
}

.agency-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.agency-card:hover::before {
    width: 6px;
    background: #1c7ed6;
}

.agency-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.agency-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #2c3e50;
}

.agency-code {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.agency-info {
    margin-bottom: 8px 0;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
}

.agency-info strong {
    color: #2c3e50;
    margin-left: 5px;
    min-width: 60px;
}

.agency-type-badge {
    display: inline-block;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
	position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 12px;
    color: white;
}

.agency-type-badge.service {
    background: #28a745;
    color: #2b8a3e;
}

.agency-type-badge.repair {
    background: #dc3545;
    color: #e67700;
}

.agency-actions {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #339af0, #228be6);
    color: white;
    box-shadow: 0 2px 4px rgba(51, 154, 240, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #228be6, #1c7ed6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(51, 154, 240, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #495057, #343a40);
    color: white;
    box-shadow: 0 2px 4px rgba(73, 80, 87, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #343a40, #212529);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(73, 80, 87, 0.4);
}

/* مودال جزئیات نمایندگی */
body.modal-open {
    overflow: hidden;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    padding: 20px 24px 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: transparent !important;
    border: none !important;
    font-size: 22px !important;
    cursor: pointer !important;
    color: #6c757d !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.modal-close:hover {
    background: #f1f3f5 !important;
    color: #343a40 !important;
    transform: none !important;
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #2b2d42;
    font-size: 22px;
    font-weight: 700;
    text-align: right;
}

.agency-details {
    margin-top: 10px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    padding-right: 4px;
	padding-left: 4px;
}

.agency-details img {
    margin-bottom: 10px !important;
    border-radius: 10px !important;
}

.agency-details::-webkit-scrollbar {
    width: 6px;
}

.agency-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.agency-details::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.agency-details::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.agency-details p {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 3px solid #339af0;
}

.agency-details strong {
    color: #2b2d42;
    margin-left: 5px;
}

/* وضعیت‌های مختلف */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #e03131;
    font-size: 16px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #ffa8a8;
}

.no-agencies {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

/* واکنش‌گرا */
@media (max-width: 1024px) {
    .iran-map-container {
        flex-direction: column;
    }
    
    .provinces-list {
        width: 100%;
        max-height: 400px;
		min-height: 400px;
        order: 2;
    }
    
    .iran-map-wrapper {
        order: 1;
    }
    
    .agencies-list {
        order: 3;
    }
    
    .agencies-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .iran-map-container {
        padding: 15px;
    }
    
    .iran-map {
        height: 400px;
    }
    
    .agencies-grid {
        grid-template-columns: 1fr;
    }
    
    .agency-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .iran-map-container {
        padding: 10px;
    }
    
    .iran-map {
        height: 300px;
    }
    
    .provinces-list,
    .agencies-list {
        padding: 15px;
    }
    
    .agency-card {
        padding: 15px;
    }
}
/* استایل نقشه amCharts */
#iranMap {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

/* بهبود استایل‌های لیست استان‌ها */
.provinces-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* استایل‌های واکنش‌گرا */
@media (max-width: 768px) {
    #iranMap {
        height: 400px;
    }
}

@media (max-width: 480px) {
    #iranMap {
        height: 300px;
    }
}
/* استایل نقشه amCharts */
#iranMap {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

/* بهبود استایل‌های لیست استان‌ها */
.provinces-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* استایل‌های واکنش‌گرا */
@media (max-width: 768px) {
    #iranMap {
        height: 400px;
    }
}

@media (max-width: 480px) {
    #iranMap {
        height: 300px;
    }
}

/* استایل برای حالت لودینگ */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.loading div {
    font-size: 24px;
    margin-bottom: 10px;
}

/* استایل highlight برای نتایج جستجو */
.highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* استایل برای لیست استان‌ها با اسکرول */
.provinces-scroll {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 5px;
	padding-left: 5px;
}

/* اسکرول بار سفارشی */
.provinces-scroll::-webkit-scrollbar {
    width: 6px;
}

.provinces-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.provinces-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.provinces-scroll::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* رفع مشکل تولتیپ نقشه amCharts در حالت RTL */
.iran-map-container .amcharts-tooltip-div {
    direction: rtl !important;
    text-align: center !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: bold !important;
    padding: 12px 20px !important;
    white-space: nowrap !important;
}
/* ==================== استایل‌های اصلی ==================== */
.iran-map-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-family: inherit !important;
    direction: rtl;
}

/*.provinces-list {
    flex: 0 0 250px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}*/

.iran-map-wrapper {
    flex: 1;
    min-width: 300px;
}

.agencies-list {
    flex: 0 0 100%;
    margin-top: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ==================== استایل لیست استان‌ها ==================== */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100% !important;
    padding: 12px 5px 12px 15px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #f8f9fa !important;
    transition: all 0.3s ease !important;
}

.search-box input:focus {
    outline: none;
    border-color: #339af0;
    background: white;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.1);
}

.search-icon {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.provinces-scroll {
    /*max-height: 500px;*/
    overflow-y: auto;
}

/* ==================== استایل نقشه amCharts ==================== */
#iranMap {
    width: 100% !important;
    height: 600px !important;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* رفع تداخل با استایل‌های موجود */
.iran-map-container .amcharts-tooltip-div {
    direction: rtl !important;
    text-align: center !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: bold !important;
    padding: 12px 20px !important;
    white-space: nowrap !important;
}

/* تضمین نمایش صحیح نقشه */
.amcharts-MapChart {
    width: 100% !important;
    height: 100% !important;
}

.amcharts-Root {
    width: 100% !important;
    height: 100% !important;
}

/* ==================== استایل نمایندگی‌ها ==================== */
.agencies-list h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.loading, .no-agencies, .error {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

.loading div:first-child,
.no-agencies div:first-child {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
} 

.agency-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #339af0;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
    min-width: 140px;
    text-align: center;
}

.btn-primary {
    background: #f60505;
    color: white;
}

.btn-primary:hover {
    background: #c00404;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* ==================== responsive ==================== */
@media (max-width: 992px) {
    .iran-map-container {
        flex-direction: column;
    }
    
    .provinces-list {
        flex: 0 0 auto;
        order: 2;
    }
    
    .iran-map-wrapper {
        order: 1;
    }
    
    .agencies-list {
        order: 3;
    }
    
    #iranMap {
        height: 500px !important;
    }
}

@media (max-width: 768px) {
    .agencies-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        min-width: 100%;
    }
    
    .agency-actions {
        flex-direction: column;
    }
}

/* ==================== بهبود performance اسکرول ==================== */
html {
    scroll-behavior: smooth;
}

/* جلوگیری از لرزش */
.province-item {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* بهبود اسکرول‌بار */
.provinces-scroll::-webkit-scrollbar {
    width: 6px;
}

.provinces-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.provinces-scroll::-webkit-scrollbar-thumb {
    background: #b0bec5;
    border-radius: 3px;
}

.provinces-scroll::-webkit-scrollbar-thumb:hover {
    background: #78909c;
}