/* assets/style.css - محسن مع تنسيق الأوقات الافتراضية */

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  margin: auto;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.header h1 {
  color: #4267b2;
  font-weight: bold;
}

.page-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
}

.btn-page {
  padding: 8px 15px;
  border-radius: 25px;
  border: 2px solid #4267b2;
  background-color: white;
  color: #4267b2;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 14px;
}

.btn-page:hover {
  background-color: #4267b2;
  color: white;
  transform: translateY(-2px);
}

.btn-page.selected {
  background-color: #4267b2 !important;
  color: white !important;
  box-shadow: 0 4px 8px rgba(66, 103, 178, 0.3);
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #4267b2;
  box-shadow: 0 0 0 0.2rem rgba(66, 103, 178, 0.25);
}

.btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(45deg, #4267b2, #365899);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(66, 103, 178, 0.4);
}

.btn-warning {
  background: linear-gradient(45deg, #ffc107, #ff9800);
  border: none;
  color: white;
}

.btn-danger {
  background: linear-gradient(45deg, #dc3545, #c82333);
  border: none;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table thead th {
  background: linear-gradient(45deg, #4267b2, #365899);
  color: white;
  font-weight: 600;
  border: none;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.alert {
  border-radius: 8px;
  border: none;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4267b2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-scheduled {
  background-color: #fff3cd;
  color: #856404;
}

.status-processing {
  background-color: #d1ecf1;
  color: #0c5460;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.card-header {
  background: linear-gradient(45deg, #4267b2, #365899);
  color: white;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

.stats-card {
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.stats-card.primary {
  background: linear-gradient(45deg, #4267b2, #365899);
  color: white;
}

.stats-card.success {
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
}

.stats-card.warning {
  background: linear-gradient(45deg, #ffc107, #ff9800);
  color: white;
}

/* تنسيق أزرار الأوقات الافتراضية */
.schedule-time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.schedule-time-presets .btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  transition: all 0.2s ease;
  border-width: 1px;
}

.schedule-time-presets .btn-outline-primary {
  border-color: #4267b2;
  color: #4267b2;
}

.schedule-time-presets .btn-outline-primary:hover {
  background-color: #4267b2;
  color: white;
  transform: scale(1.02);
}

.schedule-time-presets .btn-outline-success {
  border-color: #28a745;
  color: #28a745;
}

.schedule-time-presets .btn-outline-success:hover {
  background-color: #28a745;
  color: white;
  transform: scale(1.02);
}

.schedule-time-presets .btn-outline-warning {
  border-color: #ffc107;
  color: #ffc107;
}

.schedule-time-presets .btn-outline-warning:hover {
  background-color: #ffc107;
  color: white;
  transform: scale(1.02);
}

.schedule-time-presets .btn-outline-info {
  border-color: #17a2b8;
  color: #17a2b8;
}

.schedule-time-presets .btn-outline-info:hover {
  background-color: #17a2b8;
  color: white;
  transform: scale(1.02);
}

.schedule-time-presets .btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}

.schedule-time-presets .btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
  transform: scale(1.02);
}

/* تحسين أيقونات الأوقات */
.schedule-time-presets .btn i {
  margin-left: 4px;
  font-size: 10px;
}

/* تأثير الضغط على الأزرار */
.schedule-time-presets .btn:active {
  transform: scale(0.98);
}

/* تحسين عرض الأوقات على الشاشات الصغيرة */
@media (max-width: 576px) {
  .schedule-time-presets {
    gap: 4px;
  }

  .schedule-time-presets .btn {
    padding: 3px 6px;
    font-size: 10px;
  }
}

/* تنسيق صفحة تسجيل الدخول */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h2 {
  color: #4267b2;
  font-weight: bold;
  margin-bottom: 10px;
}

.login-header p {
  color: #666;
  font-size: 14px;
}

.form-floating .form-control {
  border: 2px solid #e9ecef;
  border-radius: 8px;
}

.form-floating .form-control:focus {
  border-color: #4267b2;
  box-shadow: 0 0 0 0.2rem rgba(66, 103, 178, 0.25);
}

.btn-login {
  width: 100%;
  padding: 12px;
  font-weight: 600;
  background: linear-gradient(45deg, #4267b2, #365899);
  border: none;
  border-radius: 8px;
  color: white;
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(66, 103, 178, 0.4);
  color: white;
}

.form-check-input:checked {
  background-color: #4267b2;
  border-color: #4267b2;
}

.alert-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
}

/* تحسينات إضافية للرسائل */
.alert {
  border-left: 4px solid transparent;
}

.alert-success {
  border-left-color: #28a745;
}

.alert-danger {
  border-left-color: #dc3545;
}

.alert-warning {
  border-left-color: #ffc107;
}

.alert-info {
  border-left-color: #17a2b8;
}

/* تحسين مؤشرات النظام */
.system-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 5px;
}

.system-indicator.online {
  background-color: #28a745;
  animation: pulse 2s infinite;
}

.system-indicator.offline {
  background-color: #dc3545;
}

.system-indicator.warning {
  background-color: #ffc107;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

/* تحسين عرض الإحصائيات */
.token-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.token-stat-item {
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #4267b2;
}

.token-stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #4267b2;
  display: block;
}

.token-stat-label {
  font-size: 12px;
  color: #6c757d;
  margin-top: 5px;
}

/* تجاوبية الجهاز المحمول */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 10px;
    border-radius: 10px;
  }

  .page-buttons {
    max-height: 150px;
  }

  .btn-page {
    padding: 6px 12px;
    font-size: 12px;
  }

  .table-responsive {
    font-size: 14px;
  }

  .btn {
    padding: 8px 15px;
    font-size: 14px;
  }

  .login-card {
    margin: 20px;
    padding: 30px 20px;
  }

  .schedule-time-presets {
    justify-content: center;
  }

  .token-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }

  .token-stat-item {
    padding: 10px;
  }

  .token-stat-value {
    font-size: 20px;
  }
}

/* تحسينات إضافية للمظهر */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.table td {
  vertical-align: middle;
}

.badge {
  font-size: 11px;
}

.text-truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* تحسين شريط التحميل */
.progress-bar-animated {
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* تحسين التوولتيب */
.tooltip {
  font-size: 12px;
}

.tooltip-inner {
  background-color: #4267b2;
  border-radius: 6px;
}

.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #4267b2;
}

.bs-tooltip-right .tooltip-arrow::before {
  border-right-color: #4267b2;
}

.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #4267b2;
}

.bs-tooltip-left .tooltip-arrow::before {
  border-left-color: #4267b2;
}

/* تحسينات للطباعة */
@media print {
  .navbar,
  .btn,
  .alert {
    display: none !important;
  }

  .container {
    background: white !important;
    box-shadow: none !important;
  }

  .table {
    border-collapse: collapse !important;
  }

  .table th,
  .table td {
    border: 1px solid #dee2e6 !important;
  }
}

/* تحسين إمكانية الوصول */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* تحسين التنقل بالكيبورد */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid #4267b2;
  outline-offset: 2px;
}

/* تحسين الألوان للأشخاص ذوي الإعاقة البصرية */
.text-muted {
  color: #6c757d !important;
}

.bg-primary {
  background-color: #4267b2 !important;
}

.border-primary {
  border-color: #4267b2 !important;
}

/* تحسين حالة التركيز للوصولية */
*:focus {
  outline: 2px solid #4267b2;
  outline-offset: 2px;
}

/* تحسين الانتقالات */
* {
  transition: all 0.2s ease-in-out;
}

.btn,
.form-control,
.card {
  transition: all 0.3s ease;
}
