/* ===========================
   Global / Wrapper (سیال و واکنش‌گرا)
=========================== */
.teacher-list-wrap {
    display: flex;
    direction: rtl;
    width: 100%;
    max-width: 1296px;
    margin: 40px auto 0;
    padding: 0 15px;
    gap: 16px;
    font-family: iransans, sans-serif;
}

/* ===========================
   Thumbnail Swiper (هماهنگ با ارتفاع عکس استاد - دسکتاپ)
=========================== */
.teacher-swiper-thumb {
    width: 88px;
    flex-shrink: 0;
    height: 360px; /* اصلاح شده: برابر با ارتفاع عکس اصلی در دسکتاپ */
    margin-top: 86px;
    position: relative;
    overflow: hidden;
}


.teacher-swiper-thumb .swiper-wrapper {
    display: flex;
    flex-direction: column; /* چیدمان عمودی برای دسکتاپ و تبلت */
}

.teacher-swiper-thumb .swiper-slide {
    width: 88px !important;
    height: 81px !important; /* اصلاح شده: ارتفاع محاسبه شده برای دسکتاپ */
    margin-bottom: 12px !important; /* اصلاح شده: فاصله جدید */
    border-radius: 16px;
    overflow: hidden;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: none;
}

.teacher-swiper-thumb .swiper-slide-thumb-active {
    opacity: 1;
}

.teacher-swiper-thumb .swiper-slide img,
.teacher-swiper-thumb .swiper-slide img[data-lazyloaded] {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: 16px;
    border: 2px solid #fff;
}

/* ===========================
   Thumbnail Navigation Arrows
=========================== */
.teacher-swiper-next,
.teacher-swiper-prev {
    position: absolute;
    width: 27px;
    height: 81px; /* اصلاح شده: هم‌ارتفاع با آیتم‌های دسکتاپ */
    z-index: 999;
    color: #A96045;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.teacher-swiper-next {
    top: -27px;
    right: 30.5px; /* اصلاح شده: مرکز کردن دقیق فلش */
    transform: rotate(90deg) translateX(-13.5px);
}

.teacher-swiper-prev {
    bottom: -27px;
    right: 30.5px; /* اصلاح شده: مرکز کردن دقیق فلش */
    transform: rotate(90deg) translateX(13.5px);
}

.teacher-swiper-next.swiper-button-lock,
.teacher-swiper-prev.swiper-button-lock,
.teacher-swiper-next.swiper-button-disabled,
.teacher-swiper-prev.swiper-button-disabled {
    display: flex !important;
    opacity: 0.4;
    cursor: default;
}

/* ===========================
   Main Swiper & Teacher Card
=========================== */
.teacher-swiper {
    flex: 1;
    min-width: 0;
    padding-right: 16px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.teacher-swiper .swiper-wrapper,
.teacher-swiper .swiper-slide {
    height: auto;
}

.teacher-box {
    background: #fff;
    border-radius: 32px;
    width: calc(100% - 90px);
    margin: 0 90px 49px 0;
    padding: 48px 196px 48px 49px;
    position: relative;
    display: block !important;
    box-shadow: 0px 5px 25px rgba(79, 105, 139, .09);
    min-height: 398px;
}

.teacher-box > img,
.teacher-box > img[data-lazyloaded] {
    position: absolute;
    top: 86px;
    right: -90px;
    width: 310px !important;
    height: 360px !important; /* ارتفاع مرجع برای تامبنیل دسکتاپ */
    object-fit: cover !important;
    object-position: center !important;
    border: 6px solid #fff !important;
    border-radius: 24px !important;
    z-index: 1;
    display: block;
}

/* ===========================
   Inner Content Sections
=========================== */
.teacher-box-wrap {
    width: 100%;
    height: auto;
    padding-right: 47px;
    padding-left: 0;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
}

.teacher-box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    min-height: 83px;
    padding-bottom: 20px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(107, 114, 128, 0.2);
}

.teacher-box-info b {
    display: block;
    font-size: 24px;
    line-height: 24px;
    font-weight: 700;
    color: #A96045;
}

.teacher-box-info span {
    display: block;
    margin-top: 20px;
    font-size: 18px;
    line-height: 18px;
    font-weight: 500;
    color: #6b7280;
}

.teacher-box-btn-warp {
    display: flex;
    gap: 16px;
}

.teacher-box-btn-warp .btn {
    border-radius: 12px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.teacher-box-btn-warp .btn-warning {
    background: rgba(108, 132, 126, 0.25);
    color: #435C56;
    border: 1px solid #435C56;
    padding: 12px 24px;
    gap: 16px;
}

.teacher-box-body {
    height: auto;
    border: 0;
    border-top: 0 !important;
}

.teacher-box-body .title-shape {
    display: block;
    position: relative;
    margin-bottom: 20px;
    padding-right: 58px;
    font-size: 16px;
    line-height: 28px;
    font-weight: 500;
    color: #A96045;
}

.teacher-box-body .title-shape::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    border-radius: 999px;
    background: #A96045;
}

.teacher-box-body .text {
    font-size: 14px;
    line-height: 30px;
    color: #6b7280;
    text-align: right;
}

/* ===========================
   Responsive - Tablet & Mobile
=========================== */

/* --- تبلت و مانیتورهای کوچکتر (تا 1200 پیکسل) --- */
@media (max-width: 1200px) {
    .teacher-box {
        width: calc(100% - 60px);
        margin: 0 60px 49px 0;
        padding: 40px 140px 40px 30px;
    }

    .teacher-box > img,
    .teacher-box > img[data-lazyloaded] {
        right: -60px;
        top: 140px;
        width: 240px !important;
        height: 300px !important; /* ارتفاع مرجع برای تامبنیل تبلت */
    }

    /* هماهنگی تامبنیل با عکس 300 پیکسلی در تبلت */
    .teacher-swiper-thumb {
        height: 300px; /* اصلاح شده: برابر با ارتفاع عکس اصلی در تبلت */
        margin-top: 140px;
    }
    .teacher-swiper-thumb .swiper-slide {
        height: 66px !important; /* اصلاح شده: ارتفاع محاسبه شده برای تبلت */
        margin-bottom: 12px !important;
    }
    .teacher-swiper-next,
    .teacher-swiper-prev {
        height: 66px; /* اصلاح شده: هم‌ارتفاع با آیتم‌های تبلت */
    }
}


/* --- موبایل و تبلت عمودی (تا 991 پیکسل) - دیزاین کارت پروفایل --- */
@media (max-width: 991px) {
    .title-shape{
        display: none !important;
    }
    .teacher-list-wrap {
        flex-direction: column-reverse; /* تامبنیل‌ها در پایین */
        padding: 0 15px;
        gap: 30px;
    }

    /* تنظیمات تامبنیل افقی در موبایل */
    .teacher-swiper-thumb {
        width: 100%;
        height: 100px;
        margin-top: 0;
        padding: 0 40px; /* ایجاد فاصله برای فلش‌ها در چپ و راست */
    }
    .teacher-swiper-thumb .swiper-wrapper {
        flex-direction: row; /* اصلاح شده: جهت افقی برای موبایل */
    }
    .teacher-swiper-thumb .swiper-slide {
        width: 88px !important;
        height: 80px !important;
        margin-bottom: 0 !important; /* حذف فاصله عمودی */
        border-radius: 16px !important;
    }
    .teacher-swiper-thumb .swiper-slide img {
        border-radius: 16px !important;
    }

    .teacher-swiper-next,
    .teacher-swiper-prev {
        width: 30px;
        height: 100px;
        top: 0;
        transform: none; /* حذف چرخش 90 درجه */
    }
    .teacher-swiper-next { right: 0; }
    .teacher-swiper-prev { left: 0; bottom: auto; }

    /* طراحی کارت پروفایل باکس اصلی */
    .teacher-swiper {
        width: 100%;
        padding-right: 0;
        overflow: visible !important;
    }

    .teacher-box {
        width: 100%;
        margin: 80px 0 0 0;
        padding: 100px 20px 30px 20px;
        text-align: center;
    }

    .teacher-box > img,
    .teacher-box > img[data-lazyloaded] {
        top: -165px;
        right: 50%;
        transform: translateX(50%);
        width: 200px !important;
        height: 228px !important;
        border-radius: 24px !important;
        border-width: 4px !important;
    }

    /* تنظیم چیدمان داخلی برای حالت موبایل */
    .teacher-box-wrap { padding-right: 0; }
    .teacher-box-head {
        flex-direction: column;
        border-bottom: none;
        gap: 15px;
        padding-bottom: 10px;
    }
    .teacher-box-info { align-items: center; }
    .teacher-box-btn-warp { justify-content: left; margin-top: 10px;align-self: center }
    .teacher-box-body .title-shape { text-align: center; padding-right: 0; }
    .teacher-box-body .title-shape::before { display: none; }
    .teacher-box-body .text { text-align: center; }
}

.teacher-swiper-thumb .swiper-slide {
    margin-bottom: 12px !important;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0.4;
    cursor: pointer;
    filter: grayscale(100%);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 2px solid transparent;
    box-shadow: none;
}
.teacher-swiper-thumb .swiper-slide:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.teacher-swiper-thumb .swiper-slide-thumb-active {
    opacity: 1;
    filter: grayscale(0%);
    border-color: #A96045;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(169, 96, 69, 0.1);
}
.teacher-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 40px;
    width: calc(100% - 90px);
    margin: 0 90px 49px 0;
    padding: 50px 210px 50px 50px;
    position: relative;
    display: block !important;
    box-shadow: 0px 20px 50px rgba(0, 0, 0, 0.04);
    min-height: 400px;
    transition: box-shadow 0.4s ease;
}

.teacher-box:hover {
    box-shadow: 0px 25px 60px rgba(169, 96, 69, 0.08);
}
@keyframes floatImage {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}
.teacher-box > img,
.teacher-box > img[data-lazyloaded] {
    position: absolute;
    top: 60px;
    right: -90px;
    width: 320px !important;
    height: 380px !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 8px solid #fff !important;
    border-radius: 30px !important;
    z-index: 1;
    display: block;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: floatImage 6s ease-in-out infinite;
}
.teacher-box-info span {
    display: inline-block;
    margin-top: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #A96045;
    background: rgba(169, 96, 69, 0.1);
    padding: 6px 16px;
    border-radius: 50px;
}
.teacher-box-btn-warp .btn-warning {
    background: transparent;
    color: #A96045;
    border: 2px solid #A96045;
    padding: 12px 28px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.teacher-box-btn-warp .btn-warning:hover {
    background: #A96045;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(169, 96, 69, 0.2);
}
/* ===========================
   Responsive - Tablet & Mobile
=========================== */

/* --- تبلت --- */
@media (max-width: 1200px) {
    .teacher-box {
        width: calc(100% - 60px);
        margin: 0 60px 49px 0;
        padding: 40px 160px 40px 40px;
    }
    .teacher-box > img {
        right: -60px;
        top: 80px;
        width: 240px !important;
        height: 300px !important;
    }
    .teacher-swiper-thumb {
        height: 320px;
        margin-top: 80px;
    }
    .teacher-swiper-thumb .swiper-slide {
        height: 70px !important;
    }
}

/* --- موبایل (طراحی کارت پروفایل مرکزی) --- */
@media (max-width: 991px) {
    .teacher-box-head {margin: 0px !important}
    .teacher-box-btn-warp, .btn-warning {padding: 8px !important; font-size: 12px !important;}
    .teacher-box-btn-warp a, .btn-warning a{ border: 1px solid #A96045 !important}

    .teacher-list-wrap {
        flex-direction: column-reverse;
        padding: 0 15px;
        gap: 40px;
    }

    .teacher-swiper-thumb {
        width: 100%;
        height: 90px;
        margin-top: 0;
        padding: 0 50px;
    }
    .teacher-swiper-thumb .swiper-wrapper {
        flex-direction: row;
    }
    .teacher-swiper-thumb .swiper-slide {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 0 !important;
        border-radius: 16px !important; /* گرد کردن عکس‌های کوچک در موبایل */
    }
    .teacher-swiper-thumb .swiper-slide img {
        border-radius: 16px !important;
    }

    .teacher-swiper-next, .teacher-swiper-prev {
        width: 40px;
        height: 90px;
        top: 0;
        transform: none !important;
    }
    .teacher-swiper-next { right: 0; }
    .teacher-swiper-prev { left: 0; bottom: auto; }

    .teacher-box {
        width: 100%;
        margin: 100px 0 0 0;
        padding: 120px 30px 40px 30px;
        text-align: center;
        border-radius: 30px;
    }

    .teacher-box > img {
        top: -120px;
        right: 50%;
        transform: translateX(50%);
        width: 200px !important;
        height: 200px !important;
        border-radius: 24px !important; /* گرد کردن عکس اصلی در موبایل */
        border-width: 6px !important;
        animation: none; /* خاموش کردن انیمیشن در موبایل برای عملکرد بهتر */
    }

    .teacher-box-wrap { padding-right: 0; }
    .teacher-box-head {
        flex-direction: column;
        border-bottom: none;
    }
    .teacher-box-info { align-items: center; }
    .teacher-box-body .text { text-align: center; }
}