/* Modern Professional Dashboard Styles for Al Ahbab Dojang Platform */

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: "Cairo", sans-serif;
  direction: rtl;
  text-align: right;
}

/* Arabic Typography and RTL Support */
.font-arabic {
  font-family: "Cairo", sans-serif;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.arabic-heading {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.arabic-text {
  font-family: "Cairo", sans-serif;
  line-height: 1.6;
}

[dir="rtl"] {
  text-align: right;
}

[dir="ltr"] {
  text-align: left;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  background: rgba(249, 250, 251, 0.8);
  font-weight: 600;
  color: #374151;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(229, 231, 235, 0.5);
  background: rgba(249, 250, 251, 0.8);
  font-weight: 600;
  color: #374151;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  border-color: #6b7280;
}

.btn-secondary:hover {
  background-color: #4b5563;
  border-color: #4b5563;
}

.btn-success {
  background-color: #22c55e;
  color: white;
  border-color: #22c55e;
}

.btn-success:hover {
  background-color: #16a34a;
  border-color: #16a34a;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

.btn-warning {
  background-color: #fbbf24;
  color: white;
  border-color: #fbbf24;
}

.btn-warning:hover {
  background-color: #f59e0b;
  border-color: #f59e0b;
}

.btn-info {
  background-color: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
}

.btn-info:hover {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: rgba(255, 255, 255, 1);
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: rgba(255, 255, 255, 1);
}

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: rgba(255, 255, 255, 1);
}

.form-checkbox {
  height: 1rem;
  width: 1rem;
  color: #0ea5e9;
  border-color: #d1d5db;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.form-checkbox:checked {
  background-color: #0ea5e9;
}

.form-radio {
  height: 1rem;
  width: 1rem;
  color: #0ea5e9;
  border-color: #d1d5db;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.form-radio:checked {
  background-color: #0ea5e9;
}

/* Alert Styles */
.alert {
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.alert-success {
  background: rgba(236, 253, 245, 0.9);
  border-color: rgba(167, 243, 208, 0.5);
  color: #065f46;
}

.alert-error {
  background: rgba(254, 242, 242, 0.9);
  border-color: rgba(254, 202, 202, 0.5);
  color: #991b1b;
}

.alert-warning {
  background: rgba(255, 251, 235, 0.9);
  border-color: rgba(253, 230, 138, 0.5);
  color: #92400e;
}

.alert-info {
  background: rgba(239, 246, 255, 0.9);
  border-color: rgba(191, 219, 254, 0.5);
  color: #1e40af;
}

/* Table Styles */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
  padding: 1rem;
  text-align: right;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  transition: all 0.2s ease;
}

.table th {
  background: rgba(249, 250, 251, 0.8);
  font-weight: 600;
  color: #374151;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  background: white;
  color: #374151;
}

.table tbody tr:hover {
  background: rgba(14, 165, 233, 0.05);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.badge-primary {
  background-color: #e0f7fa;
  color: #0288d1;
}

.badge-success {
  background-color: #dcedc8;
  color: #388e3c;
}

.badge-danger {
  background-color: #ffcdd2;
  color: #c62828;
}

.badge-warning {
  background-color: #fff9c4;
  color: #f57f17;
}

.badge-info {
  background-color: #bbdefb;
  color: #1565c0;
}

.badge-secondary {
  background-color: #e0e0e0;
  color: #757575;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-inactive {
  background-color: #f3f4f6;
  color: #374151;
}

.status-pending {
  background-color: #fff9db;
  color: #f57f17;
}

.status-paid {
  background-color: #d1fae5;
  color: #065f46;
}

.status-unpaid {
  background-color: #f3f4f6;
  color: #374151;
}

/* Pagination Styles */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e5e7eb;
  background-color: white;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.pagination-info {
  font-size: 0.875rem;
  color: #374151;
}

.pagination-nav {
  display: flex;
  gap: 0.5rem;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.pagination-link.active {
  background-color: #f0f9ff;
  color: #0ea5e9;
  border-color: #0ea5e9;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  z-index: 50;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

.modal-container {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  position: relative;
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-width: 90vw;
  width: 100%;
  transition: all 0.2s ease;
}

.modal-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
  text-align: right;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 12rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  background-color: white;
  border: 1px solid #e5e7eb;
  z-index: 51;
  transition: all 0.2s ease;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f9fafb;
  color: #0ea5e9;
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(14, 165, 233, 0.1);
  border-top: 3px solid #0ea5e9;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Navigation Links */
.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: #6b7280;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #0ea5e9;
  background-color: #f0f9ff;
}

.nav-link.active {
  color: #0ea5e9;
  background-color: #f0f9ff;
  font-weight: 500;
}

.nav-link i {
  margin-left: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
}

/* Statistics Cards */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-icon {
  padding: 0.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

.bounce-in {
  animation: bounceIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
  }

  .mobile-hidden {
    display: none;
  }

  .stat-card {
    padding: 1rem;
  }

  .nav-link {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
  }

  .card {
    margin: 0.5rem;
    border-radius: 8px;
  }

  .modal-content {
    max-width: 95vw;
  }
}

@media (max-width: 640px) {
  .stat-card {
    padding: 0.75rem;
  }

  .card {
    border-radius: 0.5rem;
  }

  .modal-content {
    max-width: 98vw;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Focus Styles for Accessibility */
.focus-visible:focus {
  outline: none;
  border: 2px solid #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid;
  }

  .form-input {
    border: 2px solid;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Belt Color Classes */
.belt-white {
  background-color: #f8f9fa;
  color: #495057;
  border-color: #dee2e6;
}
.belt-yellow {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}
.belt-orange {
  background-color: #ffe8cc;
  color: #8a4a00;
  border-color: #ffcc80;
}
.belt-green {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}
.belt-blue {
  background-color: #cce7ff;
  color: #004085;
  border-color: #99d6ff;
}
.belt-brown {
  background-color: #f4e4bc;
  color: #8b4513;
  border-color: #ddbf94;
}
.belt-black {
  background-color: #343a40;
  color: #ffffff;
  border-color: #495057;
}

/* Martial Art Colors */
.ma-taekwondo {
  background-color: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.ma-hapkido {
  background-color: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.ma-haidong {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fed7aa;
}
.ma-kickboxing {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  .print-break {
    page-break-after: always;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
  }

  .card {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  .stat-card {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  .nav-link,
  .btn {
    display: none !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .dark-mode {
    background-color: #1a202c;
    color: #ffffff;
  }

  .dark-mode .card {
    background-color: #2d3748;
    border-color: #334155;
  }

  .dark-mode .form-input {
    background-color: #1a202c;
    border-color: #334155;
    color: #ffffff;
  }
}
