/* TechVerse - Complete CSS Framework */

/* ===================== ROOT VARIABLES ===================== */
:root {
  /* Dark Theme (Default) */
  --bg: #0A0F1A;
  --bg-card: #111827;
  --bg-card-hover: #1a2333;
  --primary: #3B82F6;
  --secondary: #0EA5E9;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #06B6D4;
  --text: #E5E7EB;
  --text-muted: #94A3B8;
  --border: #1F2937;
  --highlight: rgba(59, 130, 246, 0.12);
  --glow: 0 0 15px rgba(59, 130, 246, 0.28);
  --neon-glow: 0 0 16px 2px #3B82F6bb, 0 0 2px #06B6D4aa;
  --shadow-card: 0 0 28px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-lg: 20px;
  --transition: 0.28s cubic-bezier(.39, .575, .565, 1);
}

[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --primary: #2563EB;
  --secondary: #0284C7;
  --success: #059669;
  --danger: #DC2626;
  --warning: #D97706;
  --info: #0891B2;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --highlight: rgba(37, 99, 235, 0.08);
  --glow: 0 0 15px rgba(37, 99, 235, 0.15);
  --neon-glow: 0 0 16px 2px #2563EB44, 0 0 2px #0284C722;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===================== RESET & BASE ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-align: right;
  transition: background-color var(--transition), color var(--transition);
}

/* ===================== TYPOGRAPHY ===================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text) !important;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--secondary);
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}

/* ===================== LAYOUT & CONTAINERS ===================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* ===================== NAVBAR ===================== */
.navbar {
  background: var(--bg-card) !important;
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 600;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--highlight);
  color: var(--primary) !important;
}

/* ===================== BUTTONS ===================== */
.btn {
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.5rem 1.5rem;
  transition: all var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: white !important;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  background: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary) !important;
  border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white !important;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* ===================== CARDS ===================== */
.card,
.dashboard-card,
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  overflow: hidden;
  color: var(--text) !important;
}

.card:hover,
.dashboard-card:hover,
.course-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.2);
  transform: translateY(-5px);
}

.card-body {
  padding: 1.5rem;
}

/* ===================== FORMS ===================== */
.form-control,
.form-select {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text) !important;
  padding: 0.75rem 1rem;
  transition: all var(--transition);
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--text) !important;
  box-shadow: 0 0 0 3px var(--highlight);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text) !important;
}

.form-check-input {
  background-color: var(--bg-card);
  border-color: var(--border);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

/* ===================== BADGES ===================== */
.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 50px;
}

.badge-primary {
  background: var(--highlight);
  color: var(--primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* ===================== TABLES ===================== */
.table {
  color: var(--text) !important;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-dark {
  --bs-table-bg: var(--bg-card);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
  --bs-table-hover-bg: rgba(59, 130, 246, 0.1);
}

.table th {
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

/* ===================== MODALS ===================== */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===================== FOOTER ===================== */
footer {
  background: var(--bg-card);
  border-top: 2px solid var(--border);
  margin-top: auto;
  color: var(--text-muted);
}

/* ===================== UTILITY CLASSES ===================== */
.glow-text {
  text-shadow: 0 0 10px var(--primary);
}

.neon-box {
  box-shadow: var(--neon-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.shadow-tech {
  box-shadow: var(--shadow-card);
}

.animated-hover:hover {
  transform: translateY(-5px);
}

/* ===================== CUSTOM COMPONENTS ===================== */
/* Progress bars */
.progress {
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 50px;
  transition: width 0.6s ease;
}

/* Course cards */
.course-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.course-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Dashboard widgets */
.dashboard-widget {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.dashboard-widget:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* Timeline */
.timeline-item {
  position: relative;
  padding-right: 2rem;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline-item::after {
  content: '';
  position: absolute;
  right: 5px;
  top: 12px;
  bottom: -2rem;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::after {
  display: none;
}

/* ===================== RESPONSIVE DESIGN ===================== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .btn-lg {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 1rem;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* ===================== PRINT STYLES ===================== */
@media print {

  .navbar,
  footer,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* ===================== ACCESSIBILITY ===================== */
:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================== LOADING STATES ===================== */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
  border-radius: inherit;
}

/* ===================== ICON STYLES ===================== */
.icon-lg {
  font-size: 2rem;
}

.icon-xl {
  font-size: 3rem;
}

.icon-primary {
  color: var(--primary);
}

.icon-success {
  color: var(--success);
}

/* ===================== GRID SYSTEM ENHANCEMENTS ===================== */
.row.gap-3 {
  margin: -0.75rem;
}

.row.gap-3>[class*="col-"] {
  padding: 0.75rem;
}

/* ===================== CUSTOM UTILITIES ===================== */
.border-tech {
  border: 1px solid var(--border) !important;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================== FIXES FOR BOOTSTRAP RTL ===================== */
.dropdown-menu {
  text-align: right;
}

.dropdown-item {
  text-align: right;
}

.form-check {
  padding-right: 1.5em;
  padding-left: 0;
}

.form-check-input {
  margin-right: -1.5em;
  margin-left: 0;
}