/* ==========================================================================
   Aflamicose – RTL / Arabic Stylesheet
   Full right-to-left overrides + Arabic typography
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base Direction & Typography
   -------------------------------------------------------------------------- */
html[dir="rtl"],
.rtl {
    direction: rtl;
    text-align: right;
}

/* Arabic font stack */
.rtl,
.rtl body,
.rtl .afl-card__title,
.rtl .afl-section-title,
.rtl .afl-hero__title,
.rtl .afl-single-movie__title {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', 'Cairo', 'Amiri', sans-serif;
    letter-spacing: 0; /* Arabic doesn't need letter-spacing */
}

/* --------------------------------------------------------------------------
   2. Header & Navigation
   -------------------------------------------------------------------------- */
.rtl .afl-nav__list { flex-direction: row; }
.rtl .afl-nav__list li ul { left: auto; right: 0; }
.rtl .afl-header__actions { margin-inline-start: 0; margin-inline-end: auto; }

/* Mobile nav slides from right */
.rtl .afl-mobile-nav {
    transform: translateX(100%);
    left: auto;
    right: 0;
}
.rtl .afl-mobile-nav.afl-mobile-nav--open {
    transform: translateX(0);
}

/* Search form direction */
.rtl .afl-search-form { flex-direction: row-reverse; }
.rtl .afl-search-form__input { text-align: right; }

/* Live results badge */
.rtl .afl-live-result-item__badge {
    margin-left: 0;
    margin-right: auto;
}
.rtl .afl-live-result-item { flex-direction: row-reverse; }

/* --------------------------------------------------------------------------
   3. Hero Slider
   -------------------------------------------------------------------------- */
.rtl .afl-hero__bg-overlay {
    background: linear-gradient(
        to left,
        rgba(10,10,15,0.98) 0%,
        rgba(10,10,15,0.75) 45%,
        transparent 100%
    );
}

.rtl .afl-hero__content { flex-direction: row-reverse; }
.rtl .afl-hero__text { text-align: right; }
.rtl .afl-hero__rating { flex-direction: row-reverse; }
.rtl .afl-hero__actions { flex-direction: row-reverse; }

/* Slider controls: swap arrows for RTL */
.rtl .afl-hero__arrow--prev svg { transform: rotate(180deg); }
.rtl .afl-hero__arrow--next svg { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */
.rtl .afl-card__rating {
    left: auto;
    right: var(--afl-space-sm);
}
.rtl .afl-card__type-badge {
    right: auto;
    left: var(--afl-space-sm);
}
.rtl .afl-card__seasons-badge {
    right: auto;
    left: var(--afl-space-sm);
}
.rtl .afl-card__meta { justify-content: flex-end; }
.rtl .afl-card__actor-info { text-align: right; }

/* Search card */
.rtl .afl-card--search .afl-card__link { flex-direction: row-reverse; }
.rtl .afl-card--search .afl-card__info { text-align: right; }

/* --------------------------------------------------------------------------
   5. Single Movie / Series
   -------------------------------------------------------------------------- */
.rtl .afl-single-movie__layout { direction: rtl; }
.rtl .afl-single-movie__title { text-align: right; }
.rtl .afl-single-movie__overview { text-align: right; }
.rtl .afl-single-movie__arabic-title { text-align: right; }
.rtl .afl-single-movie__original-title { text-align: right; font-style: normal; }

/* Meta items */
.rtl .afl-meta-item { flex-direction: row-reverse; }
.rtl .afl-meta-label { text-align: right; }
.rtl .afl-tags { justify-content: flex-end; }

/* Rating */
.rtl .afl-rating { flex-direction: row-reverse; }

/* --------------------------------------------------------------------------
   6. Breadcrumbs
   -------------------------------------------------------------------------- */
.rtl .afl-breadcrumbs__list { flex-direction: row-reverse; }
.rtl .afl-breadcrumbs__separator { transform: rotate(180deg); display: inline-block; }

/* --------------------------------------------------------------------------
   7. Episode Navigation
   -------------------------------------------------------------------------- */
.rtl .afl-episode-nav { flex-direction: row-reverse; }
.rtl .afl-episode-nav__btn { flex-direction: row-reverse; }
.rtl .afl-episode-nav__btn--next { margin-inline-start: 0; margin-inline-end: auto; }
.rtl .afl-episode-nav__btn svg { transform: rotate(180deg); }

/* Episode label */
.rtl .afl-episode-label { direction: ltr; display: inline-block; }
.rtl .afl-single-episode__title { flex-direction: row-reverse; }

/* Episode list items */
.rtl .afl-ep-item__link { flex-direction: row-reverse; }
.rtl .afl-ep-item__info { text-align: right; }
.rtl .afl-ep-item__meta { flex-direction: row-reverse; }

/* Season panels */
.rtl .afl-season-tabs { flex-direction: row-reverse; }
.rtl .afl-episode-list__link { flex-direction: row-reverse; }
.rtl .afl-episode-list__info { text-align: right; }

/* --------------------------------------------------------------------------
   8. Season Tabs (Series page)
   -------------------------------------------------------------------------- */
.rtl .afl-season-tabs { flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   9. Watch / Server Buttons
   -------------------------------------------------------------------------- */
.rtl .afl-server-buttons { flex-direction: row-reverse; }
.rtl .afl-servers__notice { direction: rtl; }

/* --------------------------------------------------------------------------
   10. Top 10 List
   -------------------------------------------------------------------------- */
.rtl .afl-top10-item { flex-direction: row-reverse; }
.rtl .afl-top10-item__link { flex-direction: row-reverse; }
.rtl .afl-top10-item__info { text-align: right; }
.rtl .afl-top10-item__meta { flex-direction: row-reverse; }
.rtl .afl-rating-sm { flex-direction: row-reverse; }

/* --------------------------------------------------------------------------
   11. Episode Cards (home section)
   -------------------------------------------------------------------------- */
.rtl .afl-episode-card__badge {
    right: auto;
    left: var(--afl-space-sm);
}
.rtl .afl-episode-card__info { text-align: right; }

/* --------------------------------------------------------------------------
   12. Section Headers
   -------------------------------------------------------------------------- */
.rtl .afl-section-header { flex-direction: row-reverse; }
.rtl .afl-section-more { direction: ltr; }

/* --------------------------------------------------------------------------
   13. Archive & Filters
   -------------------------------------------------------------------------- */
.rtl .afl-archive-header { flex-direction: row-reverse; }
.rtl .afl-filter-form { flex-direction: row-reverse; }
.rtl .afl-filter-form__group label { text-align: right; }
.rtl .afl-filter-form__group select {
    background-position: left 10px center;
    padding: 8px 12px 8px 32px;
    text-align: right;
}
.rtl .afl-archive__description { text-align: right; }

/* --------------------------------------------------------------------------
   14. Search Page
   -------------------------------------------------------------------------- */
.rtl .afl-search-results-header { text-align: right; }
.rtl .afl-no-results { direction: rtl; }

/* --------------------------------------------------------------------------
   15. FAQ
   -------------------------------------------------------------------------- */
.rtl .afl-faq__question { flex-direction: row-reverse; text-align: right; }
.rtl .afl-faq__answer p { text-align: right; direction: rtl; }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.rtl .afl-footer__top { direction: rtl; }
.rtl .afl-footer__menu { text-align: right; }
.rtl .afl-footer__copy { direction: rtl; }
.rtl .afl-footer__disclaimer { direction: rtl; }
.rtl .afl-footer__brand { text-align: right; }

/* --------------------------------------------------------------------------
   17. Pagination
   -------------------------------------------------------------------------- */
.rtl .afl-pagination__list { flex-direction: row-reverse; }
.rtl .afl-pagination__item--prev .afl-pagination__link { transform: rotate(180deg); display: flex; }
.rtl .afl-pagination__item--next .afl-pagination__link { transform: rotate(180deg); display: flex; }

/* --------------------------------------------------------------------------
   18. Forms (Contact, DMCA)
   -------------------------------------------------------------------------- */
.rtl .afl-form { direction: rtl; }
.rtl .afl-form__group label { text-align: right; }
.rtl .afl-form__input,
.rtl .afl-form__textarea { text-align: right; direction: rtl; }

/* --------------------------------------------------------------------------
   19. Page Content (About, Privacy, etc.)
   -------------------------------------------------------------------------- */
.rtl .afl-page-content { direction: rtl; }
.rtl .afl-page-title { text-align: right; }
.rtl .afl-page-body { text-align: right; }
.rtl .afl-page-body ul,
.rtl .afl-page-body ol { padding-inline-start: 0; padding-inline-end: var(--afl-space-xl); }

/* --------------------------------------------------------------------------
   20. Gallery
   -------------------------------------------------------------------------- */
.rtl .afl-gallery-tabs { flex-direction: row-reverse; }
.rtl .afl-gallery-item__badge {
    right: auto;
    left: 6px;
}

/* Lightbox arrows: swap for RTL */
.rtl .afl-lightbox__arrow--prev svg { transform: rotate(180deg); }
.rtl .afl-lightbox__arrow--next svg { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   21. Cast Grid
   -------------------------------------------------------------------------- */
.rtl .afl-cast-grid { direction: rtl; }
.rtl .afl-card--actor .afl-card__actor-info { text-align: center; } /* keep centered */

/* --------------------------------------------------------------------------
   22. 404 Page
   -------------------------------------------------------------------------- */
.rtl .afl-404__content { direction: rtl; }
.rtl .afl-404__actions { flex-direction: row-reverse; }

/* --------------------------------------------------------------------------
   23. Mobile-specific RTL fixes
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .rtl .afl-single-movie__layout { direction: rtl; }
    .rtl .afl-hero__content { gap: var(--afl-space-md); }
    .rtl .afl-episode-nav { flex-direction: column; align-items: flex-end; }
}

/* --------------------------------------------------------------------------
   24. Arabic number display: use Western numerals for consistency
   -------------------------------------------------------------------------- */
.rtl .afl-card__year,
.rtl .afl-rating,
.rtl .afl-hero__rating,
.rtl .afl-top10-item__rank,
.rtl .afl-episode-label,
.rtl .afl-season-tab__count,
.rtl .afl-gallery-tab__count,
.rtl .afl-pagination__link {
    font-variant-numeric: tabular-nums;
    unicode-bidi: plaintext;
}
