
/* ============================================================ */
/* FULL RTL LAYOUT                                                */
/* For /ar, /fa, /he, /ku, /ps, /sd, /ur language routes          */
/* Applied via .rtl-layout class on app-container (dir="rtl")     */
/* ============================================================ */

/* --- Base Direction & Text --- */
.rtl-layout {
  direction: rtl;
  text-align: right;
}

/* --- Three-Column Layout: Mirror sidebar positions --- */
.rtl-layout .main-layout {
  direction: rtl;
}

.rtl-layout .right-sidebar {
  margin-left: 0;
  margin-right: 24px;
}

.rtl-layout .trending-carousel-nav {
  margin-left: 0;
  margin-right: auto;
}

.rtl-layout .trending-carousel-counter {
  margin-right: 0;
  margin-left: 2px;
}

/* --- Flip all directional SVG arrows (back buttons, chevrons, carousel arrows) --- */
.rtl-layout .thought-back-button svg,
.rtl-layout .tag-back-button svg,
.rtl-layout .trending-carousel-btn svg,
.rtl-layout .related-thoughts-nav button svg,
.rtl-layout .carousel-btn svg,
.rtl-layout .carousel-arrow svg,
.rtl-layout .related-posts-nav button svg,
.rtl-layout .nav-arrow svg {
  transform: scaleX(-1);
}

/* --- Breadcrumb separator: use backslash for RTL visual flow --- */
.rtl-layout .breadcrumb-sep {
  display: inline-block;
  transform: scaleX(-1);
}

/* --- Back Button: swap left/right position in header --- */
.rtl-layout .thought-detail-header {
  direction: rtl;
}

/* --- Breadcrumb: RTL flow --- */
.rtl-layout .breadcrumb {
  direction: rtl;
  text-align: right;
}

/* --- Content Tabs --- */
.rtl-layout .content-tabs {
  direction: rtl;
}

/* Loading bar animation reversed for RTL */
.rtl-layout .content-tabs-pending::before {
  animation: tab-loading-bar-rtl 1s ease-in-out infinite;
}

@keyframes tab-loading-bar-rtl {
  0% { right: 0; left: auto; }
  50% { right: 70%; left: auto; }
  100% { right: 0; left: auto; }
}

/* --- Post Cards: Mirror layout --- */
.rtl-layout .post-card {
  direction: rtl;
}

.rtl-layout .post-header {
  direction: rtl;
}

.rtl-layout .post-meta-row {
  direction: rtl;
}

.rtl-layout .post-content,
.rtl-layout .post-content p {
  text-align: right;
  direction: rtl;
}

.rtl-layout .post-actions {
  direction: rtl;
}

.rtl-layout .advice-separator {
  margin-left: 0;
  margin-right: 36px;
}

.rtl-layout .advice-preview-content {
  padding-left: 0;
  padding-right: 48px;
}

.rtl-layout .advice-preview-content::before {
  left: auto;
  right: 17.25px;
  border-left: none;
  border-right: 1.5px solid #E2E6ED;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 12px;
}

.rtl-layout .advice-preview-content .advice-flag {
  margin-left: 0;
  margin-right: 2px;
}

.rtl-layout .view-all-advice {
  text-align: right;
}

.rtl-layout .author-flag {
  margin-left: 0;
  margin-right: 2px;
}

.rtl-layout .feeling-emoji {
  margin-left: 0;
  margin-right: 4px;
}

.rtl-layout .feeling-gif {
  margin-left: 0;
  margin-right: 4px;
}

/* --- Post Menu RTL --- */
.rtl-layout .post-menu-container {
  direction: ltr;
}

.rtl-layout .post-menu-dropdown {
  right: auto;
  left: 0;
}

/* --- Mood Post Cards --- */
.rtl-layout .mood-post-card {
  direction: rtl;
}

.rtl-layout .mood-post-header {
  direction: rtl;
}

.rtl-layout .mood-post-meta-row {
  direction: rtl;
}

.rtl-layout .mood-post-content,
.rtl-layout .mood-post-content p {
  text-align: right;
  direction: rtl;
}

.rtl-layout .mood-feeling-emoji {
  margin-left: 0;
  margin-right: 4px;
}

.rtl-layout .mood-react-wrapper {
  margin-left: 0;
  margin-right: 4px;
}

.rtl-layout .mood-poll-option {
  text-align: right;
}

.rtl-layout .poll-option-bar {
  left: auto;
  right: 0;
  border-radius: 0 8px 8px 0;
}

/* --- Topic Detail Page --- */
.rtl-layout .topic-detail-page {
  direction: rtl;
  text-align: right;
}

.rtl-layout .topic-detail-layout {
  direction: rtl;
}

.rtl-layout .topic-header-content {
  text-align: right;
}

.rtl-layout .topic-meta-info {
  direction: rtl;
}

.rtl-layout .topic-creator {
  direction: rtl;
}

.rtl-layout .topic-stats {
  direction: rtl;
}

.rtl-layout .topic-participants {
  direction: rtl;
}

.rtl-layout .participant-avatar {
  margin-left: 0;
  margin-right: -8px;
}

.rtl-layout .participant-avatar:first-child {
  margin-right: 0;
}

/* --- Topic Posts --- */
.rtl-layout .topic-post-card {
  direction: rtl;
}

.rtl-layout .topic-post-header {
  direction: rtl;
}

.rtl-layout .topic-post-content,
.rtl-layout .topic-post-content p {
  text-align: right;
  direction: rtl;
}

/* --- Thought Detail Page --- */
.rtl-layout .thought-detail-page {
  direction: rtl;
}

.rtl-layout .thought-detail-container {
  direction: rtl;
}

.rtl-layout .thought-header-title {
  text-align: center;
}

.rtl-layout .thought-detail-title {
  text-align: right;
  direction: rtl;
}

.rtl-layout .thought-detail-meta {
  direction: rtl;
}

.rtl-layout .thought-detail-content {
  text-align: right;
  direction: rtl;
}

.rtl-layout .thought-detail-content .ql-direction-rtl {
  direction: rtl;
  text-align: right;
}

.rtl-layout .thought-detail-content blockquote {
  border-left: none;
  border-right: 4px solid #dbe0e8;
  padding-left: 0;
  padding-right: 16px;
}

.rtl-layout .thought-detail-content ul,
.rtl-layout .thought-detail-content ol {
  padding-left: 0;
  padding-right: 20px;
}

.rtl-layout .thought-detail-disclaimer {
  text-align: right;
  direction: rtl;
}

.rtl-layout .thought-detail-feedback {
  direction: rtl;
  flex-direction: row-reverse;
}

/* --- Related Thoughts Sidebar --- */
.rtl-layout .related-thoughts-header {
  direction: rtl;
}

.rtl-layout .related-thought-header {
  direction: rtl;
}

.rtl-layout .related-thought-excerpt {
  text-align: right;
  direction: rtl;
}

.rtl-layout .related-thought-stats {
  direction: rtl;
}

/* --- Post Detail Page (feed post detail) --- */
.rtl-layout .post-detail-page {
  direction: rtl;
}

.rtl-layout .post-detail-container {
  direction: rtl;
}

.rtl-layout .post-detail-header {
  direction: rtl;
}

.rtl-layout .post-detail-author-row {
  direction: rtl;
}

.rtl-layout .post-detail-meta-row {
  direction: rtl;
}

/* --- Comment Section --- */
.rtl-layout .comment-card {
  direction: rtl;
}

.rtl-layout .comment-header {
  direction: rtl;
}

.rtl-layout .comment-content,
.rtl-layout .comment-text {
  text-align: right;
  direction: rtl;
}

.rtl-layout .comment-actions {
  direction: rtl;
}

.rtl-layout .comment-actions-v2 {
  direction: rtl;
}

/* Vote pill group must stay LTR so the connected buttons render correctly */
.rtl-layout .vote-pill-group {
  direction: ltr;
}

/* Rank badge SVGs: flip entire badge in RTL, counter-flip text so it stays readable */
.rtl-layout .rank-badge-v2-svg svg {
  transform: scaleX(-1);
}
.rtl-layout .rank-badge-v2-svg svg text {
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleX(-1);
}

.rtl-layout .rank-badge-v2-pill {
  direction: ltr;
}

/* Advice section rank badge text label: flip in RTL */
.rtl-layout .advice-rank-badge {
  direction: ltr;
}

.rtl-layout .comment-replies {
  border-left: none;
  border-right: 2px solid #E5E7EB;
  margin-left: 0;
  margin-right: 36px;
  padding-left: 0;
  padding-right: 20px;
}

.rtl-layout .comment-input-container {
  direction: rtl;
}

.rtl-layout .comment-input-wrapper {
  direction: rtl;
}

.rtl-layout .comment-input-wrapper textarea {
  text-align: right;
  direction: rtl;
}

/* --- Feeling Input Box --- */
.rtl-layout .feeling-input-box {
  direction: rtl;
}

.rtl-layout .feeling-input-left {
  direction: rtl;
}

/* --- Tags Section --- */
.rtl-layout .post-topic-badge {
  direction: rtl;
}

/* --- Trending Sidebar Items --- */
.rtl-layout .trending-topic-item {
  direction: rtl;
  text-align: right;
}

.rtl-layout .trending-topic-user {
  direction: rtl;
}

.rtl-layout .trending-topic-stats {
  direction: rtl;
}

.rtl-layout .trending-post-item {
  direction: rtl;
  text-align: right;
}

.rtl-layout .trending-post-user {
  direction: rtl;
}

.rtl-layout .trending-post-stats {
  direction: rtl;
}

.rtl-layout .latest-post-item {
  direction: rtl;
  text-align: right;
}

.rtl-layout .latest-post-user {
  direction: rtl;
}

.rtl-layout .latest-post-stats {
  direction: rtl;
}

/* --- Get App Banner --- */
.rtl-layout .get-app-banner {
  direction: rtl;
  text-align: right;
}

.rtl-layout .get-app-header {
  direction: rtl;
}

.rtl-layout .get-app-content {
  direction: rtl;
}

/* --- Sidebar Footer --- */
.rtl-layout .sidebar-footer {
  direction: rtl;
  text-align: right;
  align-items: flex-end;
}

.rtl-layout .sidebar-footer-links {
  direction: rtl;
  text-align: right;
}

.rtl-layout .sidebar-footer-copyright {
  direction: rtl;
  text-align: right;
}

.rtl-layout .web-footer {
  align-items: flex-end;
}

.rtl-layout .footer-content {
  align-items: flex-end;
}

.rtl-layout .footer-links-text {
  text-align: right;
  direction: rtl;
}

.rtl-layout .footer-copyright {
  direction: rtl;
  text-align: right;
}

.copyright-rtl {
  direction: rtl !important;
  text-align: right !important;
  width: auto !important;
}

/* --- Login/User Row in sidebar --- */
.rtl-layout .sidebar-login-row {
  justify-content: flex-end;
}

/* --- Audio Player --- */
.rtl-layout .post-audio {
  direction: rtl;
}

.rtl-layout .audio-play-btn svg {
  margin-left: 0;
  margin-right: 2px;
}

/* --- Emoji Picker Popup --- */
.rtl-layout .emoji-picker-popup {
  left: auto;
  right: 0;
}

/* --- Action Menu Dropdown --- */
.rtl-layout .action-menu-dropdown {
  right: auto;
  left: 0;
}

.rtl-layout .action-menu-item {
  text-align: right;
}

/* --- Language Dropdown --- */
.rtl-layout .language-dropdown {
  right: auto;
  left: 0;
}

.rtl-layout .language-dropdown-item {
  text-align: right;
}

.rtl-layout .language-dropdown-item .lang-native {
  text-align: left;
}

/* --- Search page --- */
.rtl-layout .search-container {
  direction: rtl;
}

.rtl-layout .search-input {
  text-align: right;
  direction: rtl;
}

/* --- Popular Thoughts --- */
.rtl-layout .popular-thought-item {
  direction: rtl;
}

/* --- Thought Cards (list view) --- */
.rtl-layout .thought-card {
  direction: rtl;
}

.rtl-layout .thought-header {
  direction: rtl;
}

.rtl-layout .thought-body {
  text-align: right;
  direction: rtl;
}

/* --- Topic Cards (list view) --- */
.rtl-layout .topic-card {
  direction: rtl;
}

.rtl-layout .topic-card-body {
  text-align: right;
  direction: rtl;
}

/* --- Share Popup --- */
.rtl-layout .share-popup {
  direction: rtl;
  text-align: right;
}

/* --- Adult Content Popup --- */
.rtl-layout .adult-why-popup {
  direction: rtl;
  text-align: right;
}

.rtl-layout .adult-why-close {
  right: auto;
  left: 16px;
}

.rtl-layout .adult-content-cover {
  direction: rtl;
}

/* --- Modals and Popups --- */
.rtl-layout .cpm-modal {
  direction: rtl;
  text-align: right;
}

/* --- Login Popup --- */
.rtl-layout .login-popup-content {
  direction: rtl;
  text-align: right;
}

/* --- Notifications --- */
.rtl-layout .notifications-panel {
  direction: rtl;
  text-align: right;
  left: auto;
  right: 0;
}

/* --- Story Content in Topics --- */
.rtl-layout .story-card {
  direction: rtl;
}

.rtl-layout .story-card-body {
  text-align: right;
  direction: rtl;
}

.rtl-layout .story-header {
  direction: rtl;
}

/* --- Quill Editor Content inside RTL --- */
.rtl-layout .ql-editor {
  direction: rtl;
  text-align: right;
}

.rtl-layout .ql-toolbar {
  direction: ltr;
}

/* --- Mobile Bottom Bar (LTR always for navigation icons) --- */
.rtl-layout .mobile-bottom-bar {
  direction: ltr;
}

/* --- Left Sidebar (LTR always for icon-only navigation) --- */
.rtl-layout .left-sidebar {
  direction: ltr;
}

/* --- Category filters --- */
.rtl-layout .category-filter-bar {
  direction: rtl;
}

/* --- Create Post Modal --- */
.rtl-layout .create-post-modal textarea {
  text-align: right;
  direction: rtl;
}

/* --- Profile Sidebar --- */
.rtl-layout .profile-sidebar {
  direction: rtl;
  text-align: right;
}

/* --- Transactions / Balance --- */
.rtl-layout .transactions-list {
  direction: rtl;
}

.rtl-layout .transaction-item {
  direction: rtl;
}

/* --- Checkout Sidebar --- */
.rtl-layout .checkout-sidebar {
  direction: rtl;
  text-align: right;
}

/* --- Legal Document Content (already LTR, keep for readability) --- */
.rtl-layout .legal-content {
  direction: rtl;
  text-align: right;
}

/* --- Thought/Topic Related Items Card Arrow Icon Flip --- */
.rtl-layout .related-topic-arrow svg,
.rtl-layout .see-all-arrow svg,
.rtl-layout .related-item-chevron {
  transform: scaleX(-1);
}

/* --- RTL-specific Dark Mode overrides --- */
html.dark .rtl-layout .comment-replies {
  border-right-color: #3E4042;
}

html.dark .rtl-layout .thought-detail-content blockquote {
  border-right-color: #4E4F50;
}

/* ============================================================ */
/* END FULL RTL LAYOUT                                            */
/* ============================================================ */
