/**
 * Modern Universal Theme & Multi-Language System
 * Supports: LTR (English, French) & RTL (Arabic) + Dark & Light Modes
 */

/* ==========================================================================
   1. Theme Color Variables (Dark & Light)
   ========================================================================== */
:root {
  /* Light Theme Defaults */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  
  /* Primary Accent Colors */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --accent-color: #8b5cf6;

  /* Typography */
  --font-family-en: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-ar: 'Cairo', 'Tajawal', 'Segoe UI', sans-serif;
  --font-family-current: var(--font-family-en);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-sidebar: #111827;
  --bg-header: #151c2c;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. Direction & Layout Rules (LTR / RTL Support)
   ========================================================================== */
html[dir="ltr"] {
  --font-family-current: var(--font-family-en);
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] {
  --font-family-current: var(--font-family-ar);
  direction: rtl;
  text-align: right;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family-current);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Logical Alignment Utilities */
.text-start-dir {
  text-align: start !important;
}

.text-end-dir {
  text-align: end !important;
}

.ps-dir {
  padding-inline-start: 1rem;
}

.pe-dir {
  padding-inline-end: 1rem;
}

.ms-dir {
  margin-inline-start: 1rem;
}

.me-dir {
  margin-inline-end: 1rem;
}

/* Automatic Direction for User-Generated Dynamic Content */
[dir="auto"] {
  unicode-bidi: plaintext;
  text-align: start;
}

/* ==========================================================================
   3. Base Cards & Components UI Styling
   ========================================================================== */
.theme-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.theme-card:hover {
  box-shadow: var(--shadow-md);
}

.theme-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
}

.theme-sidebar {
  background-color: var(--bg-sidebar);
  border-inline-end: 1px solid var(--border-color);
}

/* Language & Theme Switcher Widget */
.theme-switcher-btn,
.lang-switcher-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-switcher-btn:hover,
.lang-switcher-dropdown:hover {
  background-color: var(--border-color);
}

/* ==========================================================================
   4. Universal Owl Carousel Arrows & Dots Styling
   ========================================================================== */
.owl-carousel .owl-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  margin-top: 24px !important;
  margin-bottom: 8px !important;
  text-align: center !important;
  width: 100% !important;
  position: static !important;
}

.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next,
.owl-carousel .owl-nav .owl-prev,
.owl-carousel .owl-nav .owl-next {
  width: 46px !important;
  height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background: var(--bg-card, #ffffff) !important;
  color: var(--primary, var(--primary-color, #6f42c1)) !important;
  border: 1.5px solid var(--border-color, rgba(0, 0, 0, 0.12)) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.owl-carousel .owl-nav button.owl-prev:hover,
.owl-carousel .owl-nav button.owl-next:hover,
.owl-carousel .owl-nav .owl-prev:hover,
.owl-carousel .owl-nav .owl-next:hover {
  background: var(--primary, var(--primary-color, #6f42c1)) !important;
  border-color: var(--primary, var(--primary-color, #6f42c1)) !important;
  color: #ffffff !important;
  transform: translateY(-3px) scale(1.08) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
}

.owl-carousel .owl-nav button i,
.owl-carousel .owl-nav button span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.owl-carousel .owl-dots {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: 18px !important;
  width: 100% !important;
}

.owl-carousel .owl-dots .owl-dot span {
  width: 10px !important;
  height: 10px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.18) !important;
  transition: all 0.3s ease !important;
}

[data-theme="dark"] .owl-carousel .owl-dots .owl-dot span,
body.dark-mode .owl-carousel .owl-dots .owl-dot span {
  background: rgba(255, 255, 255, 0.2) !important;
}

.owl-carousel .owl-dots .owl-dot.active span {
  width: 28px !important;
  border-radius: 12px !important;
  background: var(--primary, var(--primary-color, #6f42c1)) !important;
}

