@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f4f5f7;
    color: #222;
    line-height: 1.8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: inherit; text-decoration: none; }

/* هدر */
.site-header {
    background: #0d5c46;
    color: #fff;
    padding: 23px 0;
    position: relative; /* برای قرارگیری تصویر پانوراما به‌عنوان پس‌زمینه کل هدر */
    overflow: hidden; /* تصویر پانوراما دقیقاً در محدوده هدر برش بخورد */
}
/* وقتی تصویر پانوراما تنظیم شده باشد، ارتفاع هدر در دسکتاپ بیشتر می‌شود تا عکس کمتر از بالا/پایین بریده شود */
.site-header.has-panorama {
    min-height: 420px;
}
.header-panorama {
    position: absolute;
    inset: 0;
    z-index: 0;
    line-height: 0;
}
.header-panorama img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* برای اینکه در باریک شدن قاب، بالای عکس حذف نشود */
}
/* لایه تیره‌کننده روی عکس، دقیقاً مثل گرادینت پایین بنر اصلی سایت، تا نوشته‌های سفید هدر خوانا بمانند */
.site-header.has-panorama::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.6) 0%, rgba(13,92,70,.48) 42%, rgba(13,92,70,.48) 58%, rgba(0,0,0,.65) 100%);
    pointer-events: none;
}
.site-header > .container {
    position: relative;
    z-index: 1; /* محتوای هدر (لوگو، منو، جستجو، متن) بالای تصویر پانوراما و لایه تیره قرار می‌گیرد */
}
@media (max-width: 900px) {
    .site-header.has-panorama { min-height: 280px; }
}
@media (max-width: 640px) {
    .site-header.has-panorama { min-height: 165px; }
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}
.header-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: bold; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.site-name-text { font-size: 8px; font-weight: normal; color: #d8ede6; text-align: center; max-width: 160px; line-height: 1.5; }
.site-logo-img { height: 70px; width: auto; border-radius: 4px; background:#fff; padding:2px; }
.site-logo-img.is-transparent { background: transparent; padding: 0; } /* برای لوگوهای PNG/GIF شفاف، پس‌زمینه سایت از پشت لوگو دیده می‌شود */
.header-subtext { color: #d8ede6; font-size: 13px; padding: 6px 0 2px; }
.header-left { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.motto-image { height: 70px; width: auto; border-radius: 4px; background: #fff; padding: 2px; }
.motto-image.is-transparent { background: transparent; padding: 0; }
.main-nav a {
    margin-inline-start: 16px;
    font-size: 15px;
}
.main-nav a:hover { text-decoration: underline; }

/* دسته‌بندی‌های شناور - ستون دکمه‌ای سمت راست صفحه، هنگام اسکرول در جای خود ثابت می‌ماند */
.floating-cat-nav {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}
.floating-cat-btn {
    display: block;
    background: #0d5c46;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    padding: 10px 18px 10px 14px;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.22);
    /* حالت اولیه‌ی هر دکمه قبل از اجرای اسکریپت جمع‌شدن، کاملاً باز است */
    transform: translateX(0);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), background-color .2s ease, box-shadow .2s ease;
    will-change: transform;
    cursor: pointer;
}
.floating-cat-btn.is-peek {
    /* حالت جمع‌شده: بخش قابل‌توجهی از دکمه (برای خوانا ماندن) از سمت راست صفحه پیداست */
    transform: translateX(calc(100% - 46px));
}
.floating-cat-btn.is-peek:hover,
.floating-cat-btn.is-peek:focus-visible {
    /* با هاور روی همان بخش پیدا، کل دکمه با یک حرکت فنری (bounce) کامل بیرون می‌آید */
    transform: translateX(0);
    background: #0a4736;
    box-shadow: 0 4px 16px rgba(0,0,0,.32);
}
@media (max-width: 900px) {
    .floating-cat-nav { display: none; } /* در موبایل/تبلت، دسترسی به دسته‌بندی‌ها همچنان از منوی هدر ممکن است */
}

/* کادر جستجو - زیر تصویر شعار سال، سمت چپ هدر */
.site-search { display: flex; align-items: center; background: #fff; border: none; border-radius: 20px; padding: 3px 4px 3px 12px; }
.site-search input {
    background: transparent; border: none; outline: none; color: #222; font-family: inherit;
    font-size: 13px; width: 150px; padding: 5px 8px;
}
.site-search input::placeholder { color: #999; }
.site-search button { background: #0d5c46; color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 12px; flex-shrink: 0; }
@media (max-width: 480px) {
    .site-search input { width: 110px; }
}
@media (max-width: 640px) {
    .motto-image { display: none; } /* شعار سال در نسخه موبایل مخفی می‌شود */
}

/* محتوای اصلی */
.main-content { padding: 30px 16px; min-height: 60vh; }

/* در اندازه‌هایی که «دسته‌بندی‌های شناور» نمایش داده می‌شوند (بالاتر از 900px)،
   سمت راست محتوا به‌اندازه‌ی کافی عقب‌تر از لبه‌ی صفحه نگه داشته می‌شود تا حالت
   «بسته/peek» دکمه‌ها (۴۶px + سایه) هرگز روی متن یا عکس خبرها نیفتد. */
@media (min-width: 901px) {
    .main-content { padding-right: 80px; }
}

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
    border-inline-start: 4px solid #0d5c46;
    padding-inline-start: 10px;
}

/* بنر خودکار صفحه اصلی */
.banner-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    max-height: 340px;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    background: #eee;
}
.banner-track { position: relative; width: 100%; height: 100%; }
.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease;
    display: block;
}
.banner-slide.active { opacity: 1; visibility: visible; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-caption {
    position: absolute;
    bottom: 0; right: 0; left: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
    color: #fff;
    padding: 40px 20px 16px;
    font-size: 18px;
    font-weight: bold;
}
.banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.3);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 2;
}
.banner-nav:hover { background: rgba(255,255,255,.5); }
.banner-prev { right: 14px; }
.banner-next { left: 14px; }
.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.banner-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
}
.banner-dot.active { background: #fff; }
@media (max-width: 640px) {
    .banner-carousel { aspect-ratio: 2 / 1; max-height: 220px; }
    .banner-caption { font-size: 14px; padding: 24px 12px 10px; }
}

/* فیلد کلیدواژه (تگ) در پنل مدیریت */
.tag-input-box {
    position: relative;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background: #fff;
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    background: #e6f2ee;
    color: #0d5c46;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}
#tag-text-input { border: none; outline: none; flex: 1; min-width: 150px; font-family: inherit; font-size: 14px; padding: 4px; }
.tag-suggestions {
    display: none;
    position: absolute;
    top: 100%; right: 0; left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    z-index: 10;
    max-height: 180px;
    overflow-y: auto;
}
.tag-suggestion-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.tag-suggestion-item:hover { background: #f0f0f0; }

/* نمایش تگ‌ها در پایین خبر */
.post-tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags a {
    background: #eef1ef;
    color: #0d5c46;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 13px;
}
.post-tags a:hover { background: #dbe7e2; }
.jalali-picker-popup {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    padding: 10px;
    z-index: 2000;
    width: 240px;
    font-family: inherit;
}
.jp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.jp-header .jp-label { font-weight: bold; font-size: 14px; }
.jp-nav {
    background: #f0f0f0; border: none; border-radius: 50%; width: 26px; height: 26px;
    cursor: pointer; font-size: 16px; color: #333;
}
.jp-nav:hover { background: #e0e0e0; }
.jp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jp-wd { text-align: center; font-size: 11px; color: #888; padding: 4px 0; }
.jp-day {
    background: none; border: none; border-radius: 4px; padding: 6px 0;
    font-size: 13px; cursor: pointer; color: #333; font-family: inherit;
}
.jp-day:hover { background: #e6f2ee; }
.jp-day.jp-today { border: 1px solid #0d5c46; }
.jp-day.jp-selected { background: #0d5c46; color: #fff; }
.jp-today-btn {
    display: block; width: 100%; margin-top: 8px; background: #f0f0f0; border: none;
    border-radius: 6px; padding: 6px 0; font-size: 12px; cursor: pointer; font-family: inherit;
}
.jp-today-btn:hover { background: #e0e0e0; }

/* نظرسنجی به سبک گوگل‌فرم (پنل مدیریت) */
.gform-card { background: #fff; border-radius: 8px; border: 1px solid #e2e2e2; margin-bottom: 16px; overflow: hidden; }
.gform-topbar { height: 4px; background: transparent; }
.gform-topbar-thick { height: 10px; background: #673ab7; }
.gform-body { padding: 20px 24px; }
.gform-header-card .gform-body { border-top: none; }
.gform-title-input {
    width: 100%; border: none; border-bottom: 1px solid #ddd; font-size: 22px; font-weight: 500;
    padding: 8px 2px; outline: none; font-family: inherit;
}
.gform-title-input:focus { border-bottom: 2px solid #673ab7; }
.gform-question { font-size: 22px; font-weight: 500; color: #222; }
.gform-option-row, .gform-add-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.gform-radio-ghost {
    width: 18px; height: 18px; border: 2px solid #ccc; border-radius: 50%; flex-shrink: 0;
}
.gform-option-input {
    flex: 1; border: none; border-bottom: 1px solid #eee; padding: 6px 2px; font-size: 15px;
    outline: none; font-family: inherit; background: transparent;
}
.gform-option-input:focus { border-bottom: 1px solid #673ab7; }
.gform-remove-btn { background: none; border: none; color: #999; cursor: pointer; font-size: 15px; padding: 4px; }
.gform-remove-btn:hover { color: #b3261e; }
.gform-add-btn { background: none; border: none; color: #673ab7; font-size: 14px; cursor: pointer; font-family: inherit; padding: 6px 0; }
.gform-add-btn:hover { text-decoration: underline; }

/* نظرسنجی به سبک گوگل‌فرم (نمایش عمومی سایت) */
.gform-public-option {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #e2e2e2;
    border-radius: 6px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.gform-public-option:hover { border-color: #673ab7; background: #faf8fd; }
.gform-public-option input[type="radio"] { width: 18px; height: 18px; accent-color: #673ab7; margin: 0; }
.gform-public-option label { flex: 1; font-size: 15px; cursor: pointer; }
.gform-submit-btn {
    background: #673ab7; color: #fff; border: none; padding: 10px 28px; border-radius: 6px;
    font-size: 14px; cursor: pointer; font-family: inherit; margin-top: 10px;
}
.gform-submit-btn:hover { background: #5a2fa0; }

/* جدول انتخاب اخبار مرتبط - دیگر هیچ عرض ثابت خاصی ندارد، دقیقاً مثل جدول دسته‌بندی‌ها (.admin-table) رفتار می‌کند */
.related-toggle-btn { padding: 5px 14px; font-size: 12px; white-space: nowrap; }
.toggle-switch-btn { padding: 6px 16px; font-size: 13px; white-space: nowrap; border: none; border-radius: 6px; color: #fff; cursor: pointer; font-family: inherit; }

/* بخش دوم صفحه اصلی: اخبار به شکل خطی/محتوایی (Content View) با تصویر بزرگ‌تر */
.home-content-list {
    margin-top: 22px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}
.home-content-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #222;
    transition: background .12s ease;
}
.home-content-row:last-child { border-bottom: none; }
.home-content-row:hover { background: #f7f9f8; }
.home-content-row img {
    height: var(--img-size, 88px);
    width: calc(var(--img-size, 88px) * 1.5);
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.home-content-info { flex: 1; min-width: 0; }
.home-content-title { font-size: 16px; margin: 6px 0 4px; }
.home-content-excerpt { font-size: 13px; color: #666; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 560px) {
    .home-content-row img { height: 64px; width: 96px; }
    .home-content-excerpt { display: none; }
}

/* گرید خبرها */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    transition: transform .15s ease;
    display: flex;
    flex-direction: column;
}
.news-card:hover { transform: translateY(-3px); }
.news-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.news-card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.news-card-body .cat-badge {
    display: inline-block;
    background: #e6f2ee;
    color: #0d5c46;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    align-self: flex-start;
}
.news-card-body h3 { font-size: 17px; margin-bottom: 8px; }
.news-card-body p { font-size: 14px; color: #555; }
.news-meta { font-size: 12px; color: #888; margin-top: 10px; text-align: left; }
.news-card-body .news-meta { margin-top: auto; padding-top: 10px; }

/* صفحه تک خبر */
.single-post .featured-image-small {
    float: left;
    width: 40%;
    max-width: 320px;
    min-width: 140px;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    /* top | right (gap facing the wrapped text) | bottom | left (flush edge, no gap needed) */
    margin: 4px 28px 14px 0;
}
.single-post .featured-image-report {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin: 4px 0 18px;
}
.single-post .featured-image-report.is-clickable { cursor: pointer; position: relative; transition: filter .2s ease; }
.single-post .featured-image-report.is-clickable:hover { filter: brightness(.88); }
.single-post h1 { font-size: 26px; margin-bottom: 12px; }
.single-post .post-lead {
    background: #e9ece9;
    border-right: 4px solid #0d5c46;
    padding: 14px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16.5px;
    line-height: 1.9;
    margin: 16px 0 20px;
    text-align: justify;
}
.single-post .post-content { font-size: 16px; margin-top: 20px; text-align: justify; overflow: auto; }
.single-post .post-content p { margin-bottom: 14px; text-align: justify; }

@media (max-width: 640px) {
    .single-post .post-content, .single-post .post-content p { padding-inline: 8px; }
    .single-post .post-lead { padding: 14px 24px; }
    .single-post .featured-image-small { width: 42%; max-width: 200px; min-width: 110px; margin: 4px 18px 14px 0; }
}

/* باکس لینک کوتاه */
.short-link-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f7f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 5px 8px;
    margin-top: 20px;
    font-size: 12px;
    width: fit-content;      /* shrink-wrap, same visual size as before */
    max-width: 100%;
    margin-inline-start: auto; /* pushes the box to the inline-end edge: left in this RTL page */
}
.short-link-box span { color: #777; white-space: nowrap; }
.short-link-box input {
    width: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    font-family: inherit;
    direction: ltr;
    text-align: left;
    color: #333;
    background: #fff;
}
.short-link-box .btn { padding: 4px 12px; font-size: 12px; white-space: nowrap; }

@media (max-width: 420px) {
    /* below this width a 40%-wide float leaves too little room for readable wrapped text */
    .single-post .featured-image-small {
        float: none;
        display: block;
        width: 100%;
        max-width: none;
        margin: 4px 0 14px 0;
    }
    .short-link-box {
        width: 100%;
        margin-inline-start: 0;
    }
    .short-link-box input { width: auto; flex: 1 1 auto; min-width: 0; }
}

/* اخبار مرتبط - نمایش خطی شبیه حالت جزئیات (Details View) */
.related-list {
    margin-top: 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}
.related-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #222;
    transition: background .12s ease;
}
.related-row:last-child { border-bottom: none; }
.related-row:hover { background: #f7f9f8; }
.related-row img { height: 44px; width: 66px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.related-title { flex: 1; font-size: 14px; }
.related-cat { font-size: 12px; color: #0d5c46; background: #e6f2ee; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.related-date { font-size: 12px; color: #888; white-space: nowrap; min-width: 90px; text-align: left; }
@media (max-width: 560px) {
    .related-cat { display: none; }
    .related-date { min-width: auto; }
}

/* گالری داخل خبر (گزارش تصویری) - با پس‌زمینه و تم تیره، هماهنگ با لایت‌باکس تمام‌صفحه */
.post-gallery-section {
    background: #14171a;
    border-radius: 10px;
    padding: 18px 20px 22px;
    margin-top: 25px;
}
.post-gallery-section h3 { margin: 0 0 16px; color: #f2f2f2; }
.post-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 0; }
.post-gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.post-gallery img:hover { transform: scale(1.03); opacity: .9; }

/* لایت‌باکس */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.lightbox-image {
    max-width: 85%;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0,0,0,.5);
    cursor: zoom-in;
}
.lightbox-close, .lightbox-download, .lightbox-nav {
    position: absolute;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.lightbox-close:hover, .lightbox-download:hover, .lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-close { top: 20px; left: 20px; width: 42px; height: 42px; font-size: 18px; }
.lightbox-download {
    top: 20px; right: 20px; width: auto; height: 42px; padding: 0 18px;
    border-radius: 21px; font-size: 14px; font-family: inherit; gap: 6px;
}
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 26px; }
.lightbox-prev { right: 20px; }
.lightbox-next { left: 20px; }
.lightbox-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,.12); color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 13px;
}
@media (max-width: 640px) {
    .lightbox-nav { width: 42px; height: 42px; font-size: 20px; }
    .lightbox-prev { right: 8px; }
    .lightbox-next { left: 8px; }
    .lightbox-download { right: 8px; padding: 0 12px; }
    .lightbox-close { left: 8px; top: 12px; }
}

/* فرم‌ها */
.form-box { background: #fff; padding: 20px; border-radius: 8px; max-width: 500px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
.btn {
    display: inline-block;
    background: #0d5c46;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}
.btn:hover { background: #0a4736; }
.btn-danger { background: #b3261e; }
.btn-danger:hover { background: #8f1e18; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e3f7e3; color: #1b6b1b; }
.alert-error { background: #fdeaea; color: #a12222; }

/* بج وضعیت رویدادها */
.status-badge { display:inline-block; padding:4px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.badge-confirmed { background:#e6f2ee; color:#0d5c46; }
.badge-preparing { background:#fff4e0; color:#a1650c; }
.badge-ongoing { background:#e3f7e3; color:#1b6b1b; }
.badge-held { background:#eee; color:#666; }
.badge-cancelled { background:#fdeaea; color:#a12222; }
.badge-reviewing { background:#eaf1fb; color:#2255a1; }

.events-table-wrap {
    overflow-x: auto;
    direction: ltr; /* این ترفند باعث می‌شود میله اسکرول سمت راست بیفتد و جهت اسکرول با انتظار کاربر هم‌خوان باشد */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;         /* فایرفاکس: میله اسکرول در حالت عادی (نه نازک) */
    scrollbar-color: #0d5c46 #e5e5e5; /* فایرفاکس: رنگ میله و پس‌زمینه */
}
.events-table-wrap .admin-table { min-width: 700px; direction: rtl; background: #fff; border: 1px solid #e2e2e2; } /* محتوای جدول به حالت طبیعی راست‌چین برمی‌گردد */
.events-table-wrap .admin-table th, .events-table-wrap .admin-table td { text-align: center; }
.events-table-wrap .admin-table th { background: #0d5c46; color: #fff; font-weight: 600; border-bottom: none; }

/* اسکرول‌بار واضح و ضخیم برای مرورگرهای مبتنی بر Chromium/Safari (WebKit) */
.events-table-wrap::-webkit-scrollbar { height: 12px; }
.events-table-wrap::-webkit-scrollbar-track { background: #e5e5e5; border-radius: 6px; }
.events-table-wrap::-webkit-scrollbar-thumb { background: #0d5c46; border-radius: 6px; }
.events-table-wrap::-webkit-scrollbar-thumb:hover { background: #0a4736; }

/* رنگ پس‌زمینه‌ی کل ردیف جدول تقویم رویدادها بر اساس وضعیت (صفحه عمومی تقویم رویدادها) */
.row-status-preparing, .row-status-preparing td { background: #f4f7a6 !important; }
.row-status-ongoing, .row-status-ongoing td { background: #b9f0e2 !important; }
.row-status-cancelled, .row-status-cancelled td { background: #dcdccb !important; }

/* نوار فیلتر بالای صفحه تقویم رویدادها (فیلتر سال + جستجوی عنوان) */
.events-filter-bar { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }

/* نمایش موبایل جدول تقویم رویدادها: به‌صورت پیش‌فرض کارت‌های موبایل مخفی و جدول دسکتاپ نمایش داده می‌شود */
.events-mobile-list { display: none; }
.event-mobile-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.event-mobile-title-line { font-weight: 600; margin-bottom: 6px; }
.event-mobile-line { font-size: 13px; color: #444; margin-top: 4px; }

@media (max-width: 640px) {
    .events-desktop-table { display: none; }
    .events-mobile-list { display: block; }
}

/* جدول اطلاعات مجری در صفحه پروفایل عمومی */
.performer-info-card .admin-table th { width: 160px; background: #f5f5f5; text-align: right; }

/* توضیح محدودیت نمایش اطلاعات/رویدادها در صفحه پروفایل مجری، بر اساس سطح ثبت‌شده برای او */
.performer-restricted-note {
    background: #fff4e5;
    color: #9a5b00;
    border: 1px solid #f3d9a4;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    margin-top: 10px;
}

/* پاگینیشن */
.pagination { display: flex; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span, .pagination button {
    padding: 6px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.4;
}
.pagination .active, .pagination button.active { background: #0d5c46; color: #fff; cursor: default; }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination button:hover:not(:disabled):not(.active) { background: #eee; }

/* تقویم شمسی رویدادها (events.php) */
.events-calendar-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0 28px;
    max-width: 760px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ec-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }

/* ستون تقویم - عرض ثابت و کوچک تا در مانیتورهای بزرگ هم فضای زیادی اشغال نکند */
.ec-calendar { flex: 0 0 auto; width: 100%; max-width: 280px; }

.ec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ec-title-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ec-title { font-size: 15px; font-weight: bold; color: #0d5c46; min-width: 100px; text-align: center; }
.ec-nav-btn {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: #f0f1f0; color: #333; font-size: 16px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ec-nav-btn:hover { background: #e0e2e0; }
.ec-today-btn { background: #0d5c46; color: #fff; border: none; padding: 3px 12px; border-radius: 6px; font-size: 11px; cursor: pointer; }
.ec-today-btn:hover { background: #0a4736; }

.ec-weekdays, .ec-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.ec-weekdays { text-align: center; font-size: 11px; color: #888; margin-bottom: 6px; }
.ec-weekdays div { padding: 2px 0; }
.ec-grid { gap: 4px; }

.ec-day {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
}
.ec-day.ec-empty { visibility: hidden; cursor: default; }
.ec-day.ec-friday { color: #b3261e; }
.ec-day.ec-today { box-shadow: inset 0 0 0 2px #0d5c46; font-weight: bold; }
.ec-day.ec-selected { background: #dcdcdc; }
.ec-day.ec-has-event {
    background: #e5f4ee;
    color: #0d5c46;
    font-weight: bold;
}
.ec-day.ec-has-event.ec-selected,
.ec-day.ec-has-event:hover,
.ec-day.ec-has-event.ec-open,
.ec-day.ec-has-event:focus-visible {
    background: #0d5c46;
    color: #fff;
    outline: none;
}
.ec-day.ec-has-event.ec-today { box-shadow: inset 0 0 0 2px #2ECC71; }
/* نقطه‌ی کوچک برای تعطیلات رسمی (زیر عدد روز) */
.ec-day.ec-holiday::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #b3261e;
}
.ec-day.ec-holiday.ec-has-event::after { background: #ffb3a8; }

.ec-tooltip {
    display: none;
    position: absolute;
    bottom: 115%;
    right: 50%;
    transform: translateX(50%);
    background: #1f2937;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.8;
    width: max-content;
    max-width: 200px;
    text-align: right;
    z-index: 20;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.ec-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}
.ec-tooltip ul { margin: 0; padding-inline-start: 16px; }
.ec-day.ec-has-event:hover .ec-tooltip,
.ec-day.ec-has-event:focus-visible .ec-tooltip,
.ec-day.ec-has-event.ec-open .ec-tooltip { display: block; }

/* پنل کناری: رویدادهای امروز / رویدادهای این روز + تعطیلات رسمی (توضیحات) */
.ec-side { flex: 1 1 240px; min-width: 220px; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.ec-day-panel { background: #f8f9f8; border-radius: 8px; padding: 14px 16px; }
.ec-day-panel-title { margin: 0 0 8px; font-size: 14px; color: #0d5c46; }
.ec-day-panel-holiday { font-size: 13px; color: #b3261e; margin-bottom: 6px; }
.ec-day-panel-list { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.9; }
.ec-day-panel-empty { margin: 0; font-size: 13px; color: #888; }

.ec-source-note { font-size: 11px; color: #999; padding: 0 2px; margin: 0; }

@media (max-width: 600px) {
    .events-calendar-card { padding: 14px; }
    .ec-calendar { max-width: 100%; }
    .ec-side { max-width: 100%; }
}

/* فوتر */
.site-footer {
    background: #0d2b21;
    color: #cbd5d1;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
}
.site-footer a { color: #9fd8c5; }

/* پنل مدیریت */
.admin-body { background: #f1f2f5; }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 230px;
    background: #17332a;
    color: #fff;
    flex-shrink: 0;
}
.admin-sidebar .brand { padding: 20px; font-weight: bold; border-bottom: 1px solid #244438; }
.admin-sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: #d6e6e0;
    font-size: 14px;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: #244438; color: #fff; }
.admin-sidebar nav form { margin: 0; }
.admin-nav-button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    border: 0;
    background: transparent;
    color: #cbd5d1;
    font: inherit;
    text-align: right;
    cursor: pointer;
}
.admin-nav-button:hover { background: #244438; color: #fff; }
.link-button { border: 0; padding: 0; background: transparent; color: #0d5c46; font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.floating-cat-btn.active { background: #0d5c46; border-color: #0d5c46; color: #fff; }
.admin-sidebar nav .nav-group-label {
    padding: 14px 20px 4px;
    font-size: 11px;
    color: #7fa596;
    letter-spacing: .3px;
    border-top: 1px solid #244438;
    margin-top: 6px;
}
.admin-sidebar nav .nav-group-label:first-child { border-top: none; margin-top: 0; }
.admin-main { flex: 1; padding: 24px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid #eee; font-size: 14px; text-align: right; }
.admin-table th { background: #f5f5f5; }
.admin-card { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; }

/* نوار ابزار جدول‌های پنل مدیریت: تعداد ردیف در صفحه + بازگرداندن ترتیب + صفحه‌بندی */
.admin-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 14px; color: #555; }
.admin-table-toolbar.admin-table-toolbar-bottom { margin-bottom: 0; margin-top: 14px; }
.admin-table-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-table-pagesize-label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.admin-table-pagesize { padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; font-size: 14px; background: #fff; }
.admin-table-reset-sort { background: #888; padding: 6px 12px; font-size: 14px; border-radius: 4px; }
.admin-table-reset-sort:hover { background: #6f6f6f; }
.admin-table-reset-sort:disabled { opacity: .45; cursor: default; background: #888; }
.admin-table-toolbar .pagination { margin-top: 0; }
.admin-table-page-info { white-space: nowrap; font-size: 13px; color: #777; }

.admin-table th.sortable-col { cursor: pointer; user-select: none; }
.admin-table th.sortable-col:hover { background: #ececec; }
.admin-table th .sort-indicator { display: inline-block; margin-inline-start: 5px; font-size: 11px; opacity: .4; }
.admin-table th.sort-active { color: #0d5c46; }
.admin-table th.sort-active .sort-indicator { opacity: 1; }
.events-table-wrap .admin-table th.sortable-col:hover { background: #0a4736; }
.events-table-wrap .admin-table th.sort-active { color: #ffd166; }

@media (max-width: 600px) {
    .admin-table-toolbar { flex-direction: column; align-items: flex-start; }
}
.login-box { max-width: 380px; margin: 80px auto; background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.login-box h1 { text-align: center; margin-bottom: 20px; font-size: 20px; }

@media (max-width: 768px) {
    .admin-wrapper { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-main { padding: 14px; }
    /* روی نمایشگرهای کوچک، جدول‌های پنل مدیریت به‌جای خراب‌شدن چیدمان، به‌صورت افقی اسکرول می‌شوند */
    .admin-card > table.admin-table,
    .admin-card > div > table.admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}
