@font-face {
    font-family: 'BaransysDana';
    src: url('../fonts/dana.ttf') format('truetype');
}

.map-wrapper h1,.map-wrapper h2,.map-wrapper h3,.map-wrapper h4,.map-wrapper h5,.map-wrapper h6,.map-wrapper p,.map-wrapper div,.map-wrapper input,.map-wrapper button,.map-wrapper svg,.map-wrapper text, .map-wrapper span{
    font-family: 'BaransysDana', Tahoma, Geneva, Verdana, sans-serif!important;
}

/*body {*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    align-items: center;*/
/*    justify-content: flex-start; !* تغییر به flex-start برای فضای بیشتر در بالا *!*/
/*    min-height: 100vh;*/
/*    margin: 0;*/
/*    padding-top: 20px; !* اضافه کردن پدینگ از بالا *!*/
/*    background-color: #f4f4f4;*/
/*    color: #333;*/
/*    direction: rtl; !* اطمینان از راست به چپ بودن متن *!*/
/*}*/

.map-wrapper h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.map-wrapper{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.map-container {
    width: 90%;
    height: 700px;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 30px; /* فاصله از پایین */
    display: flex; /* برای مرکز کردن SVG داخلی */
    justify-content: center; /* برای مرکز کردن SVG داخلی */
    align-items: center; /* برای مرکز کردن SVG داخلی */
    position: relative; /* مهم برای موقعیت دهی نام‌ها */
}

#iran-map { /* این ID به SVG که بارگذاری می‌شود تعلق می‌گیرد */
    width: 100%!important;
    height: 700px;
    display: block;
}

/* Base style for all provinces */
/* در فایل SVG دانلود شده، استان‌ها معمولاً دارای ID هایی مانند "IR-01", "IR-02", و... هستند */
/* یا نام استان‌ها (مثلاً "Tehran", "Isfahan") */
/* جاوااسکریپت کلاس "province" را به هر کدام اضافه می‌کند */
.province {
    fill: #E3E3E3; /* یک رنگ سبز زیبا برای استان‌ها */
    stroke: #ffffff; /* مرز سفید */
    stroke-width: 1.5;
    transition: all 0.2s ease-in-out; /* انیمیشن نرم برای هاور */
    cursor: pointer;
    transform-origin: center center; /* نقطه مبدا تبدیل برای افکت سه‌بعدی */
}

/* Hover effect for provinces - 3D-like pop out */
.province:hover {
    fill: #305CFF; /* زرد پررنگ هنگام هاور */
    filter: none !important;
}

/* Active (clicked) state for provinces */
.province.active {
    fill: #2196F3; /* آبی برای استان کلیک شده */
    stroke: #0d47a1;
    stroke-width: 2.5;
}

/* Style for province name labels on the map */
.province-name-label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* یا هر فونت فارسی دیگر */
    font-size: 8px; /* اندازه فونت را از 10px به 8px کاهش دادیم */
    fill: #333; /* رنگ متن */
    pointer-events: none; /* مهم: اجازه می‌دهد کلیک‌ها از روی متن به استان زیرین منتقل شوند */
    user-select: none; /* جلوگیری از انتخاب متن */
    font-weight: 900;
    text-shadow: 0.5px 0.5px 1px rgba(255, 255, 255, 0.7); /* سایه را کمی کمتر کردیم */
}

#province-info {
    margin-top: 20px;
    padding: 15px 25px;
    background-color: #e0f7fa;
    border: 1px solid #b2ebf2;
    border-radius: 5px;
    font-size: 1.1em;
    color: #00796b;
    text-align: center;
    min-width: 250px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.province-modal-container{
    content: "";
    position: fixed;
    top: 0;
    right:0;
    bottom: 0;
    left:0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0);
    transition: all 420ms;
    z-index: 9999999;
}
.province-modal-container.show{
    transform: scale(1);
}
.province-modal-container .province-modal{
    position: relative;
    max-width: 1200px;
    width: 90%;
    height: max-content;
    max-height: 88%;
    background-color: #fff;
    border-radius: 7px;
    box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 20px;
}

.province-modal-container .province-modal .close-button{
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 5;
}

.province-modal-container .province-modal .modal-title{
    position: absolute;
    top: 20px;
    left: 20px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    font-weight: 600;
    font-size: 12px;
}


.province-modal-container .province-modal .close-button img{
    width: 42px;
    padding: 0;
    margin: 0;
}

.province-modal-container .modal-body{
    width: 100%;
    margin-top: 82px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 20px!important;
}

/* FILTER TOGGLE */
.province-modal-container .modal-body .filter {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
    min-height: 36px;
}

.province-modal-container .modal-body .filter button {
    flex: 1;
    padding: 0.5em 1em;
    border: none;
    background: #f9f9f9;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.province-modal-container .modal-body .filter button.active,
.province-modal-container .modal-body .filter button:hover {
    background: #4f46e5;
    color: #fff;
}

/* CARD GRID */
.province-modal-container .modal-body .card-gallery {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr;
    max-height: 95%;
    padding: 0.5rem;
    overflow-y: auto;
}

.province-modal-container .modal-body .card-gallery.loading{
    display: flex;
    justify-content: center;
    align-items: center;
}

.province-modal-container .modal-body .card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px;
    padding: 0.75rem;
    text-align: center;
    transition: transform 0.2s;
}

.province-modal-container .modal-body .card:hover {
    transform: translateY(-4px);
}

.province-modal-container .modal-body .card img {
    max-width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5em;
}

.province-modal-container .modal-body .card .title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    word-wrap: break-word;
}

/* PAGINATION */
.province-modal-container .modal-body .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.province-modal-container .modal-body .pagination button {
    padding: 0.5em 0.75em;
    border: none;
    color: #000;
    background: #f0f0f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.province-modal-container .modal-body .pagination button:hover,
.province-modal-container .modal-body .pagination button.active {
    background: #4f46e5;
    color: #fff;
}

.province-modal-container .modal-body .pagination button.active{
    pointer-events: none;
}

/* RESPONSIVE BREAKPOINTS */
@media (min-width: 600px) {
    .province-modal-container .modal-body .card-gallery { grid-template-columns: repeat(2, 1fr); }
    .province-modal-container .province-modal .modal-title{
        font-weight: 600;
        font-size: 13px;
    }
}
@media (min-width: 900px) {
    .province-modal-container .modal-body .card-gallery { grid-template-columns: repeat(3, 1fr); }
    .province-modal-container .province-modal .modal-title{
        font-weight: 600;
        font-size: 14px;
    }
}
@media (min-width: 1200px) {
    .province-modal-container .modal-body .card-gallery { grid-template-columns: repeat(4, 1fr); }
    .province-modal-container .province-modal .modal-title{
        font-weight: 700;
        font-size: 16px;
    }
}

/* Loading Styles */
/* —— baran-loader wrapper —— */
.baran-loader {
    position: relative;
    width: 160px;
    height: 160px;
}

/* —— common baran-loader-frame styling —— */
.baran-loader-frame {
    position: absolute;
    top: 50%; left: 50%;
    transform-origin: center center;
    border: 4px solid #2779bd;
    /* translate to center each baran-loader-frame */
    transform: translate(-50%, -50%);
}

/* outer circle baran-loader-frame */
.baran-loader-frame1 {
    width: 160px; height: 160px;
    border-radius: 50%;
    animation: baran-loader-frame1Anim 4s ease-in-out infinite;
}
@keyframes baran-loader-frame1Anim {
    0%,100% { transform: translate(-50%,-50%) scale(1)   rotate(0deg); }
    50%      { transform: translate(-50%,-50%) scale(0.8) rotate(180deg); }
}

/* middle morphing baran-loader-frame */
.baran-loader-frame2 {
    width: 120px; height: 120px;
    border-radius: 50%;           /* start/end as circle */
    animation: baran-loader-frame2Anim 3s ease-in-out infinite;
}
@keyframes baran-loader-frame2Anim {
    0%,100%  {
        transform: translate(-50%,-50%) scale(1) rotate(0deg);
        border-radius: 50%;
    }
    50%      {
        transform: translate(-50%,-50%) scale(1.2) rotate(-180deg);
        border-radius: 20px;      /* morph into a rounded-corner rect */
    }
}

/* inner circle baran-loader-frame */
.baran-loader-frame3 {
    width:  90px; height:  90px;
    border-radius: 50%;
    animation: baran-loader-frame3Anim 2s ease-in-out infinite;
}
@keyframes baran-loader-frame3Anim {
    0%,100% { transform: translate(-50%,-50%) scale(1)   rotate(0deg); }
    50%     { transform: translate(-50%,-50%) scale(1.1) rotate(360deg); }
}

/* —— your baran-loader-logo, dead-center —— */
.baran-loader-logo {
    position: absolute;
    top: 50%; left: 50%;
    width: 72px; height: 72px;
    transform: translate(-50%, -50%);
    z-index: 2;
    margin: 0!important;
    padding: 0!important;
}

.baran-loader-logo img{
    margin: 0!important;
    padding: 0!important;
}

/* —— central pulsing dot —— */
.baran-loader::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #2779bd;
    transform: translate(-50%, -50%);
    z-index: 3;
    animation: pulse 1.5s ease-out infinite;
}
@keyframes pulse {
    0%   { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
    70%  { transform: translate(-50%,-50%) scale(2.5); opacity: 0; }
    100% { transform: translate(-50%,-50%) scale(3);   opacity: 0; }
}