/* RTL-Friendly Styles */
html, body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    font-weight: 400;
}

* {
    box-sizing: border-box;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wN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color: white;
}

.blazor-error-boundary::after {
    content: "حدث خطأ في التطبيق."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Custom Layout Styles */
.main-layout {
    display: flex;
    min-height: 100vh;
    flex-direction: row; /* RTL: sidebar will be on the right naturally */
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e3a5f 0%, #2c3e50 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1); /* Shadow on the right in RTL */
    border-left: 1px solid rgba(255,255,255,0.1); /* Border on the left (right side in RTL) */
    overflow-y: auto;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

.top-bar {
    background: #ffffff;
    color: #2c3e50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e9ecef;
    z-index: 10;
}

.content-area {
    padding: 2rem;
    flex-grow: 1;
    background-color: #f8f9fa;
    overflow-y: auto;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #1e3a5f;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: row-reverse;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: #1b6ec2;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Radzen Overrides for RTL */
.rz-datatable {
    direction: rtl;
}

.rz-paginator {
    direction: rtl;
}

/* RTL Enhancements */

/* Radzen Components RTL Support */
.rz-dialog,
.rz-dialog-content,
.rz-dropdown,
.rz-dropdown-panel,
.rz-menu,
.rz-menu-list,
.rz-tabs,
.rz-tabpanel {
    direction: rtl;
    text-align: right;
}

/* Form elements RTL */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    text-align: right;
    direction: rtl;
}

/* Buttons and actions RTL */
.rz-button-group {
    direction: rtl;
}

/* Grid and table RTL */
table {
    direction: rtl;
}

th, td {
    text-align: right;
}

/* Nav menu RTL */
.nav-menu {
    direction: rtl;
}

/* Bootstrap Nav Menu Styling */
.nav-menu .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-weight: 500;
}

.nav-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(-4px);
}

.nav-menu .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
}

.nav-menu .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}


/* Content area RTL */
.content-area {
    direction: rtl;
}

/* Dialog buttons RTL */
.rz-dialog-footer {
    direction: rtl;
    flex-direction: row-reverse;
    justify-content: flex-start;
}

/* Form labels RTL */
label {
    text-align: right;
    direction: rtl;
}

/* Radzen Label RTL */
.rz-label {
    text-align: right;
}

/* Radzen TextBox, Numeric, etc. RTL */
.rz-textbox,
.rz-numeric,
.rz-dropdown,
.rz-datepicker {
    direction: rtl;
    text-align: right;
}

/* Exclude icons from font change - Restore original icon fonts */
/*.material-icons,
.material-icons-outlined,
.material-icons-round,
.material-icons-sharp,
.material-symbols,
.material-symbols-outlined,
.material-symbols-rounded,
.material-symbols-sharp,
[class^="material-icons"],
[class*=" material-icons"],
[class^="material-symbols"],
[class*=" material-symbols"],
.rz-icon,
.rz-button-icon,
.rz-nav-link-icon,
.rz-panel-menu-item-icon,
.rz-tabs-item-icon,
.rz-menu-item-icon,
.rz-icon-wrapper,
[class*="rz-icon"],
i[class^="bi"],
i[class*=" bi"],
.bi,
.rz-button .material-icons,
.rz-button .material-symbols,
.rz-button [class*="material"],
.rz-nav-link .material-icons,
.rz-nav-link .material-symbols,
.rz-panel-menu-item .material-icons,
.rz-panel-menu-item .material-symbols,
.rz-tabs-item .material-icons,
.rz-tabs-item .material-symbols,
.rz-menu-item .material-icons,
.rz-menu-item .material-symbols,
.material-icons::before,
.material-icons::after,
.material-symbols::before,
.material-symbols::after,
.rz-icon::before,
.rz-icon::after,
.rz-button-icon::before,
.rz-button-icon::after,
[class*="rz-icon"]::before,
[class*="rz-icon"]::after,
.bi::before,
.bi::after,
[class*="material"]::before,
[class*="material"]::after {
    font-family: 'Material Symbols Outlined', 'Material Icons', 'Material Icons Outlined', 'Material Icons Round', 'Material Icons Sharp', 'Bootstrap Icons', sans-serif !important;
    font-style: normal !important;
    font-weight: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    direction: ltr !important;
}*/

/* Apply Tajawal font to headings and paragraphs (excluding icons) */
/*h1, h2, h3, h4, h5, h6,
p, span, div, a, label,
input, textarea, select,
button, .btn,
strong, b, em, small,
i:not(.bi):not([class^="bi"]):not([class*=" bi"]):not(.material-icons):not(.material-symbols):not([class*="material"]) {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}*/

/* Apply Tajawal font to all Radzen components (text only, not icons) */
/*.rz-panel-menu,
.rz-panel-menu-item,
.rz-panel-menu-item-text:not(.material-icons):not(.material-symbols),
.rz-button,
.rz-button-text,
.rz-label,
.rz-label-text,
.rz-tabs,
.rz-tabpanel,
.rz-tabs-item,
.rz-tabs-item-text,
.rz-badge,
.rz-badge-text,
.rz-textbox,
.rz-textbox-input,
.rz-numeric,
.rz-numeric-input,
.rz-dropdown,
.rz-dropdown-text,
.rz-datepicker,
.rz-datepicker-input,
.rz-checkbox,
.rz-checkbox-label,
.rz-radiobutton,
.rz-radiobutton-label,
.rz-dialog,
.rz-dialog-title,
.rz-dialog-content,
.rz-dialog-footer,
.rz-notification,
.rz-notification-message,
.rz-menu,
.rz-menu-item,
.rz-menu-item-text,
.rz-datatable,
.rz-datatable-header,
.rz-datatable-body,
.rz-datatable-footer,
.rz-datatable-header-cell,
.rz-datatable-body-cell,
.rz-paginator,
.rz-paginator-text,
.rz-progressbar,
.rz-progressbar-label,
.rz-tooltip,
.rz-tooltip-text,
.rz-popup,
.rz-card,
.rz-card-title,
.rz-card-content,
.rz-card-footer,
.rz-progressbar-circular,
.rz-progressbar-circular-text {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}*/

/* Ensure all text in Radzen components uses Tajawal (except icons) */
/*.rz-panel-menu *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-button *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-label *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-tabs *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-tabs-item *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-badge *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-dialog *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-notification *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-menu *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-datatable *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]),
.rz-paginator *:not(.material-icons):not(.material-symbols):not([class*="material"]):not(.rz-icon):not(.rz-button-icon):not([class*="rz-icon"]) {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}
*/