/*
 * Iran Map - SVG and Responsive.
 * Free and open source.
 * Version 1.1.0
 * By: MohammadReza Pourmohammad.
 * Email: mohammadrpm@gmail.com
 * Web: http://mrpm.ir
 */

#IranMap{
    display: block;
    position: relative;
    direction: rtl;
    text-align: right;
    padding: 0;
    width: 90%;
    margin: 50px auto;
}

#IranMap .show-title{
    display: none;
    position: absolute;
    background-color: #333;
    color: #fff;
    margin: 0 !important;
    padding: 0 5px;
    text-align: center;
    line-height: 26px;
    border-radius: 2px;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    opacity: 0.8;
}

#IranMap .map{
    display: block;
    float: left;
    width: 50%;
    text-align: left;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
#IranMap .map svg{
    height: 500px;
    width: 500px;
}
#IranMap .map .border path, #IranMap .map .island path{
    fill: #fff;
}
#IranMap .map .province path{
    fill: #d9e4fa;
}
#IranMap .map .sea path, #IranMap .map .lake path{
    fill: #6caed8;
}
#IranMap .map .province path:hover, #IranMap .map .island path:hover, #IranMap .map .province path.hover, #IranMap .map .island path.hover{
    fill: #2960b0 !important;
    cursor: pointer;
}
#IranMap .map .province path.active, #IranMap .map .island path.active{
    fill: #2960b0 !important;
}

/* استایل tooltip برای نمایش نام استان‌ها */
.province-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#IranMap .list{
    display: block;
    float: right;
    width: 50%;
    background: #e3f2fd;
    border: 1px solid #e9ecef;
    height: 400px;
    overflow: hidden;
}

#IranMap .list.projects-mode {
    background: #f5f5f5;
}

/* هدر ثابت */
#IranMap .list-header {
    background: #231f20;
    color: #ffffff;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    text-align: right !important;
    position: relative;
}
.projects-mode .list-header {
    background: #175bd6 !important;
    color: #fff !important;
}
.list-header-content {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.list-header-left {
    text-align: right;
    flex: 1;
}

.list-header-right {
    text-align: left;
    flex: 1;
}

.list-header-title {
    font-size: 14px;
    margin: 0;
}

.list-header-subtitle {
    font-size: 18px;
    color: #ffffff;
    margin: 2px 0 0 0;
    font-weight: 600;
}

.list-header-simple {
    text-align: center;
    width: 100%;
    font-size: 16px;
}

.capacity-number {
    font-size: 18px;
}

.capacity-unit {
    font-size: 10px;
    color: #fff;
    font-weight: 400;
}

/* دکمه بازگشت */
.back-button {
    font-size: 12px;
    background: transparent !important;
}

.back-button:hover {
    background: #f8f9fa;
}

/* محتوای لیست */
#IranMap .list-content {
    height: calc(100% - 60px);
    overflow-y: auto;
    padding: 0;
    direction: rtl;
}

#IranMap .list-content::-webkit-scrollbar {
    width: 6px;
}

#IranMap .list-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
}

#IranMap .list-content::-webkit-scrollbar-track {
    background: #f8f9fa;
}
.modal-content h2 {
    font-size: 18px;
    font-weight: 600;
}
/* استایل آیتم‌های لیست */
.list-item {
    background: #0e4bbb;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #6a90d7;
}
#IranMap .project-item .list-item-text {
    color: #262626 !important;
    font-weight: 500;
}
.list-item:hover {
    background: #0e4bbb;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-text {
    color: #fff;
}

/* حالت بارگذاری */
.loading-state {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* پاک کردن استایل‌های قدیمی */
#IranMap .list ul,
#IranMap .list li,
#IranMap .list li ul li,
#IranMap .list li ul li a {
    all: unset;
}

#IranMap .list ul:before, 
#IranMap .list ul:after {
    display: none;
}

#IranMap .city{
    display: none;
}

#IranMap .city h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

#IranMap .no-projects {
    background: #e74c3c;
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 5px;
    font-size: 14px;
}

#IranMap .projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#IranMap .project-item {
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px 12px;
}

#IranMap .project-item:hover {
    transform: translateY(-2px);
}

#IranMap .project-item h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 14px;
}

#IranMap .project-item p {
    margin: 5px 0;
    font-size: 12px;
    color: #7f8c8d;
}

#IranMap .project-status {
    font-weight: bold;
}

#IranMap .project-budget {
    color: #27ae60;
    font-weight: bold;
}

/* استایل‌های پاپ‌آپ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes slideIn {
    from {transform: translateY(-50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

/* Modal Close Button */
.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    left: 20px;
}

.close:hover,
.close:focus {
    color: #e74c3c;
    text-decoration: none;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: none;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    position: relative;
    animation: slideIn 0.3s;
    direction: rtl;
    text-align: right;
}

/* طراحی دو ستونه برای پاپ‌آپ */
.project-modal-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
}

.project-gallery-section {
    width: 50%;
    flex-shrink: 0;
}

.project-details-section {
    width: 50%;
    flex-shrink: 0;
    direction: rtl;
    text-align: right;
}

/* استایل‌های Swiper Gallery */
.project-gallery {
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.project-swiper {
    width: 100%;
    height: 180px;
    border-radius: 8px;
}

.project-swiper .swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

.project-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
}

.project-swiper .swiper-button-next,
.project-swiper .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    margin-top: -15px;
    border-radius: 50%;
    transition: all 0.3s;
}

.project-swiper .swiper-button-next:after,
.project-swiper .swiper-button-prev:after {
    font-size: 12px;
    font-weight: bold;
}

.project-swiper .swiper-button-next:hover,
.project-swiper .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.project-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s;
}

.project-swiper .swiper-pagination-bullet-active {
    background: #3498db;
    transform: scale(1.2);
}

.project-swiper .swiper-pagination {
    bottom: 8px;
}

/* استایل‌های بخش اطلاعات */
.project-details {
    margin: 0;
    direction: rtl;
    text-align: right;
}

.project-details h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    margin-top: 20px;
    font-size: 16px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.project-details h3:first-child {
    margin-top: 0;
}

.project-details p {
    margin: 12px 0;
    line-height: 1.6;
    font-size: 14px;
}

.project-details strong {
    color: #2c3e50;
    display: inline-block;
    min-width: 120px;
    font-weight: bold;
}

.project-details ul {
    margin: 15px 0;
    padding-right: 20px;
}

.project-details li {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 14px;
    color: #34495e;
}

/* Media Queries */
@media(max-width: 930px){
    #IranMap .list{
        width: 50%;
    }
}

@media(max-width: 768px) {
    #IranMap {
        width: 95%;
        margin: 20px auto;
    }
    
    #IranMap .list, #IranMap .map{
        width: 100%;
        float: none;
    }
    
    #IranMap .map {
        margin-bottom: 20px;
    }
    
    #IranMap .map svg{
        height: 300px;
        width: 100%;
        max-width: 400px;
    }
    
    .project-modal-content {
        flex-direction: column;
    }
    
    .project-gallery-section,
    .project-details-section {
        width: 100%;
    }
    
    .project-details-section {
        direction: rtl;
    }
    
    .project-swiper {
        height: 200px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 2% auto;
        padding: 15px;
    }
    
    #IranMap .list-content {
        max-height: 250px;
    }
    
    .list-header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .list-header-left,
    .list-header-right {
        text-align: center;
        flex: none;
    }
}

@media(max-width: 515px){
    #IranMap .map svg{
        height: 250px;
        width: 100%;
    }
    
    #IranMap .list-content {
        max-height: 200px;
    }
    
    .list-item {
        padding: 10px 15px;
    }
    
    .list-item-text {
        font-size: 13px;
    }
    
    .back-button {
        padding: 4px 8px;
        font-size: 10px;
        position: static;
        transform: none;
        margin-bottom: 10px;
    }
    
    .list-header {
        flex-direction: column;
        padding: 10px 15px;
    }
    
    .project-swiper {
        height: 180px;
    }
}

@media(max-width: 400px){
    .list-item {
        padding: 8px 12px;
    }
    
    .list-item-text {
        font-size: 12px;
    }
    
    .project-swiper {
        height: 160px;
    }
    
    .modal-content {
        padding: 10px;
    }
}

@media(max-width: 250px){
    #IranMap .list-header {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .project-swiper {
        height: 140px;
    }
}

/* استایل‌های Select2 سفارشی */
.select2-container {
    direction: rtl;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #007cba;
    border: 1px solid #007cba;
    color: #fff;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 3px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-left: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ff6b6b;
}

.select2-dropdown {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 6px 8px;
}

.select2-results__option {
    padding: 8px 12px;
}

.select2-results__option--highlighted {
    background-color: #007cba !important;
    color: #fff;
}
/* استایل‌های گالری تصاویر */
.gallery-image-item {
    display: inline-block;
    position: relative;
    margin: 5px;
}

.gallery-image-item img {
    display: block;
    border-radius: 4px;
    border: 2px solid #ddd;
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.remove-image:hover {
    background: #cc0000;
    transform: scale(1.1);
}

#gallery_preview {
    margin-top: 10px;
    min-height: 50px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    padding: 10px;
}

#gallery_preview:empty::before {
    content: "هنوز تصویری انتخاب نشده است";
    color: #999;
    font-style: italic;
}