/* =============================================
   LMS Linguistique — Shared Wireframe Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
  --primary: #2D6BE4;
  --primary-light: rgba(45,107,228,0.12);
  --accent: #00C9A7;
  --accent-light: rgba(0,201,167,0.12);
  --warn: #FF9900;
  --warn-light: rgba(255,153,0,0.1);
  --danger: #F85149;
  --dark: #0D1117;
  --surface: #161B22;
  --surface2: #1C2128;
  --surface3: #21262D;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #E6EDF3;
  --text2: #CDD9E5;
  --muted: #8B949E;
  --muted2: #6E7681;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Nav ---- */
.lms-nav {
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--surface2);
  color: var(--text);
}
.nav-right { display: flex; align-items: center; gap: 12px; }

/* ---- Lang Switcher ---- */
.lang-switcher {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lang-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: none;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.lang-btn.active { background: var(--primary); color: white; }
.lang-btn[data-lang="ar"] { font-family: 'Arial', sans-serif; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #3D7BF4; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #0D1117; }
.btn-accent:hover { background: #00DDB8; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.card-sm { padding: 16px; border-radius: 10px; }

/* ---- Badges / Tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.badge-blue { background: var(--primary-light); color: #6C9FFF; border: 1px solid rgba(45,107,228,0.25); }
.badge-green { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(0,201,167,0.25); }
.badge-orange { background: var(--warn-light); color: var(--warn); border: 1px solid rgba(255,153,0,0.25); }
.badge-red { background: rgba(248,81,73,0.1); color: var(--danger); border: 1px solid rgba(248,81,73,0.25); }
.badge-muted { background: var(--surface3); color: var(--muted); border: 1px solid var(--border); }

/* ---- Progress ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width 0.8s ease;
}

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; line-height: 1.2; }
h1 { font-size: clamp(28px, 4vw, 48px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 600; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }

/* ---- Sidebar Layout ---- */
.app-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 12px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--primary-light);
  color: var(--text);
}
.sidebar-link.active { color: #6C9FFF; }
.sidebar-icon { font-size: 16px; width: 20px; text-align: center; }
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0 4px;
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-trend { font-size: 12px; margin-top: 6px; }
.trend-up { color: var(--accent); }
.trend-down { color: var(--danger); }

/* ---- Table ---- */
.lms-table { width: 100%; border-collapse: collapse; }
.lms-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.lms-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text2);
}
.lms-table tr:hover td { background: var(--surface2); }
.lms-table tr:last-child td { border-bottom: none; }

/* ---- Form inputs ---- */
.lms-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.lms-input:focus { border-color: var(--primary); }
.lms-input::placeholder { color: var(--muted2); }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 8px; }

/* ---- RTL support ---- */
[dir="rtl"] {
  font-family: 'Arial', sans-serif;
}
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .lms-table th { text-align: right; }
[dir="rtl"] .lms-table td { text-align: right; }

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.animate-up { animation: fadeUp 0.5s ease-out both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ---- Avatar ---- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white; flex-shrink: 0;
}

/* ---- Chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 12px;
  background: var(--surface3); color: var(--muted); border: 1px solid var(--border);
}

/* ---- Level badges CECRL ---- */
.level { display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.level-a1 { background: rgba(248,81,73,0.15); color: #F85149; }
.level-a2 { background: rgba(255,153,0,0.15); color: #FF9900; }
.level-b1 { background: rgba(255,200,0,0.15); color: #FFC800; }
.level-b2 { background: rgba(0,201,167,0.15); color: #00C9A7; }
.level-c1 { background: rgba(45,107,228,0.15); color: #6C9FFF; }
.level-c2 { background: rgba(138,43,226,0.15); color: #B07EFF; }

/* ---- Mobile mockup ---- */
.phone-frame {
  width: 320px;
  background: var(--surface);
  border: 8px solid var(--surface3);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  position: relative;
}
.phone-notch {
  width: 120px; height: 28px;
  background: var(--surface3);
  border-radius: 0 0 16px 16px;
  margin: 0 auto;
}
.phone-screen { padding: 16px; min-height: 580px; }

/* ---- Chat bubbles ---- */
.chat-wrap { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.chat-msg { max-width: 75%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-bubble {
  padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5;
}
.bot .chat-bubble { background: var(--surface3); color: var(--text2); border-radius: 4px 16px 16px 16px; }
.user .chat-bubble { background: var(--primary); color: white; border-radius: 16px 4px 16px 16px; }
.chat-name { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* ---- Misc ---- */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}
