/* =====================================================================
   rtl.css  ->  wwwroot/css/rtl.css
   Load in _Layout AFTER site.css. Active only when Arabic is on
   (html has dir="rtl"). Also styles the language button.
   ===================================================================== */

/* hide the page for a split second until Arabic text is applied */
html.i18n-wait body { visibility: hidden; }

/* ---------- Language button ---------- */
.lang-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 38px; padding: 0 14px;
    border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
    background: rgba(255,255,255,.10); color: #fff;
    font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: background .2s, border-color .2s;
}
.lang-toggle:hover { background: rgba(255,90,102,.35); border-color: rgba(255,140,150,.7); }
.lang-toggle-floating { position: fixed; top: 14px; right: 14px; z-index: 6000; background: rgba(20,2,6,.85); }
html[dir="rtl"] .lang-toggle-floating { right: auto; left: 14px; }

/* ---------- Arabic font ---------- */
html[dir="rtl"] body, html[dir="rtl"] button, html[dir="rtl"] input,
html[dir="rtl"] select, html[dir="rtl"] textarea {
    font-family: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}
html[dir="rtl"] .dashboard-eyebrow,
html[dir="rtl"] .dashboard-section-kicker { letter-spacing: 0 !important; }

/* ---------- Bootstrap (LTR build) helpers flipped ---------- */
html[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir="rtl"] .me-auto { margin-right: 0 !important; margin-left: auto !important; }
html[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
html[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }
html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }
html[dir="rtl"] .dropdown-menu-end { right: auto !important; left: 0 !important; }
html[dir="rtl"] .dropdown-menu { text-align: right; }
html[dir="rtl"] .modal-header .btn-close { margin: 0 auto 0 0; }
html[dir="rtl"] .form-check { padding-left: 0; padding-right: 1.5em; }
html[dir="rtl"] .form-check .form-check-input { float: right; margin-left: 0; margin-right: -1.5em; }

/* ---------- Select arrow ---------- */
html[dir="rtl"] .form-select {
    background-position: left .85rem center !important;
    padding-left: 2.5rem !important; padding-right: .85rem !important;
}

/* ---------- Dashboard cards ---------- */
html[dir="rtl"] .dashboard-action-card { padding: 1.25rem 1.25rem 1.25rem 3.25rem; }
html[dir="rtl"] .dashboard-card-arrow { right: auto; left: 1.2rem; transform: translateY(-50%) scaleX(-1); }
html[dir="rtl"] .dashboard-action-link:hover .dashboard-card-arrow { transform: translateY(-50%) scaleX(-1) translateX(5px) !important; }
/* keeps the arrow vertically centered on hover (also in English) */
.dashboard-action-link:hover .dashboard-card-arrow { transform: translateY(-50%) translateX(5px) !important; }
html[dir="rtl"] .dashboard-hero::after { right: auto; left: -70px; }
html[dir="rtl"] .bi-chevron-right, html[dir="rtl"] .bi-arrow-right { display: inline-block; transform: scaleX(-1); }

/* numbers / money stay readable */
html[dir="rtl"] .dashboard-value,
html[dir="rtl"] .dashboard-financial-box strong,
html[dir="rtl"] .dashboard-mini-stats strong { direction: ltr; unicode-bidi: plaintext; display: block; }
html[dir="rtl"] input[type="number"], html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="date"], html[dir="rtl"] input[type="time"],
html[dir="rtl"] input[type="email"] { direction: ltr; text-align: right; }

/* ---------- Tables ---------- */
html[dir="rtl"] .table th, html[dir="rtl"] .table td { text-align: right; }
html[dir="rtl"] .table .text-end { text-align: left !important; }
html[dir="rtl"] .table .text-center { text-align: center !important; }

/* ---------- Charts stay left-to-right ---------- */
html[dir="rtl"] canvas { direction: ltr; }

/* ---------- Input groups (login page, copy-link boxes) ---------- */
html[dir="rtl"] .input-group > .input-group-text:first-child { border-radius: 0 .5rem .5rem 0 !important; }
html[dir="rtl"] .input-group > .form-control:last-child { border-radius: .5rem 0 0 .5rem !important; margin-right: -1px; margin-left: 0; }
html[dir="rtl"] .input-group > .form-control:not(:last-child) { border-radius: 0 !important; }
html[dir="rtl"] .input-group > .btn:last-child { border-radius: .5rem 0 0 .5rem !important; }

/* ---------- Notifications dropdown: solid dark-red panel above the page ---------- */
header { position: relative; z-index: 1060; }
.notification-dropdown,
.dropdown-menu.notification-dropdown {
    background: #2a070c !important;
    background-image: linear-gradient(180deg, #3a0b12 0%, #240509 100%) !important;
    border: 1px solid rgba(255, 90, 100, .35) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .65) !important;
    color: #fff !important;
    z-index: 2000 !important;
    overflow-x: hidden;
}
.notification-dropdown strong,
.notification-dropdown .fw-semibold { color: #fff !important; }
.notification-dropdown .text-muted,
.notification-dropdown .text-secondary,
.notification-dropdown .notification-message { color: rgba(255, 255, 255, .72) !important; }
.notification-dropdown .border-bottom,
.notification-dropdown .border-top { border-color: rgba(255, 255, 255, .15) !important; }
.notification-dropdown .notification-item {
    background: transparent !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.notification-dropdown .notification-item:hover { background: rgba(255, 255, 255, .08) !important; }
.notification-dropdown .notification-unread {
    background: rgba(220, 38, 60, .22) !important;
    border-left: 4px solid #ff4d5e;
}
html[dir="rtl"] .notification-dropdown .notification-unread { border-left: 0; border-right: 4px solid #ff4d5e; }
.notification-dropdown .dropdown-item.fw-semibold { color: #ffb3ba !important; }
.notification-dropdown .dropdown-item.fw-semibold:hover { background: rgba(255, 255, 255, .08) !important; }
