/* Nexus — RTL (Right-to-Left) overrides
 * Applied when <html dir="rtl"> is set (Arabic, Hebrew, Persian, etc.)
 * All layout directions, padding/margin, and icon positions are flipped.
 */

[dir="rtl"] {

    /* ── Base typography ── */
    body { direction: rtl; }

    /* ── 3-column layout ── */
    .nx-page-wrapper    { direction: rtl; }
    .nx-sidebar-left    { order: 3; }
    .nx-main-content    { order: 2; }
    .nx-sidebar-right   { order: 1; }

    /* ── Topbar ── */
    .nx-topbar-inner    { flex-direction: row-reverse; }
    .nx-topbar-left     { flex-direction: row-reverse; }
    .nx-topbar-right    { flex-direction: row-reverse; }
    .nx-search-wrap     { margin-right: 0; margin-left: 16px; }
    .nx-search-icon     { left: auto; right: 10px; }
    .nx-search-input    { padding-left: 12px; padding-right: 34px; }
    .nx-search-dropdown { left: auto; right: 0; }

    /* ── Left sidebar nav ── */
    .nx-left-nav-item   { flex-direction: row-reverse; }
    .nx-left-nav-item svg { margin-right: 0; margin-left: 12px; }
    .nx-sidebar-profile-card { text-align: center; }
    .nx-sidebar-card-stats { direction: rtl; }

    /* ── Post card ── */
    .nx-post-header     { flex-direction: row-reverse; }
    .nx-post-author     { flex-direction: row-reverse; }
    .nx-post-author-name { text-align: right; }
    .nx-post-options-btn { margin-left: 0; margin-right: auto; }
    .nx-post-options-dropdown { left: 0; right: auto; }
    .nx-post-content    { text-align: right; }
    .nx-reaction-bar    { flex-direction: row-reverse; }
    .nx-reaction-btn    { flex-direction: row-reverse; gap: 4px; }
    .nx-comment-avatar  { margin-right: 0; margin-left: 8px; }
    .nx-comment-body    { text-align: right; }

    /* ── Composer ── */
    .nx-composer-header  { flex-direction: row-reverse; }
    .nx-composer-actions { flex-direction: row-reverse; }
    .nx-composer-more-wrap { margin-right: 0; margin-left: auto; }
    .nx-composer-more-dropdown { left: auto; right: 0; }
    .nx-composer-submit  { margin-left: 0; margin-right: auto; }

    /* ── Notifications dropdown ── */
    .nx-notif-dropdown  { left: 0; right: auto; }
    .nx-notif-item      { flex-direction: row-reverse; text-align: right; }
    .nx-notif-item-avatar { margin-right: 0; margin-left: 10px; }

    /* ── User menu dropdown ── */
    .nx-user-menu        { left: 0; right: auto; }
    .nx-user-menu-profile { flex-direction: row-reverse; }
    .nx-dropdown-item    { flex-direction: row-reverse; }
    .nx-dropdown-item svg { margin-right: 0; margin-left: 10px; }

    /* ── Stories ── */
    .nx-stories-bar      { flex-direction: row-reverse; }
    .nx-story-meta       { text-align: right; }

    /* ── Poll ── */
    .nx-poll-option      { flex-direction: row-reverse; }
    .nx-poll-bar         { left: auto; right: 0; }
    .nx-poll-pct         { text-align: left; }

    /* ── Messages ── */
    .nx-conv-list        { direction: rtl; }
    .nx-conv-item        { flex-direction: row-reverse; }
    .nx-conv-meta        { text-align: right; }
    .nx-msg-bubble.is-mine { align-items: flex-start; }
    .nx-msg-bubble.is-theirs { align-items: flex-end; }
    .nx-msg-input-wrap   { flex-direction: row-reverse; }

    /* ── Profile ── */
    .nx-profile-info     { text-align: right; }
    .nx-profile-actions  { flex-direction: row-reverse; }
    .nx-profile-stat-list { flex-direction: row-reverse; }
    .nx-about-row        { flex-direction: row-reverse; }
    .nx-about-icon       { margin-right: 0; margin-left: 10px; }

    /* ── Marketplace ── */
    .nx-listing-card     { text-align: right; }
    .nx-listing-price    { text-align: right; }

    /* ── Groups ── */
    .nx-group-card       { text-align: right; }
    .nx-group-header-meta { text-align: right; }

    /* ── Forms ── */
    .nx-input            { text-align: right; direction: rtl; }
    .nx-textarea         { text-align: right; direction: rtl; }
    label                { display: block; text-align: right; }

    /* ── Badges / counts ── */
    .nx-badge            { left: auto; right: -6px; }

    /* ── Link preview ── */
    .nx-link-preview-body { text-align: right; }
    .nx-post-link-card-body { text-align: right; }

    /* ── Analytics modal ── */
    .nx-analytics-grid   { direction: rtl; }
    .nx-stat-card        { text-align: right; }

    /* ── Mobile bottom nav ── */
    .nx-mobile-nav       { flex-direction: row-reverse; }

    /* ── Modals ── */
    .nx-modal-header     { flex-direction: row-reverse; }
    .nx-modal-close      { margin-left: 0; margin-right: auto; }
}
