/* ===================================
   SatBroadcast Archive - RTL Styles
   Persian, Arabic, Kurdish Support
   =================================== */

body.rtl,
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* RTL Typography */
body.rtl,
html[lang^="fa"],
html[lang^="ar"],
html[lang^="ckb"],
html[lang^="kmr"] {
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', 'Arial', sans-serif;
}

html[lang^="fa"] .sat-program-title,
html[lang^="ar"] .sat-program-title,
html[lang^="ckb"] .sat-program-title {
    font-size: 1.1em;
    line-height: 1.8;
}

/* Sidebar RTL */
.rtl .sat-program-sidebar {
    border-inline-start: 1px solid var(--sat-border);
    border-inline-end: none;
}

/* Staff Member RTL */
.rtl .sat-staff-member,
html[dir="rtl"] .sat-staff-member,
html[lang^="fa"] .sat-staff-member,
html[lang^="ar"] .sat-staff-member,
html[lang^="ckb"] .sat-staff-member,
html[lang^="kmr"] .sat-staff-member {
    /* Grid items are already centered, no need for flex-direction change */
    text-align: center;
}

.rtl .sat-staff-info,
html[dir="rtl"] .sat-staff-info,
html[lang^="fa"] .sat-staff-info,
html[lang^="ar"] .sat-staff-info,
html[lang^="ckb"] .sat-staff-info,
html[lang^="kmr"] .sat-staff-info {
    text-align: center;
}

.rtl .sat-related-staff h3,
html[dir="rtl"] .sat-related-staff h3,
html[lang^="fa"] .sat-related-staff h3,
html[lang^="ar"] .sat-related-staff h3,
html[lang^="ckb"] .sat-related-staff h3,
html[lang^="kmr"] .sat-related-staff h3 {
    text-align: center;
}

/* Video Controls RTL */
.rtl .sat-video-controls {
    flex-direction: row-reverse;
}

/* Social Share RTL */
.rtl .sat-social-share {
    flex-direction: row-reverse;
}

.rtl .sat-share-btn {
    flex-direction: row-reverse;
}

/* Search Results RTL */
.rtl .sat-search-result-item {
    flex-direction: row-reverse;
}

/* Modal Buttons RTL */
.rtl .sat-modal-buttons {
    flex-direction: row-reverse;
}

/* Episode Grid RTL */
.rtl .sat-episodes-grid {
    direction: rtl;
}

/* Play Icon RTL - Keep centered */
.rtl .sat-play-icon {
    /* Play icon should remain centered regardless of direction */
}

/* Toast RTL */
.rtl .sat-toast {
    left: 30px;
    right: auto;
}

/* Scrollbar RTL */
.rtl .sat-program-sidebar::-webkit-scrollbar {
    left: 0;
    right: auto;
}

/* Search Input RTL */
.rtl .sat-search-input {
    padding: 15px 20px 15px 50px;
}

/* Staff Info RTL */
.rtl .sat-staff-info {
    text-align: right;
}

/* Responsive RTL */
@media (max-width: 768px) {
    .rtl .sat-single-program-container {
        direction: rtl;
    }
}

/* Persian/Arabic Number Styling */
html[lang^="fa"] .sat-countdown-circle,
html[lang^="ar"] .sat-countdown-circle {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

/* Text Direction Override for Specific Elements */
.rtl .sat-video-url,
.rtl .sat-episode-thumb,
.rtl .sat-program-thumb {
    direction: ltr; /* Keep media elements LTR */
}

/* Live Badge RTL */
.rtl .sat-live-badge {
    flex-direction: row-reverse;
}

/* Episodes Pagination RTL */
.rtl .sat-episodes-pagination,
html[dir="rtl"] .sat-episodes-pagination {
    direction: rtl;
}

.rtl .sat-episodes-pagination .prev,
html[dir="rtl"] .sat-episodes-pagination .prev,
.rtl .sat-episodes-pagination .next,
html[dir="rtl"] .sat-episodes-pagination .next {
    flex-direction: row-reverse;
}

.rtl .sat-episodes-pagination .prev .dashicons,
html[dir="rtl"] .sat-episodes-pagination .prev .dashicons,
.rtl .sat-episodes-pagination .next .dashicons,
html[dir="rtl"] .sat-episodes-pagination .next .dashicons {
    transform: rotate(180deg);
}
