/* =========================================
   استایل اختصاصی صفحه آموزش (Split Screen)
========================================= */

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* جلوگیری از اسکرول کل صفحه، فقط پنل‌ها اسکرول میشوند */
    font-family: "Vazirmatn", sans-serif;
    background-color: #050a15;
}

.split-wrapper {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    direction: rtl;
    /* راست به چپ: پنل اول در کد سمت راست قرار میگیرد */
    background: linear-gradient(180deg, #38bdf8, #fbbf24);
    /* خط نئونی مورب آبی به زرد */
}

/* =========================================
   استایل پایه پنل‌ها و برش مورب (Clip-path)
========================================= */
.pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    transition: clip-path 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

.pane::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
}

.pane.hardware {
    background: linear-gradient(135deg, #452b00, #1a1000);
    /* پس زمینه تیره زرد/طلایی */
    clip-path: polygon(calc(55% + 2px) 0, 100% 0, 100% 100%, calc(45% + 2px) 100%);
    z-index: 1;
}

.pane.software {
    background: linear-gradient(135deg, #082f49, #020617);
    /* پس زمینه تیره آبی کم‌رنگ */
    clip-path: polygon(0 0, calc(55% - 2px) 0, calc(45% - 2px) 100%, 0 100%);
    z-index: 1;
}

/* Active and Inactive Clip-paths */
.pane.hardware.active {
    clip-path: polygon(calc(15% + 2px) 0, 100% 0, 100% 100%, calc(5% + 2px) 100%);
    z-index: 2;
    cursor: default;
}

.pane.software.inactive {
    clip-path: polygon(0 0, calc(15% - 2px) 0, calc(5% - 2px) 100%, 0 100%);
    cursor: pointer;
}

.pane.software.active {
    clip-path: polygon(0 0, calc(95% - 2px) 0, calc(85% - 2px) 100%, 0 100%);
    z-index: 2;
    cursor: default;
}

.pane.hardware.inactive {
    clip-path: polygon(calc(95% + 2px) 0, 100% 0, 100% 100%, calc(85% + 2px) 100%);
    cursor: pointer;
}

/* =========================================
   محتوای داخلی پنل‌ها برای مرکزچین شدن صحیح
========================================= */
.pane-inner {
    position: absolute;
    top: 0;
    height: 100vh;
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s;
    display: flex;
    flex-direction: column;
}

.pane.hardware .pane-inner {
    right: 0;
    width: 50vw;
}

.pane.software .pane-inner {
    left: 0;
    width: 50vw;
}

.pane.hardware.active .pane-inner {
    width: 90vw;
}

.pane.hardware.inactive .pane-inner {
    width: 10vw;
    opacity: 1;
    pointer-events: none;
}

.pane.software.active .pane-inner {
    width: 90vw;
}

.pane.software.inactive .pane-inner {
    width: 10vw;
    opacity: 1;
    pointer-events: none;
}

/* =========================================
   لوگوی متحرک وسط صفحه
========================================= */
.center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: #050a15;
    border: 3px solid #fbbf24;
    border-radius: 50%;
    padding: 15px;
    z-index: 10;
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.6), inset 0 0 15px rgba(251, 191, 36, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.center-logo:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.8), inset 0 0 20px rgba(251, 191, 36, 0.5);
}

.split-wrapper.hardware-active .center-logo {
    top: 50px;
    left: calc(100% - 70px);
    transform: translate(-50%, -50%) scale(0.6);
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.split-wrapper.software-active .center-logo {
    top: 50px;
    left: 70px;
    transform: translate(-50%, -50%) scale(0.6);
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

/* =========================================
   عناوین بزرگ پنل‌ها
========================================= */
.pane-title-center {
    position: absolute;
    top: 50%;
    font-size: 3.5rem;
    font-weight: 900;
    z-index: 2;
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 2px;
}

.pane.hardware .pane-title-center {
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(to bottom right, #fde047, #f59e0b);
    /* گرادیانت زرد */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 5px 15px rgba(251, 191, 36, 0.4));
}

.pane.software .pane-title-center {
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(to bottom right, #bae6fd, #0ea5e9);
    /* گرادیانت آبی */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 5px 15px rgba(56, 189, 248, 0.4));
}

.pane:hover .pane-title-center {
    transform: translate(-50%, -50%) scale(1.05);
}

/* جابجایی عنوان در حالت اکتیو */
.pane.hardware.active .pane-title-center {
    top: 40px;
    left: 50%;
    font-size: 1.8rem;
    transform: translate(-50%, 0);
    letter-spacing: 0px;
}

.pane.software.active .pane-title-center {
    top: 40px;
    left: 50%;
    font-size: 1.8rem;
    transform: translate(-50%, 0);
    letter-spacing: 0px;
}

/* جابجایی عنوان در حالت ایناکتیو */
.pane.hardware.inactive .pane-title-center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: 2.5rem;
    letter-spacing: 5px;
    opacity: 0.6;
}

.pane.software.inactive .pane-title-center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: 2.5rem;
    letter-spacing: 5px;
    opacity: 0.6;
}

/* محتوای داخلی پنل‌ها */
.pane-content {
    position: relative;
    z-index: 3;
    margin-top: 85px;
    padding: 15px 40px 60px;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s ease;
    overflow-y: auto;
    height: calc(100vh - 85px);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pane-content::-webkit-scrollbar {
    display: none;
}

.pane.active .pane-content {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.3s;
    /* صبر برای باز شدن پنل */
}

/* دکمه بستن / بازگشت */
.close-pane-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    display: none;
    /* 🔴 مخفی کردن قطعی ضربدر در حالت دسکتاپ */
}

.hardware .close-pane-btn {
    left: 40px;
    top: 40px;
}

.software .close-pane-btn {
    right: 40px;
    top: 40px;
}

.close-pane-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: rotate(90deg);
}

.pane.active .close-pane-btn {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.3s;
}

/* =========================================
   محتوای بخش نرم‌افزار (سمت چپ)
========================================= */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.sw-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    cursor: pointer;
}

.sw-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.15);
}

.sw-card i {
    font-size: 2rem;
    color: #38bdf8;
    margin-bottom: 15px;
}

.sw-card h3 {
    color: #fff;
    margin: 0 0 10px 0;
}

.sw-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 0;
}

/* =========================================
   محتوای بخش سخت‌افزار (سمت راست)
========================================= */
.hw-container {
    max-width: 900px;
    margin: 0 auto;
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.hw-card {
    background: rgba(69, 43, 0, 0.4);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

.hw-card:hover {
    transform: translateY(-5px);
    border-color: #fbbf24;
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.15);
}

.hw-card i {
    font-size: 2rem;
    color: #fbbf24;
    margin-bottom: 15px;
}

.hw-card h3 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.hw-card p {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 0;
}

.boards-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 280px));
    gap: 20px;
    margin: 0 auto 30px;
    justify-content: center;
    max-width: 600px;
}

.board-btn {
    background: rgba(69, 43, 0, 0.6);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fff;
    padding: 18px 25px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.board-btn i {
    font-size: 1.8rem;
    color: #fbbf24;
}

.board-btn:hover:not(.disabled) {
    background: rgba(251, 191, 36, 0.2);
    border-color: #fbbf24;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.2);
}

.board-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

/* بخش نمایش کد */
.code-viewer {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.code-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.code-header {
    background: #1e293b;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.code-header span {
    color: #94a3b8;
    font-family: monospace;
    font-size: 0.9rem;
}

.copy-btn {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 6px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: 0.3s;
}

.copy-btn:hover {
    background: #fbbf24;
    color: #111;
}

.code-box pre {
    margin: 0;
    padding: 20px;
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
    line-height: 1.5;
}

/* هایلایت ساده برای کد */
.keyword {
    color: #f43f5e;
}

.string {
    color: #fbbf24;
}

.comment {
    color: #64748b;
    font-style: italic;
}

.func {
    color: #38bdf8;
}

/* توضیحات خط به خط */
.explain-section {
    margin-bottom: 40px;
}

.explain-step {
    background: rgba(255, 255, 255, 0.02);
    border-right: 4px solid #fbbf24;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.explain-step h4 {
    color: #fbbf24;
    margin: 0 0 10px 0;
}

.explain-step p {
    color: #cbd5e1;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
}

@media (max-width: 768px) {

    /* 🔴 بازنویسی کامل موبایل: حذف برش‌های مورب و تبدیل به حالت اپلیکیشن (Full Screen) */
    .pane.hardware,
    .pane.software,
    .pane.hardware.active,
    .pane.software.inactive,
    .pane.software.active,
    .pane.hardware.inactive {
        clip-path: none !important;
    }

    /* حالت اولیه: دو نیمه مساوی بالا و پایین با خط صاف */
    .pane {
        width: 100vw;
        transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .pane.software {
        top: 0;
        height: 50vh;
        border-bottom: 2px solid rgba(56, 189, 248, 0.5);
    }

    .pane.hardware {
        top: 50vh;
        height: 50vh;
        border-top: 2px solid rgba(251, 191, 36, 0.5);
    }

    .pane-inner {
        width: 100vw !important;
        height: 100% !important;
        left: 0 !important;
        right: 0 !important;
        justify-content: center;
        align-items: center;
        top: 0 !important;
        bottom: auto !important;
    }

    /* متن‌ها در حالت اولیه (وسط‌چین کامل) */
    .pane.software .pane-title-center,
    .pane.hardware .pane-title-center {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 1.6rem;
        letter-spacing: 0;
        opacity: 1 !important;
    }

    /* 🔴 حالت فعال: فول اسکرین (۱۰۰٪ ارتفاع) */
    .pane.active {
        top: 0 !important;
        height: 100vh !important;
        z-index: 20;
        border: none;
    }

    /* حالت غیرفعال: مخفی کامل در پس‌زمینه */
    .pane.inactive {
        height: 0 !important;
        opacity: 0;
        pointer-events: none;
    }

    /* متن در حالت فعال (منتقل به بالای صفحه) */
    .pane.software.active .pane-title-center,
    .pane.hardware.active .pane-title-center {
        top: 25px;
        left: 50%;
        transform: translate(-50%, 0);
        font-size: 1.3rem;
        white-space: nowrap;
    }

    /* مخفی کردن لوگوی وسط در هنگام باز شدن پنل‌ها */
    .center-logo {
        width: 65px;
        height: 65px;
        padding: 10px;
        z-index: 30;
    }

    .split-wrapper.hardware-active .center-logo,
    .split-wrapper.software-active .center-logo {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
        pointer-events: none;
    }

    /* دکمه‌های بستن و بازگشت (در جایگاه استاندارد هدرها) */
    .hardware .close-pane-btn,
    .software .close-pane-btn {
        top: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        z-index: 40;
        background: rgba(255, 255, 255, 0.15);
        display: block;
        /* 🔴 نمایش مجدد ضربدر در حالت موبایل */
    }

    .hardware .close-pane-btn {
        left: 15px;
        right: auto;
    }

    .software .close-pane-btn {
        right: 15px;
        left: auto;
    }

    /* 🔴 فضای محتوا (بهینه‌سازی کامل برای فول اسکرین) */
    .pane-content {
        padding: 10px 15px 30px;
        margin-top: 70px;
        height: calc(100vh - 70px);
        width: 100%;
        box-sizing: border-box;
    }

    .sw-card {
        padding: 15px;
    }

    .sw-card i {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .sw-card h3 {
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .sw-card p {
        font-size: 0.8rem;
        line-height: 1.6;
    }

    #sw-detail-content {
        padding: 15px !important;
        font-size: 0.85rem !important;
        line-height: 1.8 !important;
    }

    #sw-detail-content h3 {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
    }

    .documentation-section>div {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }

    .documentation-section h3 {
        font-size: 1.1rem !important;
        margin-bottom: 10px !important;
    }

    .documentation-section h4 {
        font-size: 0.95rem !important;
        margin-bottom: 10px !important;
    }

    .documentation-section p,
    .documentation-section ul,
    .documentation-section li {
        font-size: 0.85rem !important;
        line-height: 1.7 !important;
    }

    .documentation-section div[style*="border-right"] {
        padding: 10px 15px 10px 0 !important;
        margin-bottom: 15px !important;
    }

    .code-box {
        margin-bottom: 20px;
    }

    .code-box pre {
        padding: 12px;
        font-size: 0.75rem;
    }

    .code-header {
        padding: 10px 15px;
    }

    .code-header span {
        font-size: 0.8rem;
    }

    .copy-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .boards-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 340px;
        margin: 0 auto 30px;
        align-items: center;
    }

    .board-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }

    .board-btn i {
        font-size: 1.2rem !important;
    }

    /* سوئیچر تب‌های دستگاه A و B در موبایل */
    .bridge-tabs {
        gap: 8px !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        width: 100% !important;
    }

    .bridge-tabs .board-btn {
        width: 50% !important;
        /* به صورت دو ستونه در کنار هم قرار گیرند */
        font-size: 0.8rem !important;
        padding: 10px 5px !important;
        gap: 6px !important;
        flex-direction: row !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    .bridge-tabs .board-btn i {
        font-size: 0.95rem !important;
    }

    .explain-step {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .explain-step h4 {
        font-size: 0.95rem !important;
        margin-bottom: 5px !important;
    }

    .explain-step p {
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
    }

    /* 🔴 رفع بیرون‌زدگی افقی در جدول تاپیک‌های MQTT */
    table th,
    table td {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
    }

    table th {
        white-space: normal !important;
    }

    table td:nth-child(3) {
        font-size: 0.7rem !important;
        word-break: break-all;
        white-space: normal !important;
    }

}

/* =========================================
   استایل‌های اختصاصی بخش جزئیات وب‌سایت (تب شخصی‌سازی)
   ========================================= */
.sw-detail-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
    direction: rtl;
}

.sw-detail-image-wrapper {
    flex: 1;
    min-width: 260px;
    max-width: 320px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 3px solid rgba(56, 189, 248, 0.25);
    background: rgba(15, 23, 42, 0.4);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 25px rgba(56,189,248,0.1);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.sw-detail-image-wrapper img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.sw-detail-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(56,189,248,0.1), transparent 60%);
    pointer-events: none;
}

.sw-detail-image-wrapper:hover {
    transform: translateY(-8px);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 35px rgba(56,189,248,0.25);
}

.sw-detail-image-wrapper:hover img {
    transform: scale(1.04);
}

.sw-detail-text {
    flex: 1.6;
    min-width: 290px;
}

.sw-detail-step {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.sw-detail-step:hover {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(56, 189, 248, 0.2);
    transform: translateX(-4px);
}

.sw-detail-step h4 {
    color: #fbbf24;
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sw-detail-step p {
    color: #cbd5e1;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.75;
}

@media (max-width: 768px) {
    .sw-detail-container {
        flex-direction: column-reverse;
        gap: 20px;
    }
    .sw-detail-image-wrapper {
        max-width: 240px;
    }
    .sw-detail-step:hover {
        transform: none;
    }
}

/* =========================================
   لایت‌باکس بزرگ‌نمایی تصاویر راهنما
   ========================================= */
.lightbox {
    display: none; 
    position: fixed; 
    z-index: 999999; 
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(5, 8, 20, 0.95); 
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 16px;
    border: 2px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; } 
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #f8fafc;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1000000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #38bdf8;
    text-decoration: none;
    cursor: pointer;
}

/* تغییر مکان‌نما در حالت بزرگ‌نمایی تصویر */
.sw-detail-image-wrapper {
    cursor: zoom-in;
}

/* اسکرول‌بار اختصاصی و ارتفاع بخش جزئیات فقط برای دسکتاپ */
@media (min-width: 769px) {
    #sw-detail-content {
        max-height: calc(100vh - 220px);
        overflow-y: auto;
        padding-left: 10px;
        direction: ltr; /* قرارگیری اسکرول‌بار در سمت چپ برای زیبایی بیشتر */
    }

    /* بازنشانی جهت متن به راست */
    #sw-detail-content > * {
        direction: rtl;
    }

    #sw-detail-content::-webkit-scrollbar {
        width: 6px;
    }
    #sw-detail-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.02);
        border-radius: 10px;
    }
    #sw-detail-content::-webkit-scrollbar-thumb {
        background: rgba(56, 189, 248, 0.35);
        border-radius: 10px;
        transition: background 0.3s;
    }
    #sw-detail-content::-webkit-scrollbar-thumb:hover {
        background: rgba(56, 189, 248, 0.65);
    }
}

/* بازنشانی وضعیت در موبایل جهت حذف اسکرول تو در تو */
@media (max-width: 768px) {
    #sw-detail-content {
        max-height: none !important;
        overflow-y: visible !important;
        direction: rtl !important;
        padding-left: 0 !important;
    }
    #sw-detail-content > * {
        direction: rtl !important;
    }
}