/* =========================================================
   visitor.css — right-to-left overrides

   Loaded from _LocalizationAssets ONLY when the active UI culture is RTL, and
   only AFTER bootstrap.rtl.min.css. Bootstrap's own RTL build already mirrors
   the grid, spacing utilities (ms-*/me-*), forms and components, so nothing
   here repeats that work — these are the direction-sensitive rules that live in
   visitor.css itself.

   Every rule is prefixed [dir="rtl"], which raises specificity to (0,2,0) and
   makes the override independent of stylesheet load order.
   ========================================================= */

/* ---------- typography ---------- */
[dir="rtl"] body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* ---------- sidebar ----------
   Fixed to the left edge in LTR; must hug the right edge in RTL. The box-shadow
   is directional too (2px 0 casts to the right), so it is flipped to -2px. */
[dir="rtl"] .visitor-sidebar {
    left: auto;
    right: 0;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.06);
}

[dir="rtl"] .visitor-content {
    margin-left: 0;
    margin-right: 250px;
}

/* ---------- sidebar links: the active/hover accent bar ---------- */
[dir="rtl"] .sidebar-link {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar-link:hover,
[dir="rtl"] .sidebar-link.active {
    border-right-color: #1976d2;
}

[dir="rtl"] .sidebar-link-danger:hover {
    border-right-color: #c62828;
}

/* ---------- dashboard stat cards: coloured edge ---------- */
[dir="rtl"] .dash-stat-card {
    border-left: none;
    border-right: 4px solid transparent;
}

[dir="rtl"] .dash-stat-primary { border-right-color: #1976d2; }
[dir="rtl"] .dash-stat-warning { border-right-color: #ff9800; }
[dir="rtl"] .dash-stat-success { border-right-color: #4caf50; }
[dir="rtl"] .dash-stat-info    { border-right-color: #00bcd4; }

/* ---------- icon spacing ----------
   visitor.css puts `margin-right` on the <i> that precedes a label. In RTL the
   icon sits on the other side of the text, so the gap has to move with it. */
[dir="rtl"] .visitor-navbar-brand i,
[dir="rtl"] .dash-page-title i,
[dir="rtl"] .dash-chart-title i,
[dir="rtl"] .visitor-card-header i,
[dir="rtl"] .visitor-section-title i,
[dir="rtl"] .visitor-label i,
[dir="rtl"] .visitor-type-btn i,
[dir="rtl"] .visitor-submit-btn i,
[dir="rtl"] .visitor-auth-title i {
    margin-right: 0;
    margin-left: 0.4rem;
}

[dir="rtl"] .search-dropdown-arrow {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* ---------- values that must stay left-to-right ----------
   A visitor number (VIS-00123), an email, a phone number and a date are Latin
   sequences. Left to the RTL context their punctuation and hyphens jump to the
   wrong end, so the lookup field would read "00123-VIS". */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[type="password"],
[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="datetime-local"],
[dir="rtl"] .visitor-number-input {
    direction: ltr;
    text-align: right;
}

/* ---------- mobile drawer ---------- */
@media (max-width: 991.98px) {
    /* closed state slides off the right edge in RTL, not the left */
    [dir="rtl"] .visitor-sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .visitor-sidebar.open {
        transform: translateX(0);
    }

    [dir="rtl"] .visitor-content {
        margin-right: 0;
    }
}
