/* =========================================
   استایل صفحه آرشیو دوره (Taxonomy Course)
   ========================================= */

/* گرید اصلی */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* کارت‌های عریض‌تر */
    gap: 25px;
    padding: 45px 0;
    width: 100%;
}

.course-lessons-list {
    width: 100%;
}

/* کارت پیشرفته */
.lesson-card-advanced {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.lesson-card-advanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #0073aa;
}

/* --- ردیف ۱: بالا --- */
.card-row-top {
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.lesson-number {
    background: #d5f0e0;
    color: #2c9564;
    font-weight: 500;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    min-width: 3rem;
}

.lesson-titles {
    flex-grow: 1;
}

.lesson-main-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    line-height: 1.4;
}
.lesson-main-title a {
    text-decoration: none;
    color: #333;
    transition: 0.2s;
}
.lesson-main-title a:hover { color: #0073aa; }

.lesson-subtitle {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* --- ردیف ۲: وسط (پلیر) --- */
.card-row-middle {
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.mini-player {
    width: 100%;
    height: 35px; /* ارتفاع کمتر برای کارت */
}

.no-audio-msg {
    font-size: 12px;
    color: #ccc;
    font-style: italic;
}

/* --- ردیف ۳: پایین (فوتر) --- */
.card-row-bottom {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

/* دکمه جزئیات */
.btn-details {
    font-size: 12px;
    font-weight: bold;
    color: #2c9564;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #2c9564;
    padding: 2px 6px;
    border-radius: 7px;
}
.btn-details:hover {
        color: #fff !important;
    background-color: #38bc7e;
}

/* آیکون‌ها */
.card-meta-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #999;
}

.meta-icon {
    display: flex;
    align-items: center;
}

/* رنگ آیکون‌های فعال */
.has-video { color: #e91e63; } /* صورتی */
.has-text { color: #4caf50; }  /* سبز */

.meta-date {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
}
.meta-date .dashicons { font-size: 14px; }

/* لایک */
.meta-like {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #ff5252;
    cursor: pointer;
}
.meta-like .dashicons { font-size: 18px; }

/* ریسپانسیو */
@media (max-width: 576px) {
    .card-row-top {
        flex-direction: column;
    }
}
@media (max-width: 380px) {
    .meta-date {
        display: none;
    }
}

/* استایل تگ‌ها */
.lesson-tags {
    font-size: 11px;
    height: 32px;
    overflow: hidden;
    padding: 0 20px;
}
.tag-item {
    color: #888;
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    display: inline-block;
    margin-top: 6px;

}

/* استایل لایک */
.meta-like {
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}

.meta-like:hover {
    transform: scale(1.1);
}

/* وقتی لایک شده */
.meta-like.liked {
    color: #e91e63; /* قرمز صورتی */
    cursor: default; /* غیرفعال کردن نشانگر کلیک */
}
.meta-like.liked .dashicons {
    /* آیکون قلب پر شده */
}

/* انیمیشن قلب */
@keyframes heart-beat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.meta-like.liked .dashicons {
    animation: heart-beat 0.3s ease-in-out;
}

.course-header {
    position: relative;
    width: 100%;
    z-index: 1;
}

.course-image {
    position: absolute;
    right: 0;
    top: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}
.course-header::before {
    content: '';
    background: rgba(69, 69, 69, .4);
    width: 100%;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
}
.course-info {
    padding: 4.75rem 0;
    flex-direction: column;
}

h1.course-title {
    font-size: 40px;
    color: #fff;
}
.course-header {
    position: relative;
    width: 100%;
    z-index: 1;
    color: #fff;
}
.mh-course-breadcrumb a {
    color: #fff;
}

.course-info > * {
    width: 90%;
}




/* استایل پایه دکمه لایک */
.meta-like {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border-radius: 50px;
    transition: 0.2s;
    user-select: none;
}

.meta-like:hover {
    background-color: #fff0f5; /* پس زمینه صورتی خیلی کمرنگ موقع هاور */
}

/* --- حالت لایک شده (کلاس liked) --- */
.meta-like.liked .count {
    color: #e91e63; /* قرمز شدن عدد */
    font-weight: bold;
}

/* قرمز کردن عکس SVG با استفاده از فیلتر */
.meta-like.liked img {
    /* این کد رنگ سیاه را به قرمز تبدیل می‌کند */
    filter: invert(16%) sepia(96%) saturate(6964%) hue-rotate(334deg) brightness(96%) contrast(96%);
    transform: scale(1.1); /* کمی بزرگتر شدن قلب */
}

/* انیمیشن تپش قلب موقع لایک */
@keyframes heart-bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.meta-like.liked img {
    animation: heart-bump 0.3s ease-in-out;
}


/* تعریف انیمیشن سایه (پالس) */
@keyframes audio2 {
    0%, 100% {
        box-shadow: 0 0 0 .4em #58c38366;
    }
    25% {
            box-shadow: 0 0 0 .15em #58c38326;
    }
    50% {
        box-shadow: 0 0 0 .55em #58c3838c;
    }
    75% {
        box-shadow: 0 0 0 .25em #58c38340;
    }
}

/* کلاسی که هنگام پخش به شماره اضافه می‌شود */
.lesson-number.is-playing {
    animation: audio2 2.2s infinite ease-in-out;
    /* اگر می‌خواهی رنگ پس‌زمینه خود عدد هم با سبز هماهنگ شود، خط زیر را از کامنت خارج کن */
    /* background-color: #58c383; color: #fff; */
}



/* کانتینر اصلی پلیر */
.mh-pro-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent; /* بدون پس‌زمینه اضافه */
    gap: 15px;
    width: 100%;
    direction: rtl;
}

/* دکمه پخش و توقف */
.mh-btn-play {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
    margin-bottom: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    min-width: 40px;
    background-color: #2c9564;
}

.mh-btn-play svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* متن زمان‌ها */
.mh-time {
    font-size: 13px;
    color: #666;
    font-family: Tahoma, Arial, sans-serif;
    min-width: 38px;
    text-align: center;
}

/* کانتینر نوار پیشرفت */
.mh-progress-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    height: 24px; 
    position: relative;
    width: calc(100% - 40px);
    height: .375rem;
    border-radius: 50rem;
    background: #eee;
    outline: 0;
    direction: ltr;
    z-index: 0;
}



/* نوار پر شده (نشان‌دهنده زمان سپری‌شده) */
.mh-slider-track {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: .375rem;
    background-color: #2c9564;
    border-top-left-radius: 50rem;
    border-bottom-left-radius: 50rem;
    cursor: pointer;
    z-index: -1;
}

/* دایره لغزان (Thumb) */
.mh-slider-thumb {
    display: inline-block;
    height: 1rem;
    width: 1rem;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    box-sizing: content-box;
    border-radius: 50%;
    background-color: #2c9564;
    cursor: pointer;
    transition: .2s transform;
    z-index: -1;
    
}

/* اینپوت اصلی (نامرئی ولی فعال) */
.mh-range-input {
    position: absolute;
    top: -10px; /* گسترش منطقه کلیک به بالا و پایین خط */
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    opacity: 0; /* کاملاً نامرئی است اما رویدادهای کلیک را دریافت می‌کند */
    cursor: pointer;
    z-index: 2;
    -webkit-appearance: none;
}

/* بزرگ شدن دایره در صورت هاور شدن کاربر روی اینپوت نامرئی */
/*.mh-range-input:hover ~ .mh-slider-thumb {*/
/*    transform: translate(-50%, -50%) scale(1.3);*/
/*}*/

/* بخش تنظیم سرعت */
.mh-speed-box {
    position: relative;
    display: flex;
    align-items: center;
}
.mh-speed-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
    outline: none;
    direction: ltr;
}
.mh-speed-select:hover {
    color: #0073aa;
}