/* ================================================================
   TEAMWARS RTL (Right-to-Left) Support Stylesheet
   Arabic Language Support (العربية)
   ================================================================ */

/* ================================================================
   1. BASE RTL OVERRIDES
   ================================================================ */

/* Text direction and alignment */
[dir="rtl"] body,
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .text-left {
  text-align: right !important;
}

[dir="rtl"] .text-right {
  text-align: left !important;
}

/* ================================================================
   2. MARGINS & PADDINGS FLIP
   ================================================================ */

[dir="rtl"] .ml-auto { margin-right: auto !important; margin-left: 0 !important; }
[dir="rtl"] .mr-auto { margin-left: auto !important; margin-right: 0 !important; }

[dir="rtl"] .ml-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
[dir="rtl"] .ml-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
[dir="rtl"] .ml-3 { margin-right: 1rem !important; margin-left: 0 !important; }
[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
[dir="rtl"] .ml-5 { margin-right: 3rem !important; margin-left: 0 !important; }

[dir="rtl"] .mr-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
[dir="rtl"] .mr-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
[dir="rtl"] .mr-3 { margin-left: 1rem !important; margin-right: 0 !important; }
[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
[dir="rtl"] .mr-5 { margin-left: 3rem !important; margin-right: 0 !important; }

[dir="rtl"] .pl-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
[dir="rtl"] .pl-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
[dir="rtl"] .pl-3 { padding-right: 1rem !important; padding-left: 0 !important; }
[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
[dir="rtl"] .pl-5 { padding-right: 3rem !important; padding-left: 0 !important; }

[dir="rtl"] .pr-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
[dir="rtl"] .pr-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
[dir="rtl"] .pr-3 { padding-left: 1rem !important; padding-right: 0 !important; }
[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
[dir="rtl"] .pr-5 { padding-left: 3rem !important; padding-right: 0 !important; }

/* ================================================================
   3. FLOATS FLIP
   ================================================================ */

[dir="rtl"] .float-left { float: right !important; }
[dir="rtl"] .float-right { float: left !important; }

/* ================================================================
   4. FLEXBOX DIRECTION FLIP
   ================================================================ */

[dir="rtl"] .flex-row { flex-direction: row-reverse !important; }
[dir="rtl"] .flex-row-reverse { flex-direction: row !important; }

/* Keep certain flex containers LTR (icons, avatars, etc.) */
[dir="rtl"] .flex-ltr,
[dir="rtl"] .d-flex.flex-ltr {
  flex-direction: row !important;
}

/* ================================================================
   5. NAVIGATION & HEADER
   ================================================================ */

[dir="rtl"] .navbar-nav {
  padding-right: 0;
}

[dir="rtl"] .dropdown-menu {
  text-align: right;
}

[dir="rtl"] .dropdown-menu-right {
  right: auto !important;
  left: 0 !important;
}

[dir="rtl"] .dropdown-menu-left {
  left: auto !important;
  right: 0 !important;
}

/* Header logo */
[dir="rtl"] .navbar-brand {
  margin-right: 0;
  margin-left: 1rem;
}

/* ================================================================
   6. SIDEBAR
   ================================================================ */

[dir="rtl"] .sidebar,
[dir="rtl"] #sidebar-container {
  right: 0;
  left: auto;
}

[dir="rtl"] .sidebar .nav-link {
  padding-right: 1rem;
  padding-left: 0;
}

[dir="rtl"] .sidebar .nav-link i,
[dir="rtl"] .sidebar .nav-link .fa,
[dir="rtl"] .sidebar .nav-link .fas,
[dir="rtl"] .sidebar .nav-link .far {
  margin-right: 0;
  margin-left: 0.5rem;
}

/* ================================================================
   7. FORMS
   ================================================================ */

[dir="rtl"] .form-control,
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="password"],
[dir="rtl"] input[type="number"],
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
}

[dir="rtl"] .input-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .input-group-prepend {
  margin-right: 0;
  margin-left: -1px;
}

[dir="rtl"] .input-group-append {
  margin-left: 0;
  margin-right: -1px;
}

[dir="rtl"] .input-group > .form-control:not(:last-child),
[dir="rtl"] .input-group > .custom-select:not(:last-child) {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

[dir="rtl"] .input-group > .form-control:not(:first-child),
[dir="rtl"] .input-group > .custom-select:not(:first-child) {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* ================================================================
   8. BUTTONS
   ================================================================ */

[dir="rtl"] .btn-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

[dir="rtl"] .btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* ================================================================
   9. LISTS
   ================================================================ */

[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-right: 2rem;
  padding-left: 0;
}

[dir="rtl"] .list-unstyled,
[dir="rtl"] .list-inline {
  padding-right: 0;
}

[dir="rtl"] .list-group-item {
  text-align: right;
}

/* ================================================================
   10. TABLES
   ================================================================ */

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

[dir="rtl"] .table th:first-child,
[dir="rtl"] .table td:first-child {
  padding-right: 0.75rem;
}

/* ================================================================
   11. CARDS
   ================================================================ */

[dir="rtl"] .card-header,
[dir="rtl"] .card-footer,
[dir="rtl"] .card-body {
  text-align: right;
}

/* ================================================================
   12. MODALS
   ================================================================ */

[dir="rtl"] .modal-header .close {
  margin: -1rem auto -1rem -1rem;
}

[dir="rtl"] .modal-header {
  text-align: right;
}

[dir="rtl"] .modal-footer {
  flex-direction: row-reverse;
}

/* ================================================================
   13. ALERTS & NOTIFICATIONS
   ================================================================ */

[dir="rtl"] .alert {
  text-align: right;
}

[dir="rtl"] .alert-dismissible {
  padding-right: 1.25rem;
  padding-left: 4rem;
}

[dir="rtl"] .alert-dismissible .close {
  right: auto;
  left: 0;
}

/* ================================================================
   14. BADGES
   ================================================================ */

[dir="rtl"] .badge {
  margin-left: 0;
  margin-right: 0.25rem;
}

/* ================================================================
   15. BREADCRUMBS
   ================================================================ */

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding-left: 0.5rem;
  padding-right: 0;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item {
  padding-right: 0.5rem;
  padding-left: 0;
}

/* ================================================================
   16. PAGINATION
   ================================================================ */

[dir="rtl"] .pagination {
  flex-direction: row-reverse;
}

[dir="rtl"] .page-item:first-child .page-link {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

[dir="rtl"] .page-item:last-child .page-link {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* ================================================================
   17. TOOLTIPS & POPOVERS
   ================================================================ */

[dir="rtl"] .tooltip {
  text-align: right;
}

[dir="rtl"] .popover {
  text-align: right;
}

/* ================================================================
   18. ICONS
   ================================================================ */

/* Flip directional icons */
[dir="rtl"] .fa-arrow-left::before { content: "\f061"; }
[dir="rtl"] .fa-arrow-right::before { content: "\f060"; }
[dir="rtl"] .fa-chevron-left::before { content: "\f054"; }
[dir="rtl"] .fa-chevron-right::before { content: "\f053"; }
[dir="rtl"] .fa-angle-left::before { content: "\f105"; }
[dir="rtl"] .fa-angle-right::before { content: "\f104"; }
[dir="rtl"] .fa-caret-left::before { content: "\f0da"; }
[dir="rtl"] .fa-caret-right::before { content: "\f0d9"; }

/* ================================================================
   19. TEAMWARS SPECIFIC - TOURNAMENT CARDS
   ================================================================ */

[dir="rtl"] .tw-tournament-card {
  text-align: right;
}

[dir="rtl"] .tw-team-badge {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .tw-match-vs {
  direction: ltr; /* Keep VS in LTR */
}

[dir="rtl"] .tw-score {
  direction: ltr; /* Keep scores in LTR */
}

/* ================================================================
   20. TEAMWARS SPECIFIC - PLAYER STATS
   ================================================================ */

[dir="rtl"] .tw-player-card {
  text-align: right;
}

[dir="rtl"] .tw-stat-value {
  direction: ltr; /* Keep numbers in LTR */
}

[dir="rtl"] .tw-kda {
  direction: ltr; /* Keep K/D/A in LTR */
}

/* ================================================================
   21. TEAMWARS SPECIFIC - LOBBY
   ================================================================ */

[dir="rtl"] .tw-lobby-team {
  text-align: right;
}

[dir="rtl"] .tw-lobby-player {
  flex-direction: row-reverse;
}

[dir="rtl"] .tw-lobby-player-name {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* ================================================================
   22. BEACON SYSTEM
   ================================================================ */

[dir="rtl"] .bcn-card {
  text-align: right;
}

[dir="rtl"] .bcn-card .bcn-team,
[dir="rtl"] .bcn-card .bcn-player {
  flex-direction: row-reverse;
}

/* ================================================================
   23. ORGANIZER PAGE
   ================================================================ */

[dir="rtl"] .op-stat-card {
  text-align: right;
}

[dir="rtl"] .op-metrics-grid {
  direction: rtl;
}

/* ================================================================
   24. CHAT / MESSAGING
   ================================================================ */

[dir="rtl"] .chat-message {
  text-align: right;
}

[dir="rtl"] .chat-message.mine {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .chat-message.theirs {
  margin-right: 0;
  margin-left: auto;
}

/* ================================================================
   25. ANIMATIONS - Keep LTR
   ================================================================ */

[dir="rtl"] .tw-shimmer,
[dir="rtl"] .tw-gradient-shift {
  direction: ltr;
}

/* ================================================================
   26. SEARCH
   ================================================================ */

[dir="rtl"] .search-results {
  text-align: right;
}

[dir="rtl"] .search-item {
  flex-direction: row-reverse;
}

/* ================================================================
   27. RANKINGS / LEADERBOARD
   ================================================================ */

[dir="rtl"] .ranking-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .ranking-position {
  margin-right: 0;
  margin-left: 1rem;
}

/* ================================================================
   28. FOOTER
   ================================================================ */

[dir="rtl"] .footer {
  text-align: right;
}

[dir="rtl"] .footer-links {
  padding-right: 0;
}

/* ================================================================
   29. UTILITY: FORCE LTR
   Keep certain elements always LTR (numbers, codes, etc.)
   ================================================================ */

[dir="rtl"] .ltr,
[dir="rtl"] .force-ltr,
[dir="rtl"] code,
[dir="rtl"] pre,
[dir="rtl"] kbd,
[dir="rtl"] .monospace {
  direction: ltr;
  text-align: left;
}

/* Phone numbers, dates, times */
[dir="rtl"] .phone-number,
[dir="rtl"] .datetime,
[dir="rtl"] .timestamp {
  direction: ltr;
  unicode-bidi: embed;
}

/* ================================================================
   30. RESPONSIVE RTL ADJUSTMENTS
   ================================================================ */

@media (max-width: 768px) {
  [dir="rtl"] .mobile-nav {
    text-align: right;
  }

  [dir="rtl"] .tw-mobile-bottom-nav {
    direction: rtl;
  }
}

/* ================================================================
   31. ARABIC FONT OPTIMIZATION
   ================================================================ */

[dir="rtl"] body {
  font-family: "TW Sans", sans-serif;
}

/* Increase line height for Arabic readability */
[dir="rtl"] p,
[dir="rtl"] .text-content {
  line-height: 1.8;
}

/* ================================================================
   32. SCROLL BEHAVIOR
   ================================================================ */

[dir="rtl"] ::-webkit-scrollbar {
  direction: ltr;
}

/* ================================================================
   33. SLICK CAROUSEL RTL SUPPORT
   ================================================================ */

/* Slick slider RTL desteği */
[dir="rtl"] .slick-slider {
  direction: ltr !important; /* Slider container LTR olmalı, içerik RTL yönetiyor */
}

[dir="rtl"] .slick-list {
  direction: ltr !important;
  overflow: hidden !important;
}

[dir="rtl"] .slick-track {
  direction: ltr !important;
  display: flex !important;
}

[dir="rtl"] .slick-slide {
  direction: rtl; /* Slide içeriği RTL */
  float: none !important; /* Float yerine flex kullan */
  flex-shrink: 0;
}

/* Safari/WebKit RTL fix */
[dir="rtl"] .tw-slider-wrap {
  direction: ltr !important;
  transform: translateZ(0); /* GPU acceleration for Safari */
  -webkit-transform: translateZ(0);
  min-height: 200px; /* Safari height collapse fix */
}

[dir="rtl"] .tw-slider {
  direction: ltr !important;
  width: 100% !important;
  visibility: visible !important;
  min-height: 200px;
}

[dir="rtl"] .tw-slider .slick-slide img {
  min-height: 200px;
  width: 100% !important;
}

/* Okları ters çevir */
[dir="rtl"] .tw-slider .slick-prev:before {
  content: '\203a'; /* > işareti - sağa */
}

[dir="rtl"] .tw-slider .slick-next:before {
  content: '\2039'; /* < işareti - sola */
}

/* Dots hizalama */
[dir="rtl"] .slick-dots {
  direction: ltr; /* Dots sırası korunsun */
}

/* ================================================================
   34. HOMEPAGE MARQUEE RTL SUPPORT
   ================================================================ */

/* Organizatör + Yayıncı marquee: RTL'de yön ters */
[dir="rtl"] .tw-org-marquee {
  direction: ltr !important; /* Track container LTR kalmalı — JS translateX ile yönetiliyor */
}

[dir="rtl"] .tw-org-track {
  direction: ltr !important;
  flex-direction: row !important;
}

/* Kart içeriği RTL kalabilir */
[dir="rtl"] .tw-org-card {
  direction: rtl;
}

/* HOF (Başarı Hikayeleri) oyuncu marquee: RTL'de yön ters */
[dir="rtl"] .tw-mk-outer {
  direction: ltr !important;
}

[dir="rtl"] .tw-mk-wrap {
  direction: ltr !important;
  flex-direction: row !important;
}

/* Kart içeriği RTL kalabilir */
[dir="rtl"] .tw-mk-card {
  direction: rtl;
}

/* ================================================================
   END OF RTL STYLESHEET
   ================================================================ */
