/* FRAS Custom Styles */

/* RTL Support */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}
 html[dir="rtl"] body {
    direction: rtl;
    text-align: right !important;
}
html[dir="ltr"] body {
    direction: ltr;
    text-align: left !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

/* Top Navbar */
.top-navbar {
    background: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #548FCC;
    font-weight: 600;
    font-size: 0.9rem;
}

.navbar-logo img {
    height: 40px;
    width: auto;
}

.navbar-center {
    display: flex;
    gap: 2rem;
}

.navbar-center .nav-link {
    color: #548FCC;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-center .nav-link:hover,
.navbar-center .nav-link.active {
    background: #e3f2fd;
    color: #548FCC;
    font-weight: 600;
}

.navbar-user {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #548FCC;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.user-menu-btn i {
    height: 25px;
    width: 25px;
}

/* Language switcher */
.lang-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f0f0f0;
    color: #548FCC;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 6px 10px;
    margin-inline-start: 10px;
    cursor: pointer;
    font-weight: 500;
}

.lang-select option {
    color: #000;
}

.user-menu-btn:hover {
    background: #548FCC;
    color: white;
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 55px;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Flip dropdown for LTR */
.user-dropdown { left: auto; right: 0; }

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #548FCC;
}

.user-info i {
    font-size: 1.5rem;
}

.user-dropdown hr {
    margin: 0.5rem 0;
    border-color: #e0e0e0;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    color: #548FCC;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-dropdown a:hover {
    background: #f5f5f5;
}

/* Main Layout */
.main-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}
/* Switch sidebar side by document direction */
/* html[dir="rtl"] .sidebar { order: 0; }
html[dir="rtl"] .content-area { order: 1; }
html[dir="ltr"] .sidebar { order: 2; } */
/* html[dir="ltr"] .content-area { order: 1; } */

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.sidebar-user-section {
    margin-bottom: 2rem;
}

.user-account-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #666;
}

.user-account-header i {
    height: 40px;
    width: 40px;
    font-size: 2rem;
    color: #548FCC;
}

[dir="rtl"] .user-account-header {
    flex-direction: row;
}
[dir="ltr"] .user-account-header {
    flex-direction: row-reverse;
}

/* Sidebar Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: #555;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.menu-item i {
    font-size: 1.2rem;
    color: #667eea;
}

.menu-item:hover,
.menu-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #548FCC;
    transform: translateX(-5px);
}

/* Reset transform when sidebar is closing - smooth transition */
.mobile-sidebar:not(.show) .menu-item {
    transform: translateX(0);
    transition: transform 0.3s ease-out;
}

.menu-item.active {
    border-right: 4px solid #548FCC;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    order: 1;
    max-width: calc(100% - 280px);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: 600;
}

/* Forms */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control::placeholder {
    color: #00000030;
}

.form-control:read-only {
    background-color: #f0f0f0;
}
.form-control:read-only:focus {
    border-color: unset;
    box-shadow: unset;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.15s ease-in-out;
}

.btn-sm {
    padding: 0.5rem 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Tables */
.table {
    border-radius: 0.5rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-group {
    direction: ltr;
}

.btn-group .btn {
    margin: 0 2px;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    text-align: right;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1050;
    min-width: 220px;
    position: absolute;
    right: 0;
    left: auto;

}

.dropdown {
    position: relative;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.dropdown-item i {
    margin-left: 8px;
    width: 20px;
}

.dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.5em;
}

/* Table Responsive - Allow dropdowns to overflow */

tbody tr {
    position: relative;
}

/* Pagination Styles */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #e0e0e0;
    color: #495057;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 12px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 20px;
}

/* Avatar Circle */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    font-weight: bold;
}


.form-check .form-check-input {
    float: unset;
    margin-left: unset;
}
/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Statistics Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-info .card-body,
.card.bg-warning .card-body {
    padding: 1.5rem;
}

/* Custom Colors */
.bg-pink {
    background-color: #e91e63 !important;
}

.text-pink {
    color: #e91e63 !important;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Dashboard Specific Styles */
.summary-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.summary-header {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #548FCC;
}

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

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card.primary {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #548FCC;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.results-section,
.notifications-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #548FCC;
}

.result-item,
.notification-item {
    padding: 1rem;
    border-right: 4px solid #667eea;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-title {
    font-weight: 600;
    color: #548FCC;
}

.result-date {
    font-size: 0.85rem;
    color: #999;
}

.result-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-complete {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-info {
    background: #e3f2fd;
    color: #1976d2;
}

/* ===========================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   =========================================== */

/* Mobile Navigation Variables */
:root {
    --mobile-sidebar-width: 280px;
    --mobile-header-height: 60px;
    --mobile-touch-target: 44px;
    --mobile-padding: 1rem;
    --mobile-font-size: 16px;
}

/* Mobile Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #548FCC;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: var(--mobile-touch-target);
    min-height: var(--mobile-touch-target);
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: rgba(84, 143, 204, 0.1);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.mobile-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar */
.mobile-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: -var(--mobile-sidebar-width);
    width: var(--mobile-sidebar-width);
    height: 100vh;
    background: white;
    z-index: 1050;
    transition: left 0.3s ease-out;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-sidebar.show {
    left: 0;
}

.mobile-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-width: var(--mobile-touch-target);
    min-height: var(--mobile-touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Mobile User Section */
.mobile-sidebar .sidebar-user-section {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.mobile-sidebar .user-account-header {
    background: transparent;
    padding: 0.75rem;
    margin-bottom: 0;
}

/* Mobile Menu Items */
.mobile-sidebar .sidebar-menu {
    padding: 1rem 0;
}

.mobile-sidebar .menu-item {
    margin: 0 1rem 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.mobile-sidebar .menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* RTL Support for Mobile Sidebar */
html[dir="rtl"] .mobile-sidebar {
    left: auto;
    right: -var(--mobile-sidebar-width);
}

html[dir="rtl"] .mobile-sidebar.show {
    right: 0;
    left: auto;
}

/* ===========================================
   RESPONSIVE BREAKPOINTS
   =========================================== */

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .navbar-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .content-area {
        padding: 1.5rem;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        order: 1;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .content-area {
        max-width: 100%;
        order: 2;
        padding: 1.5rem;
    }
    
    .navbar-center {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-sidebar {
        display: block;
        left: -var(--mobile-sidebar-width);
        visibility: hidden;
    }
    
    .mobile-sidebar.show {
        left: 0;
        visibility: visible;
    }
    
    .mobile-sidebar-overlay {
        display: block;
    }
    
    /* Hide desktop sidebar on mobile */
    .sidebar {
        display: none;
    }
    
    /* Top Navbar Mobile */
    .top-navbar {
        padding: 0.75rem 1rem;
        height: var(--mobile-header-height);
    }
    
    .navbar-container {
        padding: 0;
    }
    
    .navbar-logo {
        font-size: 0.85rem;
    }
    
    .navbar-logo img {
        height: 35px;
    }
    
    .navbar-center {
        display: none;
    }
    
    .navbar-user {
        gap: 0.5rem;
    }
    
    .user-menu-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .user-menu-btn i {
        height: 20px;
        width: 20px;
    }
    
    .lang-select {
        padding: 4px 8px;
        font-size: 0.85rem;
        margin-inline-start: 8px;
    }
    
    /* Content Area Mobile */
    .content-area {
        padding: 1rem;
        margin-top: 0;
    }
    
    /* Cards Mobile */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: var(--mobile-touch-target);
        min-width: var(--mobile-touch-target);
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    /* Forms Mobile */
    .form-control {
        font-size: var(--mobile-font-size);
        padding: 0.75rem;
        min-height: var(--mobile-touch-target);
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    /* Tables Mobile */
    .table-responsive {
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .table th:first-child,
    .table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 10;
    }
    
    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Dropdowns Mobile */
    .dropdown-menu {
        min-width: 200px;
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Pagination Mobile */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: var(--mobile-touch-target);
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Alerts Mobile */
    .alert {
        font-size: 0.9rem;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* User Dropdown Mobile */
    .user-dropdown {
        min-width: 180px;
        right: 0;
        left: auto;
    }
    
    /* Menu Items Mobile */
    .menu-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .menu-item i {
        font-size: 1.1rem;
        width: 20px;
    }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
    .top-navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-logo span {
        display: none;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.625rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .stats-grid {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    /* Mobile specific utilities */
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-visible {
        display: block !important;
    }
}

/* Extra Small Devices */
@media (max-width: 375px) {
    .content-area {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.375rem 0.125rem;
        font-size: 0.7rem;
    }
    
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
   
}
