/* ==========================================================================
   ENZO CORD - LUXURY MONOCHROME DESIGN SYSTEM
   Obsidian, Silver, Liquid Titanium & Dynamic Lighting
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Obsidian Luxe */
  --bg-deep: #050507;
  --bg-surface: rgba(14, 14, 18, 0.72);
  --bg-surface-elevated: rgba(22, 22, 28, 0.85);
  --bg-card-hover: rgba(28, 28, 36, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.03);

  /* Monochromatic Tones */
  --text-primary: #ffffff;
  --text-secondary: #c8c8d3;
  --text-muted: #7e7e8d;
  --text-disabled: #4e4e59;

  /* Metallic & Border Accents */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-highlight: rgba(255, 255, 255, 0.35);
  --glow-white: rgba(255, 255, 255, 0.25);
  --glow-accent: rgba(255, 255, 255, 0.12);

  /* Status Colors with Monochromatic Elegance */
  --status-emerald: #10b981;
  --status-emerald-glow: rgba(16, 185, 129, 0.3);
  --status-amber: #f59e0b;
  --status-amber-glow: rgba(245, 158, 11, 0.3);
  --status-crimson: #ef4444;
  --status-crimson-glow: rgba(239, 68, 68, 0.3);
  --discord-blurple: #5865F2;

  /* Typography */
  --font-arabic: 'Alexandria', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-en: 'Outfit', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Elevation & Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 35px rgba(255, 255, 255, 0.08);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-arabic);
  direction: rtl;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  line-height: 1.6;
  background-color: var(--bg-deep);
}

/* Canvas Dynamic Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
}

/* Background Ambient Overlay */
.bg-ambient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.035) 0%, transparent 70%),
              radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
              radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.025) 0%, transparent 60%);
}

/* Main Container */
.app-container {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 1rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  margin-top: 1rem;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-smooth);
}

.site-header:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-glow);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-container {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
  transition: transform 0.4s var(--ease-bounce);
}

.brand-section:hover .brand-logo {
  transform: scale(1.08) rotate(-4deg);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-en);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 0%, #d4d4df 60%, #9090a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseLight 2s infinite;
}

@keyframes pulseLight {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Sound Toggle Button */
.btn-icon-luxe {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.25s var(--ease-smooth);
}

.btn-icon-luxe:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Admin Audit Button */
.btn-audit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.55rem 1rem;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
}

.btn-audit:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* User Account Display */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: 40px;
  transition: all 0.25s var(--ease-smooth);
}

.user-chip:hover {
  border-color: var(--border-medium);
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-highlight);
}

.user-names {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-global-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-en);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  margin-right: 0.35rem;
  transition: color 0.2s;
}

.btn-logout:hover {
  color: var(--status-crimson);
}

/* Discord Login Button */
.btn-discord-login {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
  transition: all 0.3s var(--ease-smooth);
}

.btn-discord-login:hover {
  transform: translateY(-2px);
  background: #f0f0f5;
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   VIEW / ROUTE CONTAINERS (SPA View Switching)
   ========================================================================== */
.view-section {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
  width: 100%;
  margin-top: 2rem;
}

.view-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   VIEW 1: HERO & WELCOME
   ========================================================================== */
.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 0 3rem 0;
}

.server-banner-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 255, 255, 0.04);
  margin-bottom: 2rem;
  transition: all 0.5s var(--ease-smooth);
}

.server-banner-card:hover {
  transform: translateY(-4px) scale(1.008);
  border-color: var(--border-highlight);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 70px rgba(255, 255, 255, 0.12);
}

.server-banner-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.banner-glass-reflection {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-25deg);
  animation: shineLoop 7s infinite ease-in-out;
  pointer-events: none;
}

@keyframes shineLoop {
  0% { left: -100%; }
  25%, 100% { left: 200%; }
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-pill-badge {
  background: #ffffff;
  color: #000;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-en);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

.gradient-text-luxe {
  background: linear-gradient(135deg, #ffffff 0%, #e2e2ec 40%, #8c8c9e 80%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-description {
  max-width: 680px;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

/* Feature Highlights Grid */
.hero-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 900px;
  margin-bottom: 3rem;
}

.highlight-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: right;
  backdrop-filter: blur(15px);
  transition: all 0.3s var(--ease-smooth);
}

.highlight-box:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
  background: var(--bg-surface-elevated);
}

.highlight-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.highlight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.highlight-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary-luxe {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 2.2rem;
  background: linear-gradient(135deg, #ffffff 0%, #e6e6ee 100%);
  color: #050507;
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
  transition: all 0.3s var(--ease-smooth);
}

.btn-primary-luxe:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 40px rgba(255, 255, 255, 0.35);
  background: #ffffff;
}

.btn-secondary-luxe {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 2rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 18px;
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}

.btn-secondary-luxe:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
  transform: translateY(-3px);
}

/* ==========================================================================
   VIEW 2: TRACK SELECTION (إداري أم مبرمج)
   ========================================================================== */
.selection-container {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  padding: 1.5rem 0;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.section-heading {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.section-subheading {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.track-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 26px;
  padding: 2.5rem 2rem;
  text-align: right;
  backdrop-filter: blur(25px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
}

.track-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  pointer-events: none;
}

.track-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-highlight);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(255, 255, 255, 0.08);
}

.track-card:hover::before {
  opacity: 1;
}

.track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.track-icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.track-difficulty {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.track-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.track-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.role-awards-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.15rem;
  margin-bottom: 1.75rem;
}

.role-awards-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.role-award-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.role-award-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.role-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-id-tag {
  font-family: var(--font-code);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.role-req {
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
}

.track-features-list {
  list-style: none;
  margin-bottom: 2rem;
}

.track-feature-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.track-feature-item span.check-icon {
  color: #ffffff;
  font-size: 0.9rem;
}

.btn-select-track {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.3s var(--ease-smooth);
}

.track-card:hover .btn-select-track {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   VIEW 3: INTERACTIVE EXAM SUITE (30s Timer & Anti-Cheat HUD)
   ========================================================================== */
.exam-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Anti-Cheat Warning Banner */
.anticheat-alert-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 18px;
  color: #fca5a5;
  margin-bottom: 1.5rem;
  animation: shake 0.5s ease-in-out;
}

.anticheat-alert-banner.active {
  display: flex;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.alert-icon-text {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.alert-badge {
  background: #ef4444;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

/* Anti-Cheat Telemetry HUD */
.anticheat-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.85rem 1.4rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(20px);
  flex-wrap: wrap;
  gap: 1rem;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hud-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hud-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-en);
}

.hud-trust-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trust-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Exam Card */
.exam-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 26px;
  padding: 2.2rem;
  backdrop-filter: blur(25px);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.exam-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.question-counter-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: 12px;
}

.question-category-tag {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
}

/* 30 Seconds Circular Countdown Gauge */
.timer-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.timer-circle-wrap {
  position: relative;
  width: 58px;
  height: 58px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
}

.timer-progress-circle {
  fill: none;
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 157; /* 2 * PI * 25 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
}

.timer-seconds-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-en);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.timer-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Linear Progress Bar */
.exam-progress-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.exam-progress-bar-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #ffffff, #a3a3b2);
  border-radius: 10px;
  transition: width 0.4s var(--ease-smooth);
}

/* Question Statement */
.question-title-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  user-select: none;
  -webkit-user-select: none;
}

/* Code Snippet Box (Syntax-Style) */
.code-preview-box {
  background: #09090d;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.75rem;
  font-family: var(--font-code);
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

.code-preview-box pre {
  margin: 0;
}

/* Options Grid */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  font-weight: 500;
  text-align: right;
  cursor: pointer;
  width: 100%;
  transition: all 0.25s var(--ease-smooth);
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateX(-4px);
}

.option-btn.selected {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.option-letter-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-btn.selected .option-letter-badge {
  background: #ffffff;
  color: #000000;
}

.option-text-content {
  flex-grow: 1;
}

/* Exam Navigation Footer */
.exam-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.exam-security-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-next-question {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.75rem;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  transition: all 0.25s var(--ease-smooth);
}

.btn-next-question:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.35);
}

.btn-next-question:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   VIEW 4: RESULTS & ROLE AWARDING (شهادة القبول ومنح الرتب)
   ========================================================================== */
.results-wrapper {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  padding: 1.5rem 0;
}

.results-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 30px;
  padding: 3rem 2.2rem;
  backdrop-filter: blur(25px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(255, 255, 255, 0.05);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.results-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #ffffff, #10b981);
}

.results-card.failed::before {
  background: linear-gradient(90deg, #ef4444, #ffffff, #ef4444);
}

.result-status-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.result-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.result-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-badge.fail {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 0.8rem;
}

.result-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem auto;
}

/* Score Metrics Showcase */
.score-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.4rem;
  text-align: center;
}

.metric-num {
  font-family: var(--font-en);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Awarded Role Display Box */
.awarded-role-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1.5px solid var(--border-highlight);
  border-radius: 22px;
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

.awarded-role-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.awarded-role-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.awarded-role-texts {
  display: flex;
  flex-direction: column;
}

.awarded-role-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.awarded-role-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.awarded-role-id-badge {
  font-family: var(--font-code);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  color: var(--text-secondary);
  display: inline-block;
  margin-top: 0.3rem;
}

.awarded-role-status-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Anti-Cheat Full Audit Accordion */
.review-section {
  text-align: right;
  margin-bottom: 2.5rem;
}

.review-section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.review-card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.4rem;
  margin-bottom: 1rem;
}

.review-card-item.correct {
  border-right: 4px solid #10b981;
}

.review-card-item.incorrect {
  border-right: 4px solid #ef4444;
}

.review-q-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.review-q-statement {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.review-answers-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.review-exp {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Results Action Buttons */
.results-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   MODALS (Demo Login / Audit Log / Help)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 26px;
  max-width: 600px;
  width: 100%;
  padding: 2.2rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
  text-align: right;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #ffffff;
}

/* Audit Submissions Table in Modal */
.audit-table-wrap {
  overflow-x: auto;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.audit-table th {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border-medium);
  color: var(--text-muted);
  font-weight: 600;
}

.audit-table td {
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-msg {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  border-radius: 14px;
  padding: 0.85rem 1.4rem;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideToast 0.3s var(--ease-smooth);
}

@keyframes slideToast {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Vector SVG Icons Utility */
.icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-svg svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 22px; height: 22px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 36px; height: 36px; }

/* ==========================================================================
   DEVELOPER SPECIALIZATION & TRACK SELECTOR STYLES
   ========================================================================== */
.btn-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 2rem;
  transition: all 0.3s var(--ease-smooth);
}

.btn-back-nav:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateX(4px);
}

.step-selection-block {
  margin-bottom: 3rem;
  text-align: right;
  width: 100%;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.step-texts {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.step-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Subtracks Grid */
.subtracks-grid {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.dev-languages-grid {
  grid-template-columns: repeat(3, 1fr);
}

.dev-tracks-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* Subtrack Card */
.subtrack-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.4rem;
  text-align: right;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subtrack-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 255, 255, 0.04);
}

.subtrack-card.active {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.subtrack-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.subtrack-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.3s;
}

.subtrack-card.active .subtrack-icon-wrap {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.subtrack-tag-code {
  font-family: var(--font-code);
  font-weight: 800;
  font-size: 0.95rem;
}

.subtrack-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.subtrack-card.active .subtrack-status-pill {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.subtrack-check-indicator {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.3s;
}

.subtrack-check-indicator svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.subtrack-card.active .subtrack-check-indicator {
  background: #10b981;
  border-color: #10b981;
  color: #000000;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.subtrack-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.subtrack-description {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Action & Launch Panel */
.dev-launch-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 24px;
  padding: 1.8rem 2.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 35px rgba(255, 255, 255, 0.04);
  margin-top: 1rem;
}

.launch-summary-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: right;
}

.launch-summary-tags {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.summary-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.badge-lang-preview {
  background: #ffffff;
  color: #000000;
  padding: 0.25rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.85rem;
}

.summary-sep {
  color: var(--text-muted);
  font-weight: 900;
}

.badge-track-preview {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.25rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 0.85rem;
}

.launch-meta-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .dev-languages-grid {
    grid-template-columns: 1fr;
  }
  .dev-tracks-grid {
    grid-template-columns: 1fr;
  }
  .dev-launch-panel {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 1.5rem;
  }
  .launch-summary-info {
    text-align: center;
    align-items: center;
  }
  .launch-summary-tags {
    justify-content: center;
    flex-wrap: wrap;
  }
  .launch-meta-text {
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   Candidate Status Banners & Exam Locking
   ========================================================================== */

.candidate-status-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.2rem 1.6rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  width: 100%;
  animation: fadeIn 0.4s var(--ease-smooth);
}

.candidate-status-banner.status-passed {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.12);
}

.candidate-status-banner.status-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.12);
}

.candidate-status-banner.status-rejected {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.12);
}

.status-banner-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-passed .status-banner-icon-wrap {
  background: rgba(16, 185, 129, 0.2);
  color: var(--status-emerald);
}

.status-warning .status-banner-icon-wrap {
  background: rgba(245, 158, 11, 0.2);
  color: var(--status-amber);
}

.status-rejected .status-banner-icon-wrap {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-crimson);
}

.status-banner-content {
  flex: 1;
  text-align: right;
}

.status-banner-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.status-banner-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.attempt-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.attempt-status-pill.status-passed {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.attempt-status-pill.status-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.attempt-status-pill.status-rejected {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.track-card.disabled-locked {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
  position: relative;
}

.track-card.disabled-locked::after {
  content: 'مغلق';
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.track-card.disabled-locked.locked-passed::after {
  content: 'تم القبول مسبقاً';
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* ==========================================================================
   Written / Open-Text Questions
   ========================================================================== */

.written-input-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s var(--ease-smooth);
}

.written-box-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.written-textarea {
  width: 100%;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--font-code), var(--font-arabic);
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 1rem 1.2rem;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.written-textarea:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.written-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.written-box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.written-char-counter {
  font-family: var(--font-en);
  font-weight: 600;
  color: var(--text-secondary);
}

.written-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ==========================================================================
   ADVANCED MOBILE & TABLET RESPONSIVE SYSTEM
   Breakpoints: 1024px (Tablet Landscape), 768px (Tablet/Large Phone), 480px (Mobile), 360px (Compact)
   ========================================================================== */

/* 1. Tablet & Smaller Displays (<= 1024px) */
@media (max-width: 1024px) {
  .app-container {
    padding: 0 1.25rem 4rem 1.25rem;
  }

  .hero-highlights-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
  }

  .languages-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2. Tablets & Large Smartphones (<= 768px) */
@media (max-width: 768px) {
  .app-container {
    padding: 0 1rem 3.5rem 1rem;
  }

  /* Header */
  .site-header {
    top: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 16px;
  }

  .brand-section {
    gap: 0.65rem;
  }

  .brand-logo-container {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.68rem;
  }

  .header-actions {
    gap: 0.45rem;
  }

  /* Hero Section */
  .hero-pill {
    padding: 0.35rem 0.9rem;
    font-size: 0.78rem;
    margin-bottom: 1.2rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.35;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 2rem;
  }

  .hero-highlights-grid {
    grid-template-columns: 1fr;
    gap: 0.95rem;
    margin-bottom: 2.2rem;
  }

  .highlight-box {
    padding: 1.2rem 1.1rem;
    border-radius: 18px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    gap: 0.8rem;
  }

  .hero-cta-group .btn-primary-luxe,
  .hero-cta-group .btn-secondary-luxe {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.2rem;
  }

  /* Track Selection */
  .section-title {
    font-size: clamp(1.5rem, 5.5vw, 2.2rem);
  }

  .section-subtitle {
    font-size: 0.92rem;
    margin-bottom: 2rem;
  }

  .tracks-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .track-card {
    padding: 1.6rem 1.3rem;
    border-radius: 20px;
  }

  /* Specialization Page */
  .btn-back-nav {
    margin-bottom: 1.5rem;
    font-size: 0.84rem;
    padding: 0.5rem 1rem;
  }

  .step-selection-block {
    margin-bottom: 2.2rem;
  }

  .step-header {
    gap: 0.75rem;
    margin-bottom: 1.2rem;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .step-title {
    font-size: 1.15rem;
  }

  .step-desc {
    font-size: 0.82rem;
  }

  .languages-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .lang-card {
    padding: 1.2rem 1.1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.1rem;
    text-align: right;
    border-radius: 18px;
  }

  .lang-icon-wrap {
    margin-bottom: 0;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
  }

  .lang-card-content {
    flex: 1;
    min-width: 0;
  }

  .dev-tracks-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .dev-track-card {
    padding: 1.25rem 1.1rem;
    border-radius: 18px;
  }

  .dev-track-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .dev-track-footer .btn-primary-luxe,
  .dev-track-footer .btn-secondary-luxe {
    width: 100%;
    justify-content: center;
  }

  /* Exam Interface */
  .anticheat-hud-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    margin-bottom: 1.2rem;
  }

  .hud-metric {
    font-size: 0.8rem;
  }

  .exam-card {
    padding: 1.35rem 1.1rem;
    border-radius: 20px;
  }

  .exam-card-header {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.85rem;
  }

  .timer-container {
    width: 100%;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
  }

  .question-title {
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
  }

  .code-snippet-box {
    padding: 0.85rem;
    font-size: 0.82rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .options-list {
    gap: 0.75rem;
  }

  .option-btn {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    min-height: 52px;
  }

  .written-input-box {
    padding: 1.1rem 1rem;
    border-radius: 16px;
  }

  .written-textarea {
    font-size: 16px; /* Prevents auto zoom on iOS */
    padding: 0.9rem 1rem;
    min-height: 105px;
    border-radius: 12px;
  }

  .exam-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  .exam-footer .btn-exam-nav,
  .exam-footer .btn-primary-luxe {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
  }

  /* Results View */
  .results-certificate {
    padding: 1.8rem 1.2rem;
    border-radius: 22px;
  }

  .score-metrics-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .metric-card {
    padding: 1.15rem 1rem;
  }

  .awarded-role-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.1rem;
  }

  .awarded-role-status-badge {
    width: 100%;
    justify-content: center;
  }

  .review-section {
    margin-bottom: 2rem;
  }

  .review-card-item {
    padding: 1.1rem 1rem;
    border-radius: 16px;
  }

  .results-actions-row {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .results-actions-row .btn-primary-luxe,
  .results-actions-row .btn-secondary-luxe {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
  }

  /* Modals */
  .modal-overlay {
    padding: 0.85rem;
  }

  .modal-box {
    padding: 1.5rem 1.1rem;
    border-radius: 20px;
    max-height: 88vh;
  }

  .audit-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
}

/* 3. Standard Smartphone Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 0 0.85rem 3rem 0.85rem;
  }

  /* Header */
  .site-header {
    top: 0.35rem;
    margin-top: 0.35rem;
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
  }

  .brand-logo-container {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .brand-title {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
  }

  .brand-subtitle {
    display: none; /* Hide on small screens to prevent header wrap */
  }

  .header-actions {
    gap: 0.35rem;
  }

  .btn-icon-luxe {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  .btn-audit {
    padding: 0.42rem 0.65rem;
    font-size: 0.76rem;
    border-radius: 10px;
    gap: 0.35rem;
  }

  .btn-discord-login {
    padding: 0.42rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 10px;
    gap: 0.45rem;
  }

  .user-chip {
    padding: 0.2rem 0.55rem 0.2rem 0.35rem;
    gap: 0.4rem;
  }

  .user-avatar-img {
    width: 26px;
    height: 26px;
  }

  .user-global-name {
    font-size: 0.78rem;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-badge {
    display: none;
  }

  /* Hero */
  .hero-pill {
    padding: 0.3rem 0.75rem;
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .hero-pill-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.45rem;
  }

  .hero-title {
    font-size: 1.6rem;
    line-height: 1.35;
  }

  .hero-description {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .highlight-box {
    padding: 1rem 0.9rem;
    border-radius: 15px;
  }

  .highlight-title {
    font-size: 0.92rem;
  }

  .highlight-desc {
    font-size: 0.8rem;
  }

  /* Tracks */
  .track-card {
    padding: 1.35rem 1rem;
    border-radius: 18px;
  }

  .track-icon {
    width: 48px;
    height: 48px;
  }

  .track-title {
    font-size: 1.25rem;
  }

  .track-desc {
    font-size: 0.86rem;
  }

  .track-features li {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* Specialization */
  .step-header {
    gap: 0.6rem;
    margin-bottom: 0.95rem;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.88rem;
    border-radius: 8px;
  }

  .step-title {
    font-size: 1rem;
  }

  .step-desc {
    font-size: 0.78rem;
  }

  .lang-card {
    padding: 0.95rem 0.85rem;
    border-radius: 15px;
    gap: 0.85rem;
  }

  .lang-icon-wrap {
    width: 42px;
    height: 42px;
  }

  .lang-title {
    font-size: 0.98rem;
  }

  .lang-badge {
    font-size: 0.72rem;
  }

  .dev-track-card {
    padding: 1rem 0.85rem;
    border-radius: 15px;
  }

  .dev-track-title {
    font-size: 0.95rem;
  }

  .dev-track-desc {
    font-size: 0.78rem;
  }

  /* Exam */
  .anticheat-hud-bar {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.7rem 0.8rem;
  }

  .exam-card {
    padding: 1.15rem 0.85rem;
    border-radius: 18px;
  }

  .question-title {
    font-size: 1.05rem;
    line-height: 1.55;
  }

  .option-btn {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
    border-radius: 13px;
  }

  .option-letter-badge {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    border-radius: 8px;
  }

  .option-text-content {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .written-input-box {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
  }

  .written-box-header {
    font-size: 0.8rem;
  }

  .written-textarea {
    font-size: 16px !important; /* Prevents auto zoom on iOS */
    padding: 0.8rem 0.85rem;
    min-height: 95px;
    border-radius: 10px;
  }

  .written-box-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    font-size: 0.72rem;
  }

  /* Results */
  .results-certificate {
    padding: 1.4rem 0.85rem;
    border-radius: 18px;
  }

  .result-status-orb {
    width: 58px;
    height: 58px;
  }

  .result-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
  }

  .result-title {
    font-size: 1.35rem;
  }

  .result-subtitle {
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .metric-card {
    padding: 0.95rem 0.85rem;
    border-radius: 14px;
  }

  .metric-num {
    font-size: 1.6rem;
  }

  .metric-label {
    font-size: 0.76rem;
  }

  .awarded-role-box {
    padding: 1rem 0.85rem;
    border-radius: 16px;
  }

  .awarded-role-name {
    font-size: 1.05rem;
  }

  .review-card-item {
    padding: 0.95rem 0.8rem;
    border-radius: 14px;
  }

  .review-q-title {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .review-q-statement {
    font-size: 0.82rem;
  }

  .review-answers-box {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 10px;
  }

  .review-exp {
    font-size: 0.78rem;
  }

  /* Toast Notification */
  #toast-container {
    width: calc(100% - 1.5rem);
    bottom: 1.25rem;
  }

  .toast-msg {
    width: 100%;
    font-size: 0.82rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
  }
}

/* 4. Extra Compact Devices (<= 360px) */
@media (max-width: 360px) {
  .brand-title {
    font-size: 0.85rem;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .btn-discord-login {
    padding: 0.4rem 0.6rem;
  }

  .btn-discord-login span {
    font-size: 0.75rem;
  }

  .user-global-name {
    max-width: 60px;
  }

  .exam-card {
    padding: 1rem 0.7rem;
  }

  .option-btn {
    padding: 0.65rem 0.75rem;
  }
}



