/* ===== Seven Rays Quiz - RTL Arabic Design ===== */
:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B85FF;
  --secondary: #2D2B55;
  --accent: #FF6B6B;
  --bg: #0F0E17;
  --bg-card: #1A1932;
  --bg-card-hover: #232148;
  --text: #FFFFFE;
  --text-muted: #A7A9BE;
  --text-dim: #72738C;
  --border: #2E2C54;
  --success: #2CB67D;
  --warning: #FFB347;
  --gradient-1: linear-gradient(135deg, #6C63FF 0%, #E942F5 100%);
  --gradient-2: linear-gradient(135deg, #2CB67D 0%, #6C63FF 100%);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(108, 99, 255, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Cairo', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

/* Background ambient effect */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(233, 66, 245, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; }

/* ===== Screens ===== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 40px 0;
}
.screen.active { display: flex; align-items: flex-start; justify-content: center; }
#loading-screen.active, #submitting-screen.active { align-items: center; }

.container {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Loading ===== */
.loader-container {
  text-align: center;
  color: var(--text-muted);
}

.rays-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Welcome ===== */
.welcome-content { text-align: center; }

.logo-area { margin-bottom: 32px; }

.rays-icon {
  font-size: 64px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  animation: pulse-glow 3s ease-in-out infinite;
}
.rays-icon.small { font-size: 40px; margin-bottom: 8px; }

@keyframes pulse-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 300;
}

.welcome-text {
  text-align: right;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}
.welcome-text p { margin-bottom: 20px; color: var(--text-muted); }
.welcome-text strong { color: var(--text); }

.levels-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.level-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.level-num {
  width: 32px;
  height: 32px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.tips {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.tips h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary-light);
}
.tips ul {
  list-style: none;
  padding: 0;
}
.tips li {
  padding: 6px 0;
  color: var(--text-muted);
  position: relative;
  padding-right: 20px;
}
.tips li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: var(--primary);
}

.author {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-secondary:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-lg {
  padding: 16px 48px;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

/* ===== Lead Form ===== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.form-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.form-subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-group {
  text-align: right;
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}
.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}
.form-group input::placeholder { color: var(--text-dim); }

/* ===== Quiz ===== */
.quiz-header {
  margin-bottom: 28px;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 16px 0;
  z-index: 10;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.section-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-light);
}
.progress-text {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-sections {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.section-dot {
  flex: 1;
  text-align: center;
  padding: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.3s;
}
.section-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.section-dot.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-number {
  color: var(--primary-light);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.8;
  margin-bottom: 24px;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  width: 100%;
  font-family: var(--font);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}
.option-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}
.option-btn.selected {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.1);
}

.option-letter {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s;
  margin-top: 2px;
}
.option-btn.selected .option-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.option-text { flex: 1; }

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 40px;
}

/* ===== Results ===== */
.results-header {
  text-align: center;
  margin-bottom: 36px;
}
.results-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.results-header p {
  color: var(--text-muted);
}

.energy-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}
.energy-summary h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  color: var(--primary-light);
}

.energy-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.energy-row:last-child { border-bottom: none; }

.energy-level-name {
  font-weight: 600;
  min-width: 160px;
  color: var(--text-muted);
}
.energy-ray-badge {
  background: var(--gradient-1);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.ray-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.ray-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.ray-detail-level {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 8px;
}
.ray-detail-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-light);
}

.ray-section {
  margin-bottom: 16px;
}
.ray-section:last-child { margin-bottom: 0; }
.ray-section-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ray-section-title.strengths { color: var(--success); }
.ray-section-title.challenges { color: var(--warning); }
.ray-section-title.advice { color: var(--primary-light); }

.ray-section p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.results-footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.results-footer p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.btn-restart {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-restart:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* Score bars */
.score-bars {
  margin-top: 8px;
}
.score-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.score-bar-label {
  min-width: 24px;
  text-align: center;
  color: var(--text-dim);
  font-weight: 600;
}
.score-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-value {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.score-bar-count {
  min-width: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  h1 { font-size: 1.8rem; }
  .container { padding: 0 16px; }
  .question-card { padding: 24px 18px; }
  .form-card { padding: 28px 20px; }
  .welcome-text { padding: 20px; }
  .energy-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .energy-level-name { min-width: auto; }
  .ray-detail { padding: 20px; }
  .btn-lg { padding: 14px 36px; font-size: 1rem; }
}
