/* تنظیمات کلی گرید */
.manga-fav-container {
    direction: rtl;
    padding: 20px 0;
}

.manga-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 25px;
}

/* استایل کارت مانگا */
.manga-fav-card {
    position: relative;
    transition: transform 0.3s ease;
}

.manga-fav-card:hover {
    transform: translateY(-5px);
}

.manga-fav-cover-wrap {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    background: #1a1a1a;
}

.manga-fav-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.manga-fav-card:hover img {
    filter: brightness(0.7);
}

/* نشان شماره چپتر */
.manga-fav-chapter-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #fe7502;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
}

/* دکمه حذف مشابه تصویر */
.manga-fav-remove-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s;
    z-index: 3;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.manga-fav-card:hover .manga-fav-remove-btn {
    opacity: 1;
}

.manga-fav-remove-btn:hover {
    background: #ff0000;
}

/* عنوان مانگا */
.manga-fav-title {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.manga-fav-title a {
    color: #fe7502;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Elementor favorite button icon sizing/layout fix */
.mm-favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

.mm-favorite-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.mm-favorite-btn__icon-inner svg {
    width: 20px;
    height: 20px;
    display: block;
}

.mm-favorite-btn__icon-inner i {
    font-size: 20px;
    line-height: 1;
}

/* Minimal modal visibility styling (only when shown) */
.mm-favorite-modal[hidden] {
    display: none !important;
}

.mm-favorite-modal:not([hidden]) {
    display: block;
}

/* Guest login modal - fixed centered dark theme */
.mm-favorite-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.mm-favorite-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.mm-favorite-modal__dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #fe7502;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 18px 18px 16px;
}

.mm-favorite-modal__close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(254, 117, 2, 0.45);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
}

.mm-favorite-modal__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.mm-favorite-modal__message {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 13px;
}

.mm-favorite-modal__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.mm-favorite-modal__actions .button {
    border-radius: 10px;
    border: 1px solid #fe7502;
    background: #fe7502;
    color: #111111;
}

.mm-favorite-modal__actions .button.alt {
    background: transparent;
    color: #ffffff;
}

body.mm-favorite-modal-open {
    overflow: hidden;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 480px) {
    .manga-fav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .manga-fav-remove-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .manga-fav-grid {
        gap: 18px;
    }

    .manga-fav-remove-btn {
        opacity: 1;
    }
}