:root {
    --base-font-scale: 1;
}
:lang(en) {
    --base-font-scale: 0.95;
}
:lang(dr) {
    --base-font-scale: 0.85;
}
:lang(ps) {
    --base-font-scale: 1.1;
}
/* Decrease the font-scale smaller in mobile */
@media (max-width: 768px) {
    :root {
        --base-font-scale: 0.9;
    }
    :lang(en) {
        --base-font-scale: 0.82;
    }
    :lang(dr) {
        --base-font-scale: 0.78;
    }
    :lang(ps) {
        --base-font-scale: 0.78;
    }
}

@font-face {
    font-family: vazir;
    src: url('../fonts/Vazir.ttf');
}

@font-face {
    font-family: taha-b;
    src: url('../fonts/Bahij Uthman Taha-Bold.ttf');
}

.vazir {
    font-family: vazir;
}

.taha-b {
    font-family: taha-b;
}

.calibri {
    font-family: calibri;
}

.bold {
    font-weight: bold;
}

.dir-ltr {
    direction: ltr !important;
}

.dir-rtl {
    direction: rtl !important;
}

h2 {
    font-size: 1.6rem;
}

h5 {
    font-size: 1rem;
}

.small-text {
    font-size: 0.85rem;
    color: #888;
}

.text-justify {
    text-align: justify;
}
.text-gold {
    color: #f4c430 !important;
}
.text-blue {
    color: #2563EB;
}
.text-red {
    color: #DC2626;
}
.text-purple {
    color: #7C3AED;
}
.text-green {
    color: #16A34A;
}
.text-orange {
    color: #EA580C;
}

.modal-title i {
    color: #06163a;
}

.nowrap {
    white-space: nowrap;
}
.wrap {
    white-space: wrap !important;
}

.bg-soft-primary {
    background-color: rgba(10, 36, 114, 0.1);
    color: #0a2472;
}
.bg-soft-success {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--bs-success);
}
.bg-soft-danger {
    background: rgba(231, 74, 59, 0.1);
    color: var(--bs-danger);
}
.icon-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
}

#pinInput {
    letter-spacing: 12px;
    font-size: 18px;
    text-align: center;
    -webkit-text-security: disc;
    text-security: disc;
}

html {
    font-size: calc(1rem * var(--base-font-scale));
    scroll-behavior: smooth;
    /* smooth scroll globally */
    min-height: 100%;
    position: relative;
}
body {
    padding-top: 70px;
    padding-bottom: 30px;
    margin-bottom: 60px;
    overflow-x: hidden;
}

.form-signin {
    max-width: 330px;
    padding: 1rem;
}

.form-signin .form-floating:focus-within {
    z-index: 2;
}

.form-signin input[type="text"] {
    margin-bottom: -1px;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.form-signin input[type="password"] {
    margin-bottom: 10px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.text-underline {
    text-decoration: underline !important;
}

.pagination li.active a {
    background-color: #0a2472 !important;
    color: #eee !important;
    border-color: #0a2472 !important;
}
.pagination li a {
    color: #0a2472 !important;
}

/* Sticky Footer */
footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 52px;
    color: #fff !important;
    background: linear-gradient(135deg, #0a2472, #06163a) #06163a;
}
footer p {
    direction: ltr !important;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
}
/* End of Sticky Footer*/

/* Change Default Font in DatePicker */
.mds-bs-persian-datetime-picker-popover {
    font-family: vazir !important;
}

/* Bootstrap-Select */
div.filter-option-inner-inner {
    text-align: right !important;
}
a.disabled.active.selected span.bs-ok-default.check-mark {
    display: none !important;
}

.hide {
    display: none !important;
}

/* Select2 */
.select2 {
    width: 100% !important;
}

.select2-results {
    background: #f8f9fa !important;
}

.select2-selection {
    background: #f8f9fa !important;
}

.select2-container .select2-selection--single,
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    min-width: 60px;
}
/* End of Select2 */

.btn-xs {
    --bs-btn-padding-y: .25rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .75rem;
}

.d-block {
    display: block !important;
}

.d-inline {
    display: inline-block !important;
}

.d-hide-inline,
.d-hide-block {
    display: none;
}

.alert {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table {
    border-radius: 0.3rem;
    overflow: hidden;
    white-space: nowrap;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.rate {
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.currency-cell {
    white-space: nowrap;
}
.currency-flag {
    width: 2rem;
    height: 1.5rem;
    object-fit: contain;
    flex-shrink: 0;
    margin-bottom: 3px;
}

/* Print Queries */
@media print {

    .not_in_print, .alert {
        display: none !important;
    }

    .d-hide-inline {
        display: inline !important;
    }

    .d-hide-block {
        display: block !important;
    }

    .table-bordered {
        border: 1px solid #000;
    }

    ::-webkit-scrollbar,
    ::-webkit-scrollbar-track,
    ::-webkit-scrollbar-thumb {
        display: none !important;
    }
}

/* Scrollbar */
/* width */
::-webkit-scrollbar {
    width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px #0a2472;
    background-color: rgba(66, 69, 73, 0.4);
}
/* Handle */
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0a2472, #06163a);
    transition: 1s;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #2a2e32;
}
/* End of Scrollbar */

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding-left: 0;
}
.pagination li {
    margin: 0 4px;
}
.pagination li a,
.pagination li strong {
    display: block;
    padding: 6px 12px;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}
.pagination li strong {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
.pagination li.active a {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
/* End of Pagination */

/* Loading */
#loadingScreen {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10040;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #0a2472;
}
#loadingScreen img {
    width: 100px;
}
#loadingScreen .menu-sample {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #0a2472, #06163a);
}
.loadingScreenDisapear {
    animation: vanish .3s forwards;
}
@keyframes vanish {
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

input.form-control,
select.form-select,
textarea.form-control, a.btn, button.btn {
    box-shadow: var(--bs-box-shadow-sm);
}
.form-control:focus, .form-select:focus {
    border-color: #0a2472;
    outline: 2px solid rgba(10, 36, 114, 0.25);
    box-shadow: 0 0 0 0.2rem rgba(10, 36, 114, 0.25);
    transition: border-color 0.3s ease, outline 0.3s ease;
    /* box-shadow: var(--bs-box-shadow); */
}

.accordion-button:focus {
    box-shadow: none;
}

/* Dashboard Date & Time Header */
.dashboard-datetime {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #0a2472, #06163a);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}
.dashboard-date {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.dashboard-time {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-time {
        font-size: 0.9rem;
    }
    .dashboard-date {
        font-size: 0.9rem;
    }
}
@media (max-width: 350px) {
    .dashboard-datetime {
        flex-direction: column;
        gap: 0.3rem;
    }
}
/* End of Dashboard Date & Time Header */

/* Exchange Dashboard Scrollbar */
.exchange-dashboard {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.rate-card {
    position: relative;
    min-width: 200px;
    max-width: 220px;
    flex-shrink: 0;
    border-radius: 0.6rem;
    color: #fff;
    font-size: 0.9rem;
    overflow: hidden;
    
    /* Important */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Background flag + brand gradient overlay */
.rate-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
                rgba(10, 36, 114, 0.5),
                rgba(6, 22, 58, 0.6)
                );
    z-index: 0;
}

/* Each card has its own flag using inline style */
.rate-card .card-body {
    position: relative;
    z-index: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;

    /* Important */
    height: 100%;
    box-sizing: border-box;
}

.currency-header {
    font-weight: 600;
    font-size: 1rem;
}

.rate-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.rate-item:last-child {
    border-bottom: none;
}

/* Scrollbar styling */
.exchange-dashboard::-webkit-scrollbar, .table-responsive::-webkit-scrollbar {
    height: 6px;
}
.exchange-dashboard::-webkit-scrollbar-track, .table-responsive::-webkit-scrollbar-track {
    border-radius: 3px;
}
.exchange-dashboard::-webkit-scrollbar-thumb, .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
/* End of Exchange Dashboard Scrollbar */

/* Glassmorphism Card */
.glass-card {
    background: rgba(10, 36, 114, 0.85);
    border-radius: 0.8rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    color: #fff;
    width: 200px;
    margin: 0.4rem 0;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.glass-card .card-body {
    /* padding: 1rem; */
    text-align: center;
}

.glass-card .currency-header {
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.glass-card .rate-item strong {
    font-size: 1.2rem;
    font-weight: 700;
}
/* End of Glassmorphism Card */

/* Bottom Quick Links */
.quick-links {
    padding: 0.9rem;
    background: linear-gradient(90deg, #0a2472, #06163a);
    border-radius: 0.5rem;
    text-align: center;
}

.quick-btn {
    background: linear-gradient(45deg, #FFD700, #FFC107);
    color: #1a1a1a;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: 0.4rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    background-size: 200% 200%;
}

.quick-btn i {
    font-size: 1rem;
}

/* Hover effect: subtle animated gradient shift */
.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    color: #000;
    background-position: 100% 0;
}

/* Smooth gradient animation */
.quick-btn {
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 0%;
    }

    100% {
        background-position: 0% 0%;
    }
}

@media (max-width: 768px) {
    .quick-links {
        padding: 1.6rem;
    }

    .quick-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}
/* End of Bottom Quick Links */

/* Profile Page */
.profile-avatar {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #f1f3f5;
}
:lang(en) .stat-card {
    border-left: 4px solid #0a2472;
}
:lang(dr) .stat-card, :lang(ps) .stat-card {
    border-right: 4px solid #0a2472;
}
/* .stat-card.border-success {
    border: 2px dashed #198754 !important;
    background: #f8fff9;
    cursor: pointer;
    transition: 0.2s ease;
}
.stat-card.border-success:hover {
    transform: translateY(-3px);
} */
/* End of Profile Page */

/* Admin Dashboard Cards Icons */
.kpi-card {
    position: relative;
    overflow: hidden;
}
.kpi-card .bg-icon {
    position: absolute;
    left: 0.75rem;
    right: auto;
    font-size: 3.4rem;
    opacity: 0.5;
    pointer-events: none;
}
:lang(en) .bg-icon {
    right: 0.75rem;
    left: auto;
}
.kpi-card .content {
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* End of Admin Dashboard Cards Icons */

/* Admin Dashboard Flag Uploader */
.flag-uploader {
    border: 2px dashed #ced4da;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
    background-color: #f8f9fa;
}
.flag-uploader:hover {
    border-color: var(--bs-primary);
    background-color: #f1f6ff;
}
.flag-uploader.dragover {
    border-color: var(--bs-success);
    background-color: #e9f7ef;
}
.flag-uploader input {
    display: none;
}
.flag-preview {
    width: 3rem;
    height: 2.2rem;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
    margin-bottom: 0.5rem;
}
.flag-hint {
    font-size: .75rem;
    color: #6c757d;
}
/* End of Flag Uploader */

.users-preview {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
    margin-bottom: 0.5rem;
}

/* Customer Page */
.customer-balance-card {
    background: linear-gradient(135deg, #0a2472, #06163a);
    color: white;
    border: none;
    border-radius: 6px;
}
.customer-balance-card #toggleBalance {
    opacity: 0.8;
    transition: 0.2s;
}
.customer-balance-card #toggleBalance:hover {
    opacity: 1;
    transform: scale(1.1);
}
#qr-reader {
    overflow: hidden;
}
.contact-item {
    min-width: 60px;
    cursor: pointer;
}
.contact-item:hover div {
    border: 1px solid var(--bs-primary);
}
/* Fullscreen */
.scanner-screen {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}
/* Header */
.scanner-header {
    z-index: 2;
}
/* Camera */
.scanner-camera {
    flex: 1;
}
/* Overlay */
.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
/* Scan box */
.scan-box {
    width: 240px;
    height: 240px;
    border: 2px solid var(--brand-color);
    box-shadow: 0 0 20px rgba(244, 196, 48, 0.5);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}
/* Animated line */
.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--brand-color);
    animation: scanMove 2s linear infinite;
}
@keyframes scanMove {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}
/* Success overlay */
.scan-success {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--brand-color);
    font-size: 20px;
    z-index: 10;
}
.customer-balance-card,
.customer-quick-stats .card,
.customer-trxs-card {
    border-radius: 16px;
}
.customer-action-card {
    transition: 0.2s;
    cursor: pointer;
    border: none;
    border-radius: 16px;
}
.customer-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.customer-trxs-card .transaction-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.customer-trxs-card .transaction-item:last-child {
    border-bottom: none;
}
.customer-trxs-card .transaction-item {
    padding: 14px 0;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: 0.2s;
}
.customer-trxs-card .transaction-item:hover {
    background: #f9fafb;
    border-radius: 10px;
    padding-left: 8px;
    padding-right: 8px;
}

/* Bottom navbar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 65px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(12px);
    border-top: 1px solid #eee;
    z-index: 800;
}

/* Equal width items */
.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    color: #ddd;
    text-decoration: none;
    text-align: center;
}
/* Empty center space for FAB */
.bottom-nav .fab-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}
.bottom-nav .nav-item i {
    font-size: 1.2rem;
}
.bottom-nav .nav-item.active {
    color: var(--brand-color);
}
/* FAB */
.bottom-nav .nav-center {
    position: absolute;
    top: -28px;
    bottom: 2.8rem;
    background: var(--brand-color);
    color: white;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    font-size: 1.8rem;
    z-index: 800;
}
/* Backdrop */
.fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
    z-index: 900;
}
.fab-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}
/* FAB Menu */
.fab-menu {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 950;
}
.fab-menu.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.fab-menu .fab-item {
    background: white;
    padding: 12px 18px;
    border-radius: 30px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}
/* Colored actions */
.fab-menu .fab-item.pay i {
    color: #0d6efd;
}
.fab-menu .fab-item.receive i {
    color: #198754;
}
/* Icon animation */
.bottom-nav .nav-center.rotate i {
    transform: rotate(45deg);
    transition: 0.3s;
}