/* Arabic Font and RTL Support */
body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  text-align: right;
}

/* Professional Color Scheme - Brand Colors */
:root {
  --primary-color: #3e3d6a;
  --secondary-color: #355b84;
  --success-color: #2b789b;
  --warning-color: #2293b2;
  --danger-color: #e74c3c;
  --info-color: #1aacc7;
  --light-color: #f8f9fa;
  --dark-color: #3e3d6a;
  --gradient-primary: linear-gradient(135deg, #3e3d6a 0%, #355b84 100%);
  --gradient-secondary: linear-gradient(135deg, #355b84 0%, #2b789b 100%);
  --gradient-success: linear-gradient(135deg, #2b789b 0%, #2293b2 100%);
  --gradient-info: linear-gradient(135deg, #2293b2 0%, #1aacc7 100%);
  --shadow-light: 0 2px 10px rgba(62, 61, 106, 0.1);
  --shadow-medium: 0 4px 20px rgba(62, 61, 106, 0.15);
  --shadow-heavy: 0 8px 30px rgba(62, 61, 106, 0.2);
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--primary-color);
}

.display-4 {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Professional Cards */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.card-header {
  background: var(--gradient-primary);
  border: none;
  color: white;
  font-weight: 600;
  padding: 1.25rem;
}

.card-body {
  padding: 2rem;
}

/* Enhanced Buttons */
.btn {
  border-radius: 10px;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-success {
  background: var(--gradient-success);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Professional Navigation */
.navbar {
  background: white !important;
  box-shadow: var(--shadow-light);
  border: none !important;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-link {
  font-weight: 500;
  color: var(--primary-color) !important;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--secondary-color) !important;
  transform: translateY(-1px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

/* Professional Progress Bars */
.progress {
  height: 30px;
  border-radius: 15px;
  background-color: #e9ecef;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
  border-radius: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s ease;
}

/* Enhanced Forms */
.form-control {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  font-family: 'Cairo', sans-serif;
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Professional Tables */
.table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.table thead th {
  background: var(--gradient-primary);
  color: white;
  border: none;
  font-weight: 600;
  padding: 1rem;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
  transform: scale(1.01);
}

/* Alert Enhancements */
.alert {
  border-radius: 10px;
  border: none;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
}

/* Professional Footer */
html {
  position: relative;
  min-height: 100%;
}

/* Removed margin-bottom for cleaner layout */

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80px;
  background: var(--primary-color) !important;
  color: white;
  padding: 1rem 0;
  margin-top: auto;
}

/* Animation Classes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .card-body {
    padding: 1.5rem;
  }
  
  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .display-4 {
    font-size: 2.5rem;
  }
}

/* RTL Specific Adjustments */
.navbar-nav {
  flex-direction: row-reverse;
}

.dropdown-menu {
  text-align: right;
}

.btn-group > .btn:not(:last-child):not(.dropdown-toggle) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.btn-group > .btn:not(:first-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

/* Custom Badge Styles */
.badge {
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

/* Status Badge Styles */
.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  display: inline-block;
  min-width: 120px;
}

.status-pending {
  background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
  color: #856404;
}

.status-paid {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
}

.status-accepted {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
}

.status-rejected {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.status-received {
  background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
  color: white;
}

.status-ontheway {
  background: linear-gradient(135deg, #20c997 0%, #198754 100%);
  color: white;
}

.status-delivered {
  background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
  color: white;
}

.status-confirmed {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
}

/* QR Code Display */
.qr-code-placeholder {
  text-align: center;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border: 2px solid #333;
  padding: 5px;
  background: white;
  border-radius: 8px;
}

.qr-square {
  width: 100%;
  height: 100%;
  border-radius: 1px;
  background: white;
  transition: all 0.3s ease;
}

.qr-square.bg-dark {
  background: #333;
}

/* Enhanced Smiley Buttons */
.btn-check:checked + .btn-outline-success {
  background: var(--gradient-success);
  border-color: var(--success-color);
  color: white;
  transform: scale(1.05);
}

.btn-check:checked + .btn-outline-danger {
  background: var(--gradient-secondary);
  border-color: var(--danger-color);
  color: white;
  transform: scale(1.05);
}

/* Notes Section Animation */
.notes-section {
  transition: all 0.3s ease;
}

/* Professional Input Groups */
.input-group .form-control {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .btn {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Loading Animation */
.fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Button Loading State */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn .fa-spinner {
  margin-right: 0.5rem;
}

/* Remove margin from close buttons */
.btn-close {
  margin: 0 !important;
}