:root {
    /* Color Palette */
    --primary: 210 45% 31%; /* #1E4D8C Trust Blue */
    --secondary: 30 68% 55%; /* #34495E Navy */
    --background: 210 11% 98%; /* #F7F9FC Light Grey */
    --text: 210 14% 32%; /* #2C3E50 Dark Grey */
    --success: 145 63% 42%; /* #27AE60 Success Green */
    --warning: 35 84% 62%; /* #F39C12 Warning Orange */
    --danger: 354 70% 54%; /* #E74C3C Danger Red */
    --light: 0 0% 96%; /* #F8F9FA */
    --dark: 210 11% 15%; /* #212529 */
}




/* Base Styles */
body {
    font-family: 'Source Sans Pro', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--text));
    padding-top: 76px; /* Account for fixed navbar */
}

/* RTL Support is now handled in arabic.css for better performance */

/* Language Switcher */
.language-switcher {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.language-switcher a {
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.8rem;
    color: #666;
    border: 1px solid #ddd;
}

.language-switcher a.active {
    background-color: hsl(var(--primary));
    color: white;
    border-color: hsl(var(--primary));
}

.language-switcher a:hover {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
}

/* Custom Bootstrap theme */
.bg-primary {
    background-color: hsl(var(--primary)) !important;
}

.text-primary {
    color: hsl(var(--primary)) !important;
}

.btn-primary {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
    border-color: hsl(var(--primary) / 0.9);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
    background-color: hsl(var(--light));
}

.sidebar .nav-link {
    color: hsl(var(--text));
    padding: 12px 20px;
    border-bottom: 1px solid hsl(var(--background));
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: hsl(var(--background));
    color: hsl(var(--primary));
}

.sidebar .nav-link.active {
    background-color: hsl(var(--primary));
    color: white;
}

.sidebar .nav-link i {
    width: 16px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 0;
    padding: 20px;
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 16.666667%;
    }
}

@media (min-width: 992px) {
    .main-content {
        margin-left: 16.666667%;
    }
}

/* Card Styles */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid hsl(var(--background));
    border-radius: 8px;
}

.card-header {
    background-color: hsl(var(--light));
    border-bottom: 1px solid hsl(var(--background));
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-submitted {
    background-color: hsl(200 70% 90%);
    color: hsl(200 70% 30%);
}

.status-rejected {
    background-color: hsl(var(--danger) / 0.1);
    color: hsl(var(--danger));
}

.status-payment-pending {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

.status-in-progress {
    background-color: hsl(220 70% 90%);
    color: hsl(220 70% 30%);
}

.status-letter-uploaded {
    background-color: hsl(280 70% 90%);
    color: hsl(280 70% 30%);
}

.status-letter-ready {
    background-color: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

.status-refused {
    background-color: hsl(var(--danger) / 0.1);
    color: hsl(var(--danger));
}

.status-completed {
    background-color: hsl(var(--success) / 0.2);
    color: hsl(var(--success));
    font-weight: 700;
}

.status-paid {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

.status-payment-refused {
    background-color: hsl(var(--danger) / 0.1);
    color: hsl(var(--danger));
}

.status-sent-back-to-university {
    background-color: hsl(var(--secondary) / 0.1);
    color: hsl(var(--secondary));
}

/* Form Styles */
.form-control, .form-select {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.form-control:focus, .form-select:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 0.2rem hsl(var(--primary) / 0.25);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed hsl(var(--background));
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background-color: hsl(var(--light));
    transition: all 0.2s ease;
}

.file-upload-area:hover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.05);
}

.file-upload-area.dragover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
}

/* Document Preview */
.document-preview {
    border: 1px solid hsl(var(--background));
    border-radius: 4px;
    padding: 10px;
    background-color: white;
    margin: 10px 0;
}

.document-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Table Styles */
.table {
    background-color: white;
}

.table thead th {
    background-color: hsl(var(--light));
    border-bottom: 2px solid hsl(var(--background));
    font-weight: 600;
    color: hsl(var(--text));
}

.table-hover tbody tr:hover {
    background-color: hsl(var(--background));
}

/* Action Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0 2px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: hsl(var(--background));
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: hsl(var(--primary));
    border: 2px solid white;
    box-shadow: 0 0 0 2px hsl(var(--background));
}

.timeline-content {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Filters */
.filters-panel {
    background-color: white;
    border: 1px solid hsl(var(--background));
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.8) 100%);
    color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stats-card p {
    margin-bottom: 0;
    opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        position: relative;
        top: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alerts */
.alert {
    border-radius: 4px;
    border: none;
}

.alert-success {
    background-color: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

.alert-danger {
    background-color: hsl(var(--danger) / 0.1);
    color: hsl(var(--danger));
}

.alert-warning {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

.alert-info {
    background-color: hsl(200 70% 90%);
    color: hsl(200 70% 30%);
}
