/* Arabic RTL Dashboard Styles */
* {
    font-family: 'Cairo', sans-serif;
}

html {
    font-size: 14px;
    direction: rtl;
    text-align: right;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    border-left: 1px solid #dee2e6;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-brand {
    text-align: center;
}

.sidebar-brand i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #ffd700;
}

.sidebar-brand h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.2rem;
}

.sidebar-brand small {
    font-size: 0.85rem;
    opacity: 0.8;
    display: block;
    margin-top: 0.25rem;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #333;
    background:white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.sidebar-item:hover {
    background-color: #f8f9fa;
    color: #667eea;
    text-decoration: none;
    border-right-color: #667eea;
}

.sidebar-item.active {
    background-color: #e3f2fd;
    border-right-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.sidebar-item i {
    font-size: 1.2rem;
    margin-left: 1rem;
    width: 20px;
    text-align: center;
    color: #667eea;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    display: flex;
    flex-direction: column;
}

/* Top Navigation */
.top-navbar {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    display: none;
}

.navbar-title h5 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.navbar-user .user-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-user .user-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.5rem;
    border: none;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

/* Statistics Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #f1f3f4;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.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(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    border: none;
    color: #333;
}

.btn-info {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    border: none;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Search and Filter Bar */
.search-filter-bar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Auth Layout */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
}

.auth-header {
    text-align: center;
    padding: 2rem 0 1rem 0;
    color: white;
}

.auth-header h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        width: 100%;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    /* Header adjustments */
    .navbar-content {
        padding: 1rem;
    }
    
    .navbar-title h5 {
        font-size: 1rem;
    }
    
    /* Card adjustments */
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    /* Search filter bar adjustments */
    .search-filter-bar {
        padding: 1rem;
    }
    
    .search-filter-bar .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .search-filter-bar .col-md-2,
    .search-filter-bar .col-md-3,
    .search-filter-bar .col-md-4,
    .search-filter-bar .col-md-6 {
        margin-bottom: 0.75rem;
    }
    
    /* Page header adjustments */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between.align-items-center h2 {
        font-size: 1.5rem;
    }
    
    .d-flex.justify-content-between.align-items-center a {
        width: 100%;
    }
    
    /* Button groups for mobile */
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Form buttons */
    .d-flex.justify-content-between .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Enhanced Table Responsiveness */
@media (max-width: 992px) {
    /* Make tables scroll horizontally on medium screens */
    .table-responsive {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    /* Adjust table text for better readability */
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Badge adjustments */
    .badge {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Stats cards on tablet */
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .stats-card i {
        font-size: 2.5rem;
    }
}

/* Mobile-specific table improvements */
@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th {
        padding: 0.5rem 0.35rem;
        font-size: 0.75rem;
    }
    
    .table tbody td {
        padding: 0.5rem 0.35rem;
    }
    
    /* Stack table cells icons and text */
    .table .d-flex.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.25rem;
    }
    
    .table .d-flex.align-items-center i {
        margin-left: 0 !important;
        margin-bottom: 0.25rem;
    }
    
    /* Reduce icon sizes in tables */
    .table .bi {
        font-size: 1rem !important;
    }
    
    /* Make action buttons more compact */
    .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .btn-sm i {
        font-size: 0.875rem;
    }
    
    /* Hide less important columns on mobile */
    .table th:nth-child(6),
    .table td:nth-child(6) {
        display: none;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    /* Further reduce padding */
    .page-content {
        padding: 0.75rem;
    }
    
    .search-filter-bar {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    /* Make buttons full width on very small screens */
    .btn:not(.btn-sm):not(.btn-group .btn) {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Stack navbar elements */
    .navbar-content {
        flex-wrap: wrap;
        padding: 0.75rem;
    }
    
    .navbar-user {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .navbar-user .user-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Reduce stats card size */
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card h3 {
        font-size: 1.75rem;
    }
    
    .stats-card p {
        font-size: 0.9rem;
    }
    
    .stats-card i {
        font-size: 2rem;
    }
    
    /* Table improvements for very small screens */
    .table {
        font-size: 0.75rem;
    }
    
    /* Hide additional columns on very small screens */
    .table th:nth-child(3),
    .table td:nth-child(3),
    .table th:nth-child(5),
    .table td:nth-child(5) {
        display: none;
    }
    
    /* Make sure action column is always visible */
    .table th:last-child,
    .table td:last-child {
        display: table-cell !important;
        position: sticky;
        left: 0;
        background: white;
    }
    
    .table tbody tr:hover td:last-child {
        background-color: #f8f9fa;
    }
    
    /* Auth pages mobile improvements */
    .auth-header h3 {
        font-size: 1.75rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .auth-logo {
        height: 50px;
    }
    
    .auth-logo-container {
        gap: 1rem;
    }
}

/* Landscape orientation improvements */
@media (max-width: 992px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }
    
    .auth-header {
        padding: 1rem 0 0.5rem 0;
    }
    
    .auth-content {
        padding-top: 0.5rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .sidebar-item {
        min-height: 50px;
    }
    
    /* Remove hover effects on touch devices */
    .btn-primary:hover {
        transform: none;
    }
    
    .stats-card:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .top-navbar,
    .sidebar-toggle,
    .btn,
    .search-filter-bar {
        display: none !important;
    }
    
    .main-content {
        margin-right: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .table {
        font-size: 0.8rem;
    }
}

/* Responsive helper classes */
.hide-on-mobile {
    display: table-cell;
}

.hide-on-tablet {
    display: table-cell;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .hide-on-tablet {
        display: none !important;
    }
}

/* File size formatting */
.file-size {
    font-family: monospace;
    font-size: 0.9em;
    color: #666;
}

/* Status badges */
.status-active {
    background-color: #28a745;
}

.status-inactive {
    background-color: #dc3545;
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Logo Styles for Dashboard Sidebar */
.institutional-logos {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background:white;
    padding: 5px;
}

.logo {
    height: 45px;
    width: auto;
    transition: all 0.3s ease;
    /*filter: brightness(0) invert(1);*/
    opacity: 0.9;
}

    .logo:hover {
        opacity: 1;
        transform: scale(1.05);
    }

/* Responsive logo sizing for sidebar */
@media (max-width: 992px) {
    .logo {
        height: 35px;
    }

    .logo-container {
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .logo {
        height: 30px;
    }

}

/* Authentication Page Logos */
.auth-logos {
    margin-bottom: 2rem;
}

.auth-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.auth-logo {
    height: 80px;
    width: auto;
    transition: all 0.3s ease;
    /*filter: brightness(0) invert(1);*/
    opacity: 0.95;
}

    .auth-logo:hover {
        opacity: 1;
        transform: scale(1.1);
    }


/* Logo Animation on Page Load */
@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.logo, .auth-logo {
    animation: logoFadeIn 0.6s ease-out;
}

/* Enhanced Sidebar Header */
.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
}

.sidebar-brand {
    margin-top: 1rem;
}

/* Alternative: Logo with Background Circle */
.logo-with-bg {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    padding: 8px;
    backdrop-filter: blur(10px);
}

/* Color variations for different logo types */
/*.university-logo {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(200deg);
}

.college-logo {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(280deg);
}

.department-logo {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(320deg);
}
*/