/* ============================================
   RTL Override for Uyghur Frontend
   Loaded after style.css — only RTL deltas
   Key principle: direction:rtl on <html> already
   reverses flex order naturally, so we do NOT
   use row-reverse on flex containers.
   ============================================ */

/* ---------- Font ---------- */
@font-face {
    font-family: 'ALKATIP Elipbe';
    src: url('https://fonts.cdnfonts.com/s/58436/ALKATIPElipbe-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html {
    direction: rtl;
}

body {
    font-family: 'ALKATIP Elipbe', 'UKIJ Basma', 'UKIJ Tor', 'Noto Naskh Arabic', sans-serif;
}

/* ---------- Header ---------- */
/* direction:rtl already reverses flex order, no row-reverse needed */
.search-box {
    padding: 4px 16px 4px 4px;
}

/* All inputs: cursor starts from right */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea,
select {
    direction: rtl;
    text-align: right;
}

/* Inputs that contain URLs or phone numbers — keep LTR but align right */
input[name="avatar"],
input[name="phone"] {
    direction: ltr;
    text-align: right;
}

/* ---------- Section heads ---------- */
.section-head .more {
    text-align: left;
}

/* ---------- Content cards ---------- */
.card-grid {
    direction: rtl;
}
.card-poster .title-overlay {
    text-align: right;
}
.rating-badge {
    left: auto;
    right: 8px;
}
.vip-corner {
    right: auto;
    left: 8px;
}
.card-badge {
    right: auto;
    left: 8px;
}
.card-info .c-meta {
    text-align: left;
}

/* ---------- Banner hero ---------- */
.banner-hero .hero-content {
    left: auto;
    right: 40px;
}

/* ---------- Detail page ---------- */
.detail-hero {
    flex-direction: row-reverse;
}
.meta-list .label {
    margin-right: 0;
    margin-left: 4px;
}

/* ---------- Episode list ---------- */
.episode-list {
    direction: rtl;
}

/* ---------- Category nav ---------- */
.cat-nav {
    direction: rtl;
}

/* ---------- Review ---------- */
.review-item .review-time {
    margin-left: 0;
    margin-right: auto;
}
.review-list {
    direction: rtl;
}
.featured-tag {
    margin-left: 0;
    margin-right: 8px;
}

/* ---------- Footer ---------- */
.footer-links {
    direction: rtl;
}

/* ---------- Pagination ---------- */
.pagination {
    direction: rtl;
}

/* ---------- Short video ---------- */
.short-overlay {
    direction: rtl;
    text-align: right;
}
.short-actions {
    text-align: left;
}

/* ---------- Topic page ---------- */
.topic-hero {
    text-align: right;
}

/* ---------- User center ---------- */
.user-center-grid {
    direction: rtl;
}
.uc-wrap {
    direction: rtl;
}
.uc-orders-table th,
.uc-orders-table td {
    text-align: right;
}
.uc-orders-table-wrap {
    direction: rtl;
}

/* ---------- VIP page ---------- */
.vip-plans-grid {
    direction: rtl;
}
.vip-benefits-table {
    direction: rtl;
}
.vip-benefits-table th,
.vip-benefits-table td {
    text-align: right;
}

/* ---------- Player toolbar ---------- */
.player-toolbar {
    direction: rtl;
}

/* ---------- Tables ---------- */
table {
    direction: rtl;
}
table th,
table td {
    text-align: right;
}

/* ---------- Empty state ---------- */
.empty-state {
    direction: rtl;
}

/* ---------- Auth forms ---------- */
.auth-wrap {
    direction: rtl;
    text-align: right;
}

/* ---------- Misc ---------- */
.grid-2,
.grid-3,
.grid-4 {
    direction: rtl;
}

/* ---------- Danmaku: keep LTR (animations go left-to-right) ---------- */
.danmaku-overlay {
    direction: ltr;
}

/* ---------- Language switch (same for both modes) ---------- */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--text-2, #64748b);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}
.lang-switch:hover {
    background: var(--primary, #6366f1);
    color: #fff;
}

/* ---------- Mobile responsive (RTL) ---------- */
@media (max-width: 768px) {
    /* RTL: direction:rtl already reverses flex order, no row-reverse needed */
    .main-nav, .header-right { display: none !important; }
    .mobile-search {
        direction: rtl;
    }
    .mobile-search .search-box {
        flex-direction: row-reverse;
        padding: 4px 16px 4px 4px;
    }
    .banner-hero .hero-content {
        right: 20px;
    }
    .detail-hero {
        flex-direction: column;
    }
    .mobile-tabbar {
        direction: rtl;
    }
}

