/* ==========================================================
   سیستم علاقه‌مندی - استایل
   مینیمال و هماهنگ با ویدیو پلاگین (گرادینت سبز، تأکید زرد)
   ========================================================== */

:root {
    --epcl-green: #0e8a5a;
    --epcl-green-dark: #0a6b45;
    --epcl-green-soft: #e8f6ef;
    --epcl-yellow: #f5b800;
    --epcl-red: #e5484d;
    --epcl-red-soft: #fdeeee;
    --epcl-ink: #23283a;
    --epcl-muted: #6b7280;
    --epcl-line: #e1e6e3;
    --epcl-surface: #f5f6f6;
    --epcl-gradient: linear-gradient(135deg, #0b6b45 0%, #12a06a 100%);
}

.epcl-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================================
   صفحه علاقه‌مندی‌ها
   ========================================================== */
.epcl-fav {
    direction: rtl;
    text-align: right;
    font-family: inherit;
    color: var(--epcl-ink);
    line-height: 1.8;
    padding: 0 4px;
    box-sizing: border-box;
}

.epcl-fav *,
.epcl-fav *::before,
.epcl-fav *::after {
    box-sizing: border-box;
}

.epcl-fav a {
    text-decoration: none;
}

.epcl-fav h3,
.epcl-fav p {
    margin: 0;
    padding: 0;
}

/* ---------- هدر ---------- */
.epcl-fav-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding: 16px 20px;
    background: var(--epcl-surface);
    border: 1px dashed #cfd8d3;
    border-radius: 20px;
}

.epcl-fav-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: var(--epcl-red-soft);
    color: var(--epcl-red);
    border-radius: 14px;
}

.epcl-fav-header__icon .epcl-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.epcl-fav-header__text {
    flex: 1;
    min-width: 0;
}

.epcl-fav .epcl-fav-header__text h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--epcl-ink);
}

.epcl-fav .epcl-fav-header__text p {
    font-size: 12.5px;
    color: var(--epcl-muted);
}

.epcl-fav-count {
    padding: 5px 16px;
    background: #fff;
    border: 1px solid var(--epcl-line);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--epcl-muted);
    white-space: nowrap;
}

.epcl-fav-count b {
    margin-left: 2px;
    font-size: 14px;
    color: var(--epcl-ink);
}

/* ---------- دکمه‌ها ---------- */
.epcl-fav .epcl-fav-btn,
.epcl-modal .epcl-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--epcl-gradient);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    cursor: pointer;
    box-shadow: none;
    transition: filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.epcl-fav .epcl-fav-btn:hover,
.epcl-modal .epcl-fav-btn:hover {
    filter: brightness(1.08);
    color: #fff;
}

.epcl-fav .epcl-fav-btn--sm {
    padding: 7px 18px;
    font-size: 13px;
}

.epcl-fav .epcl-fav-btn--ghost-danger,
.epcl-modal .epcl-fav-btn--ghost {
    background: #fff;
    border-color: var(--epcl-line);
    color: var(--epcl-muted);
}

.epcl-fav .epcl-fav-btn--ghost-danger:hover {
    filter: none;
    border-color: var(--epcl-red);
    color: var(--epcl-red);
}

.epcl-modal .epcl-fav-btn--ghost:hover {
    filter: none;
    border-color: var(--epcl-green);
    color: var(--epcl-green-dark);
}

.epcl-modal .epcl-fav-btn--danger {
    background: var(--epcl-red);
}

.epcl-fav .epcl-fav-btn[disabled],
.epcl-modal .epcl-fav-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

/* ---------- شبکه کارت‌ها ---------- */
.epcl-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.epcl-fav-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--epcl-line);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.15s ease, opacity 0.25s ease;
}

.epcl-fav-card:hover {
    border-color: #b9c9c1;
}

.epcl-fav-card.is-removing {
    opacity: 0;
}

.epcl-fav-card__thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--epcl-surface);
    overflow: hidden;
}

.epcl-fav-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
}

.epcl-fav-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eef2f0, #dfe7e3);
    color: #9db0a7;
}

.epcl-fav-card__placeholder .epcl-icon {
    width: 40px;
    height: 40px;
}

.epcl-fav-card__body {
    flex: 1;
    padding: 16px 18px 6px;
}

.epcl-fav .epcl-fav-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.epcl-fav .epcl-fav-card__title a {
    color: var(--epcl-ink);
    transition: color 0.15s ease;
}

.epcl-fav .epcl-fav-card__title a:hover {
    color: var(--epcl-green-dark);
}

.epcl-fav-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--epcl-muted);
}

.epcl-fav-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.epcl-fav-card__meta .epcl-icon {
    width: 14px;
    height: 14px;
}

.epcl-fav-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 18px 0;
    padding: 14px 0 16px;
    border-top: 1px dashed var(--epcl-line);
}

.epcl-fav .epcl-fav-card__foot .epcl-fav-btn {
    flex: 1;
}

.epcl-fav .epcl-fav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--epcl-line);
    border-radius: 50%;
    color: var(--epcl-muted);
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.epcl-fav .epcl-fav-icon-btn:hover {
    border-color: var(--epcl-red);
    background: var(--epcl-red-soft);
    color: var(--epcl-red);
}

.epcl-fav .epcl-fav-icon-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- حالت خالی ---------- */
.epcl-fav-panel {
    background: #fff;
    border: 1px solid var(--epcl-line);
    border-radius: 22px;
}

.epcl-fav .epcl-fav-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 24px;
}

.epcl-fav-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--epcl-green-soft);
    color: var(--epcl-green);
}

.epcl-fav-empty__icon .epcl-icon {
    width: 32px;
    height: 32px;
}

.epcl-fav .epcl-fav-empty__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.epcl-fav .epcl-fav-empty__text {
    width: 100%;
    max-width: 460px;
    margin: 0 auto 24px;
    font-size: 13.5px;
    color: var(--epcl-muted);
    text-align: center;
}

/* ==========================================================
   پیام (Toast)
   ========================================================== */
.epcl-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--epcl-ink);
    color: #fff;
    font-size: 13.5px;
    direction: rtl;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    transform: translate(-50%, -16px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.epcl-toast::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12a06a;
}

.epcl-toast--error::before {
    background: var(--epcl-red);
}

.epcl-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* ==========================================================
   پنجره تایید
   ========================================================== */
.epcl-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(25, 30, 45, 0.5);
    direction: rtl;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.epcl-modal.is-visible {
    opacity: 1;
}

.epcl-modal__box {
    width: 100%;
    max-width: 380px;
    padding: 28px 26px 24px;
    background: #fff;
    border-radius: 22px;
    text-align: center;
    font-family: inherit;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.epcl-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--epcl-red-soft);
    color: var(--epcl-red);
}

.epcl-modal__icon .epcl-icon {
    width: 24px;
    height: 24px;
}

.epcl-modal .epcl-modal__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--epcl-ink);
}

.epcl-modal .epcl-modal__text {
    margin: 0 0 22px;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--epcl-muted);
}

.epcl-modal__actions {
    display: flex;
    gap: 10px;
}

.epcl-modal__actions .epcl-fav-btn {
    flex: 1;
}

/* ==========================================================
   دکمه ذخیره داخل مطالب
   ========================================================== */
.epcl-buttons-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.epcl-favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--epcl-line);
    border-radius: 999px;
    color: var(--epcl-muted);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.epcl-favorite-btn .favorite-icon {
    display: inline-flex;
}

.epcl-favorite-btn .epcl-icon {
    width: 16px;
    height: 16px;
}

.epcl-favorite-btn:hover {
    border-color: var(--epcl-red);
    color: var(--epcl-red);
    background: #fff;
}

.epcl-favorite-btn.active {
    background: var(--epcl-red-soft);
    border-color: #f5cccc;
    color: var(--epcl-red);
}

.epcl-favorite-btn.active .epcl-icon {
    fill: currentColor;
}

.epcl-favorite-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.epcl-favorite-btn.is-pop .favorite-icon {
    animation: epcl-pop 0.35s ease;
}

@keyframes epcl-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.epcl-view-favorites-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--epcl-green-soft);
    border-radius: 999px;
    color: var(--epcl-green-dark) !important;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.6;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.epcl-view-favorites-btn:hover {
    background: #d8f0e5;
}

.epcl-view-favorites-btn .epcl-icon {
    width: 15px;
    height: 15px;
}

.title.bold { display: none; }

/* ==========================================================
   شمارنده در منوی داشبورد EDD
   ========================================================== */
.edd-support-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 5px !important;
    background: var(--epcl-red) !important;
    border: 2px solid #fff !important;
    border-radius: 999px !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    animation: none !important;
    box-shadow: none !important;
}

.edd-support-badge::before {
    display: none !important;
}

/* ---------- منوی EDD ---------- */
.edd-customer-dashboard .edd-cd-menu a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
}

.edd-customer-dashboard .edd-cd-menu a span:not(.edd-support-badge) { flex-grow: 1; }

/* ---------- حذف بخش دیدگاه‌ها ---------- */
.page-template-default #comments,
.page-template-default #respond,
.page-template-default .comments-area,
.page-template-default .comment-respond { display: none !important; }

/* ==========================================================
   موبایل
   ========================================================== */
@media (max-width: 768px) {
    .epcl-fav-header {
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .epcl-fav-header__text {
        flex-basis: calc(100% - 70px);
    }

    .epcl-fav-grid {
        grid-template-columns: 1fr;
    }

    .epcl-buttons-container {
        flex-wrap: wrap;
    }

    .edd-support-badge {
        min-width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
        margin-right: 6px !important;
        margin-left: 3px !important;
        border-width: 1.5px !important;
    }
}
