/**
 * RTL / Urdu Layout Stylesheet
 * File: finderpay/assets/css/rtl.css
 *
 * Loaded ONLY when lang=ur is active (see header.php).
 * Overrides Bootstrap LTR defaults and applies Noto Nastaliq Urdu font.
 */

/* ── Typography ──────────────────────────────────────────────────────────── */
body, .rtl-layout,
.rtl-layout h1, .rtl-layout h2, .rtl-layout h3,
.rtl-layout h4, .rtl-layout h5, .rtl-layout h6,
.rtl-layout p, .rtl-layout span, .rtl-layout a,
.rtl-layout label, .rtl-layout button,
.rtl-layout input, .rtl-layout select, .rtl-layout textarea,
.rtl-layout li, .rtl-layout td, .rtl-layout th {
  font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', Arial, sans-serif !important;
  line-height: 2.1 !important;   /* Urdu script needs more line height */
}

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

/* Bootstrap overrides */
.rtl-layout .ms-auto  { margin-left: 0  !important; margin-right: auto !important; }
.rtl-layout .me-auto  { margin-right: 0 !important; margin-left:  auto !important; }
.rtl-layout .ms-1     { margin-left: 0  !important; margin-right: .25rem !important; }
.rtl-layout .ms-2     { margin-left: 0  !important; margin-right: .5rem  !important; }
.rtl-layout .ms-3     { margin-left: 0  !important; margin-right: 1rem   !important; }
.rtl-layout .me-1     { margin-right: 0 !important; margin-left:  .25rem !important; }
.rtl-layout .me-2     { margin-right: 0 !important; margin-left:  .5rem  !important; }
.rtl-layout .me-3     { margin-right: 0 !important; margin-left:  1rem   !important; }
.rtl-layout .ps-3     { padding-left: 0 !important; padding-right: 1rem  !important; }
.rtl-layout .pe-3     { padding-right:0 !important; padding-left:  1rem  !important; }
.rtl-layout .text-end { text-align: left !important; }
.rtl-layout .text-start { text-align: right !important; }
.rtl-layout .float-end { float: left !important; }
.rtl-layout .float-start{ float: right !important; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.rtl-layout .navbar-nav          { flex-direction: row-reverse; }
.rtl-layout .navbar-brand        { margin-right: 0; margin-left: 1rem; }
.rtl-layout .dropdown-menu-end   { right: auto !important; left: 0 !important; }
.rtl-layout .navbar-toggler      { margin-left: 0; margin-right: auto; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.rtl-layout .form-control,
.rtl-layout .form-select,
.rtl-layout input,
.rtl-layout textarea,
.rtl-layout select {
  text-align: right;
  direction: rtl;
}
.rtl-layout .form-check          { padding-left: 0; padding-right: 1.5rem; }
.rtl-layout .form-check-input    { float: right; margin-left: 0; margin-right: -1.5em; }
.rtl-layout .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  border-radius: .375rem 0 0 .375rem !important;
}
.rtl-layout .input-group > :first-child {
  border-radius: 0 .375rem .375rem 0 !important;
}
.rtl-layout .input-group-text { border-left: 0; border-right: 1px solid #ced4da; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.rtl-layout .card-header,
.rtl-layout .card-body,
.rtl-layout .card-footer         { text-align: right; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.rtl-layout .alert               { text-align: right; }
.rtl-layout .alert-dismissible .btn-close { right: auto; lift: 0; }

/* ── Lists ───────────────────────────────────────────────────────────────── */
.rtl-layout ul, .rtl-layout ol   { padding-left: 0; padding-right: 1.5rem; }

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

/* ── Dropdown ────────────────────────────────────────────────────────────── */
.rtl-layout .dropdown-menu       { text-align: right; }
.rtl-layout .dropdown-item .fas,
.rtl-layout .dropdown-item .far  { margin-right: 0 !important; margin-left: .5rem !important; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.rtl-layout .breadcrumb-item + .breadcrumb-item::before {
  float: right;
  padding-right: 0;
  padding-left: .5rem;
  content: "\\";
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.rtl-layout .pagination          { flex-direction: row-reverse; }

/* ── Icon spacing fix ────────────────────────────────────────────────────── */
.rtl-layout .fas, .rtl-layout .far, .rtl-layout .fab {
  /* Icons before text in LTR become after text in RTL — swap their margin */
  margin-right: 0 !important;
}
/* Only apply left margin to icons that had me-1/me-2 */
.rtl-layout .fa-phone,
.rtl-layout .fa-envelope,
.rtl-layout .fa-user,
.rtl-layout .fa-sign-out-alt,
.rtl-layout .fa-sign-in-alt,
.rtl-layout .fa-user-plus,
.rtl-layout .fa-bus,
.rtl-layout .fa-star,
.rtl-layout .fa-check,
.rtl-layout .fa-times,
.rtl-layout .fa-search,
.rtl-layout .fa-filter,
.rtl-layout .fa-ticket-alt,
.rtl-layout .fa-calendar-alt,
.rtl-layout .fa-map-marker-alt   { margin-left: .35rem !important; }

/* ── Hero / Search Card ──────────────────────────────────────────────────── */
.rtl-layout .search-card         { text-align: right; }
.rtl-layout .search-card label   { display: block; }

/* ── Result Cards (search.php) ───────────────────────────────────────────── */
.rtl-layout .result-card         { direction: rtl; text-align: right; }
.rtl-layout .result-card .row    { flex-direction: row-reverse; }
.rtl-layout .fare-display        { text-align: left; }  /* keep fare LTR */
.rtl-layout .amenity-tag .fas    { margin-left: .2rem !important; margin-right: 0 !important; }

/* ── Seat Map (book.php) ─────────────────────────────────────────────────── */
.rtl-layout .seat-map-wrap       { direction: rtl; }
.rtl-layout .seat-legend         { flex-direction: row-reverse; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.rtl-layout footer               { text-align: right; direction: rtl; }
.rtl-layout footer ul            { padding-right: 0; }
.rtl-layout footer .social-links { flex-direction: row-reverse; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.rtl-layout .topbar .d-flex      { flex-direction: row-reverse; }

/* ── Popular Routes cards ────────────────────────────────────────────────── */
.rtl-layout .route-card          { text-align: right; }
.rtl-layout .route-arrow         { transform: scaleX(-1); }  /* flip → to ← */

/* ── Font size adjustment for Urdu script ────────────────────────────────── */
.rtl-layout h1              { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.rtl-layout h2              { font-size: clamp(1.3rem, 3vw, 2rem);   }
.rtl-layout h3, .rtl-layout h4 { font-size: clamp(1rem, 2.5vw, 1.5rem); }
.rtl-layout .small,
.rtl-layout small           { font-size: .85rem !important; line-height: 1.9 !important; }
.rtl-layout .btn            { font-size: .9rem; }
.rtl-layout .nav-link       { font-size: .88rem; }

/* ── Number / Price stays LTR ────────────────────────────────────────────── */
.rtl-layout .fare-display,
.rtl-layout .price-tag,
.rtl-layout code,
.rtl-layout .booking-ref     { direction: ltr; unicode-bidi: embed; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.rtl-layout .modal-header    { flex-direction: row-reverse; }
.rtl-layout .modal-header .btn-close { margin: 0 auto 0 0; }
.rtl-layout .modal-footer    { flex-direction: row-reverse; }

/* ── Scrollbar (Webkit) ──────────────────────────────────────────────────── */
.rtl-layout ::-webkit-scrollbar { width: 6px; }
.rtl-layout ::-webkit-scrollbar-thumb { background:#16a34a; border-radius:3px; }