
/*
 * MHADAD Repost Styles
 * توسعه و ساخت معراج حداد
 * MHADAD.IR
 */

/* =========================
   تنظیمات پایه
========================= */

#reposts-panel {
    width: 100%;
    box-sizing: border-box;
}

#reposts-panel *,
.mhadad-repost-viewer,
.mhadad-repost-viewer * {
    box-sizing: border-box;
}

#reposts-panel[hidden] {
    display: none !important;
}

#reposts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
    margin: 0;
    padding: 18px 0;
    direction: rtl;
    align-items: start;
}

/* =========================
   کارت ریپست
========================= */

.mhadad-repost-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 16px;
    background: var(--repost-card-bg, #fff);
    color: var(--repost-text, #222);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.055);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.mhadad-repost-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.11);
    border-color: rgba(100, 116, 139, 0.4);
}

/* =========================
   پوستر ویدیو
========================= */

.mhadad-repost-poster {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #111827;
    cursor: pointer;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
}

.mhadad-repost-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

.mhadad-repost-poster:hover img {
    transform: scale(1.045);
    filter: brightness(0.82);
}

.mhadad-repost-poster:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: -3px;
}

/* =========================
   دکمه پخش
========================= */

.mhadad-repost-play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0;
    pointer-events: none;
}

.mhadad-repost-play::before {
    content: "";
    display: block;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.68);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(5px);
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.mhadad-repost-play::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 16px solid #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.mhadad-repost-poster:hover .mhadad-repost-play::before {
    transform: scale(1.1);
    background: rgba(37, 99, 235, 0.9);
}

/* =========================
   عنوان و توضیحات
========================= */

.mhadad-repost-info {
    padding: 14px 16px 17px;
    text-align: right;
    direction: rtl;
}

.mhadad-repost-info h3 {
    margin: 0 0 7px;
    color: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.mhadad-repost-info p {
    margin: 0;
    color: var(--repost-muted, #6b7280);
    font-size: 13px;
    font-weight: 400;
    line-height: 2;
    overflow-wrap: anywhere;
}

/* =========================
   تب‌ها
   فقط ظاهر تب‌های ریپست و گالری
========================= */

#tab-reposts,
#tab-gallery {
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

#tab-reposts:focus-visible,
#tab-gallery:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 3px;
}

/* =========================
   پنجره پخش ویدیو
========================= */

.mhadad-repost-viewer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    font-family: inherit;
}

.mhadad-repost-viewer[hidden] {
    display: none !important;
}

.mhadad-repost-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mhadad-repost-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: 94vh;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: #111827;
    color: #fff;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
    animation: mhadad-repost-appear 0.2s ease-out;
}

@keyframes mhadad-repost-appear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* نوار بالای پلیر */

.mhadad-repost-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 10px 16px;
    direction: rtl;
    background: #111827;
}

.mhadad-repost-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

/* دکمه بستن */

.mhadad-repost-close {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0 0 3px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.mhadad-repost-close:hover {
    transform: rotate(90deg);
    background: #dc2626;
}

.mhadad-repost-close:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

/* ناحیه پخش */

.mhadad-repost-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.mhadad-repost-player iframe,
.mhadad-repost-player video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
}

.mhadad-repost-player video {
    object-fit: contain;
}

/* پیام جایگزین برای سایت‌هایی که Embed ندارند */

.mhadad-repost-player-message {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 200px;
    padding: 28px;
    color: #e5e7eb;
    font-family: inherit;
    font-size: 14px;
    line-height: 2.2;
    text-align: center;
    direction: rtl;
}

.mhadad-repost-player-message a {
    display: inline-block;
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
}

.mhadad-repost-player-message a:hover {
    color: #bfdbfe;
}

/* =========================
   حالت تیره
   پشتیبانی از چند روش متداول
========================= */

html.dark #reposts-panel,
body.dark #reposts-panel,
html[data-theme="dark"] #reposts-panel,
body[data-theme="dark"] #reposts-panel,
html.dark-mode #reposts-panel,
body.dark-mode #reposts-panel {
    --repost-card-bg: #1f2937;
    --repost-text: #f3f4f6;
    --repost-muted: #cbd5e1;
}

html.dark .mhadad-repost-card,
body.dark .mhadad-repost-card,
html[data-theme="dark"] .mhadad-repost-card,
body[data-theme="dark"] .mhadad-repost-card,
html.dark-mode .mhadad-repost-card,
body.dark-mode .mhadad-repost-card {
    border-color: rgba(255, 255, 255, 0.1);
}

/* =========================
   تبلت
========================= */

@media (max-width: 900px) {
    #reposts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .mhadad-repost-info {
        padding: 12px 13px 15px;
    }
}

/* =========================
   موبایل
========================= */

@media (max-width: 560px) {
    #reposts {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 12px 0;
    }

    .mhadad-repost-card {
        border-radius: 13px;
    }

    .mhadad-repost-info {
        padding: 12px 14px 15px;
    }

    .mhadad-repost-info h3 {
        font-size: 15px;
    }

    .mhadad-repost-info p {
        font-size: 13px;
    }

    .mhadad-repost-play::before {
        width: 54px;
        height: 54px;
    }

    .mhadad-repost-play::after {
        border-top-width: 9px;
        border-bottom-width: 9px;
        border-left-width: 14px;
    }

    .mhadad-repost-viewer {
        padding: 8px;
    }

    .mhadad-repost-dialog {
        width: 100%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .mhadad-repost-header {
        min-height: 50px;
        padding: 7px 10px;
        gap: 8px;
    }

    .mhadad-repost-title {
        font-size: 14px;
    }

    .mhadad-repost-close {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        font-size: 25px;
    }

    .mhadad-repost-player {
        aspect-ratio: 16 / 9;
    }

    .mhadad-repost-player-message {
        min-height: 170px;
        padding: 18px;
        font-size: 13px;
    }
}

/* احترام به تنظیم کاهش حرکت سیستم‌عامل */

@media (prefers-reduced-motion: reduce) {
    .mhadad-repost-card,
    .mhadad-repost-poster img,
    .mhadad-repost-play::before,
    .mhadad-repost-close {
        transition: none !important;
    }

    .mhadad-repost-dialog {
        animation: none !important;
    }
}

/* ======================================
   MHADAD Repost — Compact UI Fix
   اصلاح اندازه پوسترها و دکمه‌ها
====================================== */

/* اندازه و چیدمان کارت‌های ریپست */
#reposts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 0;
    align-items: start;
}

/* کارت کوچک‌تر و مرتب‌تر */
#reposts .mhadad-repost-card {
    width: 100%;
    min-width: 0;
    border-radius: 10px;
    box-shadow: 0 2px 9px rgba(0, 0, 0, .06);
    transform: none;
}

/* جلوگیری از بزرگ شدن کارت هنگام هاور */
#reposts .mhadad-repost-card:hover {
    transform: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
}

/* پوستر کوچک‌تر */
#reposts .mhadad-repost-poster {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 145px;
    border-radius: 0;
}

/* تصویر داخل پوستر */
#reposts .mhadad-repost-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* دکمه پخش کوچک‌تر */
#reposts .mhadad-repost-play::before {
    width: 38px;
    height: 38px;
}

#reposts .mhadad-repost-play::after {
    margin-left: 3px;
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-left-width: 11px;
}

/* عنوان و توضیحات فشرده‌تر */
#reposts .mhadad-repost-info {
    padding: 8px 10px 10px;
}

#reposts .mhadad-repost-info h3 {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.8;
}

#reposts .mhadad-repost-info p {
    font-size: 11px;
    line-height: 1.8;
}

/* دکمه‌های تب گالری و ریپست */
#tab-gallery,
#tab-reposts {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

/* تب انتخاب‌شده */
#tab-gallery.active,
#tab-reposts.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

/* حالت تیره تب‌ها */
html.dark #tab-gallery,
html.dark #tab-reposts,
body.dark #tab-gallery,
body.dark #tab-reposts,
html[data-theme="dark"] #tab-gallery,
html[data-theme="dark"] #tab-reposts,
body[data-theme="dark"] #tab-gallery,
body[data-theme="dark"] #tab-reposts {
    border-color: #374151;
    background: #1f2937;
    color: #e5e7eb;
}

html.dark #tab-gallery.active,
html.dark #tab-reposts.active,
body.dark #tab-gallery.active,
body.dark #tab-reposts.active,
html[data-theme="dark"] #tab-gallery.active,
html[data-theme="dark"] #tab-reposts.active,
body[data-theme="dark"] #tab-gallery.active,
body[data-theme="dark"] #tab-reposts.active {
    border-color: #3b82f6;
    background: #2563eb;
    color: #fff;
}

/* تبلت */
@media (max-width: 900px) {
    #reposts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    #reposts .mhadad-repost-poster {
        max-height: 125px;
    }
}

/* موبایل */
@media (max-width: 600px) {
    #reposts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    #reposts .mhadad-repost-poster {
        max-height: 110px;
    }

    #reposts .mhadad-repost-info {
        padding: 7px 8px;
    }

    #reposts .mhadad-repost-info h3 {
        font-size: 12px;
    }

    #reposts .mhadad-repost-info p {
        font-size: 10px;
    }

    #reposts .mhadad-repost-play::before {
        width: 32px;
        height: 32px;
    }

    #reposts .mhadad-repost-play::after {
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
    }

    #tab-gallery,
    #tab-reposts {
        min-height: 31px;
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* =========================================
   MHADAD Repost — Professional Square Cards
   سه ستون در دسکتاپ، تبلت و موبایل
========================================= */

#reposts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 14px 0;
    align-items: start;
    direction: rtl;
}

/* کارت ریپست */
#reposts .mhadad-repost-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 13px;
    background: var(--repost-card-bg, #fff);
    color: var(--repost-text, #222);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#reposts .mhadad-repost-card:hover {
    transform: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    border-color: rgba(100, 116, 139, 0.4);
}

/* پوستر کاملاً مربع */
#reposts .mhadad-repost-poster {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #111827;
    cursor: pointer;
    isolation: isolate;
}

#reposts .mhadad-repost-poster img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease, filter 0.3s ease;
}

#reposts .mhadad-repost-poster:hover img {
    transform: scale(1.035);
    filter: brightness(0.88);
}

/* دکمه پخش */
#reposts .mhadad-repost-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#reposts .mhadad-repost-play::before {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, transform 0.2s ease;
}

#reposts .mhadad-repost-play::after {
    margin-left: 3px;
    border-top-width: 8px;
    border-bottom-width: 8px;
    border-left-width: 12px;
}

#reposts .mhadad-repost-poster:hover .mhadad-repost-play::before {
    background: rgba(37, 99, 235, 0.9);
    transform: scale(1.08);
}

/* بخش توضیحات زیر پوستر */
#reposts .mhadad-repost-info {
    display: block !important;
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 11px 12px;
    text-align: right;
    direction: rtl;
    overflow-wrap: anywhere;
}

#reposts .mhadad-repost-info h3 {
    display: -webkit-box;
    margin: 0 0 5px;
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.9;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

#reposts .mhadad-repost-info p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--repost-muted, #6b7280);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.9;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* حالت تیره */
html.dark #reposts-panel,
body.dark #reposts-panel,
html[data-theme="dark"] #reposts-panel,
body[data-theme="dark"] #reposts-panel,
html.dark-mode #reposts-panel,
body.dark-mode #reposts-panel {
    --repost-card-bg: #1f2937;
    --repost-text: #f3f4f6;
    --repost-muted: #cbd5e1;
}

html.dark #reposts .mhadad-repost-card,
body.dark #reposts .mhadad-repost-card,
html[data-theme="dark"] #reposts .mhadad-repost-card,
body[data-theme="dark"] #reposts .mhadad-repost-card {
    border-color: rgba(255, 255, 255, 0.1);
}

/* موبایل: همچنان سه ستون */
@media (max-width: 600px) {
    #reposts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 0;
    }

    #reposts .mhadad-repost-card {
        border-radius: 9px;
    }

    #reposts .mhadad-repost-info {
        padding: 7px 7px 9px;
    }

    #reposts .mhadad-repost-info h3 {
        margin-bottom: 3px;
        font-size: 11px;
        line-height: 1.7;
    }

    #reposts .mhadad-repost-info p {
        font-size: 10px;
        line-height: 1.7;
        -webkit-line-clamp: 3;
    }

    #reposts .mhadad-repost-play::before {
        width: 30px;
        height: 30px;
    }

    #reposts .mhadad-repost-play::after {
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
    }
}

/* موبایل خیلی باریک */
@media (max-width: 360px) {
    #reposts {
        gap: 6px;
    }

    #reposts .mhadad-repost-info {
        padding: 6px;
    }

    #reposts .mhadad-repost-info h3 {
        font-size: 10px;
    }

    #reposts .mhadad-repost-info p {
        font-size: 9px;
    }
}

/* رعایت تنظیم کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
    #reposts .mhadad-repost-card,
    #reposts .mhadad-repost-poster img,
    #reposts .mhadad-repost-play::before {
        transition: none !important;
    }
}














/* ==========================================
   MHADAD.IR — Professional Photo / Repost Tabs
   توسعه و ساخت معراج حداد
========================================== */

/* چیدمان دکمه‌های عکس و ریپست */
#tab-gallery,
#tab-reposts {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 118px;
    min-height: 46px;
    padding: 10px 20px;
    margin: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f5f7fb);
    color: #334155;
    font-family: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.5;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
    transition:
        background 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

/* آیکون‌های داخل دکمه‌ها، در صورت وجود */
#tab-gallery svg,
#tab-reposts svg,
#tab-gallery .icon,
#tab-reposts .icon {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

/* هاور */
#tab-gallery:hover,
#tab-reposts:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 7px 18px rgba(37, 99, 235, 0.12);
}

/* دکمه عکس در حالت انتخاب‌شده */
#tab-gallery.active,
#tab-gallery[aria-selected="true"],
#tab-gallery[aria-pressed="true"] {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #fff;
    box-shadow: 0 5px 16px rgba(2, 132, 199, 0.25);
}

/* دکمه ریپست در حالت انتخاب‌شده */
#tab-reposts.active,
#tab-reposts[aria-selected="true"],
#tab-reposts[aria-pressed="true"] {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    box-shadow: 0 5px 16px rgba(124, 58, 237, 0.25);
}

/* هاور روی دکمه فعال */
#tab-gallery.active:hover,
#tab-gallery[aria-selected="true"]:hover,
#tab-reposts.active:hover,
#tab-reposts[aria-selected="true"]:hover {
    filter: brightness(1.06);
}

/* فوکوس با صفحه‌کلید */
#tab-gallery:focus-visible,
#tab-reposts:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.4);
    outline-offset: 3px;
}

/* حالت تاریک */
html.dark #tab-gallery,
html.dark #tab-reposts,
body.dark #tab-gallery,
body.dark #tab-reposts,
html.dark-mode #tab-gallery,
html.dark-mode #tab-reposts,
body.dark-mode #tab-gallery,
body.dark-mode #tab-reposts,
html[data-theme="dark"] #tab-gallery,
html[data-theme="dark"] #tab-reposts,
body[data-theme="dark"] #tab-gallery,
body[data-theme="dark"] #tab-reposts {
    border-color: #374151;
    background: linear-gradient(145deg, #1f2937, #111827);
    color: #e5e7eb;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* رنگ فعال در حالت تاریک */
html.dark #tab-gallery.active,
body.dark #tab-gallery.active,
html.dark-mode #tab-gallery.active,
body.dark-mode #tab-gallery.active,
html[data-theme="dark"] #tab-gallery.active,
body[data-theme="dark"] #tab-gallery.active,
#tab-gallery[aria-selected="true"] {
    border-color: #38bdf8;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #fff;
}

html.dark #tab-reposts.active,
body.dark #tab-reposts.active,
html.dark-mode #tab-reposts.active,
body.dark-mode #tab-reposts.active,
html[data-theme="dark"] #tab-reposts.active,
body[data-theme="dark"] #tab-reposts.active,
#tab-reposts[aria-selected="true"] {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
}

/* موبایل */
@media (max-width: 600px) {
    #tab-gallery,
    #tab-reposts {
        min-width: 0;
        min-height: 42px;
        padding: 9px 15px;
        gap: 7px;
        margin: 3px;
        border-radius: 12px;
        font-size: 13px;
    }

    #tab-gallery svg,
    #tab-reposts svg,
    #tab-gallery .icon,
    #tab-reposts .icon {
        width: 17px;
        height: 17px;
    }
}

/* کاهش انیمیشن طبق تنظیم دستگاه */
@media (prefers-reduced-motion: reduce) {
    #tab-gallery,
    #tab-reposts {
        transition: none;
    }

    #tab-gallery:hover,
    #tab-reposts:hover {
        transform: none;
    }
}



/* تبلیغ اختصاصی MHADAD.IR داخل پنجره پخش فیلم */
.mhadad-player-ad {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    direction: rtl;
    text-align: right;
    color: #f8fafc;
    background: linear-gradient(110deg, #172554, #312e81, #1e293b);
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.mhadad-player-ad__icon {
    display: flex;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    font-size: 22px;
}

.mhadad-player-ad__info {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.mhadad-player-ad__title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.8;
    color: #fff;
}

.mhadad-player-ad__domain {
    direction: ltr;
    text-align: right;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
}

.mhadad-player-ad__link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 9px;
    background: #fff;
    color: #1d4ed8 !important;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .2s ease, transform .2s ease;
}

.mhadad-player-ad__link:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.mhadad-player-ad__link:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

@media (max-width: 420px) {
    .mhadad-player-ad {
        gap: 8px;
        padding: 11px 9px;
    }

    .mhadad-player-ad__icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .mhadad-player-ad__title {
        font-size: 11px;
    }

    .mhadad-player-ad__link {
        padding: 8px;
        font-size: 10px;
    }
}