/* Custom CSS Design: Wizard Academy Theme with Modern Dark and Parchment Elements */

:root {
  --color-dark-bg: #0d0f14;
  --color-gold: #c9a054;
  --color-gold-glow: #ffd700;
  --color-parchment: #f4edd8;
  --color-parchment-dark: #e8ddbe;
  --color-dark-text: #2f2a1c;
  --color-gryffindor: #740001;
  --color-ravenclaw: #0e1a40;
  --color-hufflepuff: #ecb939;
  --color-slytherin: #1a472a;
  
  --font-magic: Georgia, 'Times New Roman', serif;
  --font-hebrew: Arial, 'Noto Sans Hebrew', sans-serif;
  
  --shadow-magic: 0 8px 32px rgba(199, 160, 84, 0.15);
  --shadow-neon: 0 0 15px rgba(201, 160, 84, 0.4);
}

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

body {
  background-color: var(--color-dark-bg);
  font-family: var(--font-hebrew);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  direction: rtl;
}

/* Background Magic Effects */
.stars {
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.8) 0 1px, transparent 2px),
    radial-gradient(circle at 75% 35%, rgba(255,255,255,.65) 0 1px, transparent 2px),
    radial-gradient(circle at 45% 75%, rgba(201,160,84,.7) 0 1px, transparent 2px),
    #090b10;
  background-size: 180px 180px, 240px 240px, 310px 310px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -3;
}

.twinkling {
  background: radial-gradient(circle at 50% 30%, rgba(201, 160, 84, 0.08), transparent 55%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  animation: move-twink-back 200s linear infinite;
}

@keyframes move-twink-back {
  from { background-position: 0 0; }
  to { background-position: -10000px 5000px; }
}

/* Sound Controller floating card */
.sound-control {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(20, 24, 35, 0.85);
  border: 1px solid var(--color-gold);
  border-radius: 30px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-magic);
  font-family: var(--font-hebrew);
}

.sound-control:hover {
  background: rgba(199, 160, 84, 0.2);
  box-shadow: var(--shadow-neon);
}

.sound-icon {
  font-size: 1.1rem;
}

.sound-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold);
}

/* Containers */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 2px dashed rgba(199, 160, 84, 0.3);
  margin-bottom: 30px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.academy-crest {
  font-size: 2.8rem;
  text-shadow: 0 0 10px var(--color-gold);
  animation: float 4s ease-in-out infinite;
}

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

.app-header h1 {
  font-family: var(--font-magic);
  font-size: 2rem;
  color: var(--color-gold);
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

.user-status-bar {
  background: rgba(20, 24, 35, 0.85);
  border: 1px solid var(--color-gold);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-magic);
}

.user-avatar {
  font-size: 1.8rem;
}

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

.user-name {
  font-weight: 700;
  color: #fff;
}

.user-xp {
  font-size: 0.85rem;
  color: var(--color-gold);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* Cards (Wizard Academy Parchment style) */
.card {
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}

.card.parchment {
  background: var(--color-parchment);
  color: var(--color-dark-text);
  border: 6px double #8b7355;
  background-image: radial-gradient(circle, transparent 20%, var(--color-parchment-dark) 100%);
  box-shadow: 5px 5px 25px rgba(0, 0, 0, 0.4), inset 0 0 40px rgba(139, 115, 85, 0.3);
}

/* Screens */
.screen {
  display: none;
  animation: fadeIn 0.5s ease forwards;
}

.screen.active {
  display: block;
}

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

/* Profile Selection Screen */
.welcome-box {
  margin-bottom: 40px;
}

.welcome-box h2 {
  font-family: var(--font-magic);
  color: var(--color-gold);
  font-size: 2.2rem;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(199, 160, 84, 0.3);
}

.welcome-box p {
  font-size: 1.2rem;
  color: #d1d5db;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.profile-card {
  background: rgba(20, 24, 35, 0.85);
  border: 2px solid rgba(199, 160, 84, 0.3);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.profile-card:hover {
  transform: translateY(-10px);
  border-color: var(--color-gold);
  box-shadow: 0 15px 30px rgba(199, 160, 84, 0.25);
}

.house-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
}

/* Wizard Academy House Themes */
.profile-card.gryffindor {
  border-left: 6px solid var(--color-gryffindor);
}
.profile-card.gryffindor .house-badge {
  background: var(--color-gryffindor);
  box-shadow: 0 0 8px var(--color-gryffindor);
}

.profile-card.ravenclaw {
  border-left: 6px solid var(--color-ravenclaw);
}
.profile-card.ravenclaw .house-badge {
  background: var(--color-ravenclaw);
  box-shadow: 0 0 8px var(--color-ravenclaw);
}

.profile-card.hufflepuff {
  border-left: 6px solid var(--color-hufflepuff);
  color: #fff;
}
.profile-card.hufflepuff .house-badge {
  background: #b08200;
  box-shadow: 0 0 8px var(--color-hufflepuff);
}

.profile-avatar {
  font-size: 4rem;
  margin: 20px 0;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
}

.profile-card h3 {
  font-family: var(--font-magic);
  font-size: 1.8rem;
  color: var(--color-gold);
  margin-bottom: 8px;
}

.profile-meta {
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 15px;
}

.profile-stats-brief {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #e5e7eb;
  line-height: 1.4;
}

/* Dashboard Screen Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 30px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Dashboard Stats */
.dashboard-sidebar {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-sidebar h3 {
  font-family: var(--font-magic);
  color: var(--color-dark-text);
  border-bottom: 2px solid rgba(139, 115, 85, 0.4);
  padding-bottom: 10px;
  font-size: 1.4rem;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-bar-bg {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  height: 16px;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(139, 115, 85, 0.4);
}

.progress-bar-fill {
  background: linear-gradient(90deg, #b08d49, var(--color-gold));
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 0.6s ease;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.progress-bar-gold {
  background: linear-gradient(90deg, #d4af37, #ffd700);
}

.xp-text {
  font-size: 0.85rem;
  text-align: left;
  font-weight: 700;
  color: #6b5c3b;
}

.stats-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 10px;
  padding: 12px 6px;
  text-align: center;
  box-shadow: inset 0 0 10px rgba(139, 115, 85, 0.15);
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
  color: var(--color-gryffindor);
}

.stat-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: #4b3d21;
}

.weekly-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weekly-stats h4 {
  font-size: 0.95rem;
  color: var(--color-dark-text);
  font-weight: 700;
}

/* CSS Chart Bars */
.chart-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 100px;
  padding: 10px 5px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  border-bottom: 2px solid rgba(139, 115, 85, 0.4);
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 12%;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  background: linear-gradient(to top, #7e191b, #a52a2a);
  width: 100%;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  min-height: 2px;
  transition: height 0.8s ease;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.chart-bar.today {
  background: linear-gradient(to top, #b08d49, var(--color-gold));
  box-shadow: 0 0 8px rgba(199, 160, 84, 0.6);
}

.chart-label {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 5px;
  color: #6b5a3e;
}

.failed-questions-box {
  background: rgba(236, 185, 57, 0.15);
  border: 1px dashed #b08200;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.failed-questions-box h4 {
  font-size: 0.95rem;
  color: #7c5c00;
  font-weight: 700;
}

.failed-questions-box p {
  font-size: 0.85rem;
  color: #4b3d21;
}

/* Dashboard Main Content */
.welcome-banner {
  background: rgba(20, 24, 35, 0.85);
  border: 2px solid var(--color-gold);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-magic);
}

.welcome-banner h2 {
  font-family: var(--font-magic);
  color: var(--color-gold);
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.welcome-banner p {
  color: #d1d5db;
  line-height: 1.5;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.subject-card {
  background: rgba(20, 24, 35, 0.85);
  border: 1px solid rgba(199, 160, 84, 0.2);
  border-radius: 16px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.subject-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(199, 160, 84, 0.15);
}

.subject-icon {
  font-size: 2.5rem;
  align-self: flex-start;
}

.subject-card h3 {
  font-family: var(--font-magic);
  font-size: 1.3rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.subject-card p {
  font-size: 0.9rem;
  color: #9ca3af;
  flex-grow: 1;
  line-height: 1.4;
}

.subject-difficulty {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-gold);
  font-weight: 600;
}

.stars-stars {
  letter-spacing: 2px;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
}

/* Quiz Screen */
.quiz-container {
  padding: 30px;
  margin-bottom: 30px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  border-bottom: 1px solid rgba(139, 115, 85, 0.3);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.subject-badge {
  background: var(--color-gryffindor);
  color: white;
  padding: 6px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.difficulty-level {
  font-size: 0.9rem;
  font-weight: 700;
  color: #7b5c3b;
}

.quiz-progress-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-dark-text);
}

.small-margin {
  margin-bottom: 25px;
}

/* Judaism Concept Block */
.judaism-concept-block {
  background: rgba(199, 160, 84, 0.1);
  border: 2px solid rgba(139, 115, 85, 0.5);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: inset 0 0 15px rgba(139, 115, 85, 0.1);
}

.concept-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.concept-badge {
  background: #a0522d;
  color: white;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.concept-title h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #5c2d1b;
}

.concept-explanation {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--color-dark-text);
  margin-bottom: 15px;
}

.concept-analogy {
  background: rgba(255, 255, 255, 0.6);
  border-right: 4px solid var(--color-gold);
  padding: 12px;
  border-radius: 4px;
}

.concept-analogy h4 {
  font-family: var(--font-magic);
  color: #5c2d1b;
  margin-bottom: 5px;
}

.concept-analogy p {
  font-size: 0.95rem;
  line-height: 1.4;
  font-style: italic;
  color: #3e3321;
}

/* Question Box */
.question-box {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  text-align: center;
  box-shadow: inset 0 0 10px rgba(139, 115, 85, 0.05);
}

.question-box h3 {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--color-dark-text);
  font-weight: 800;
}

/* Answers Grid */
.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (max-width: 600px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }

  .smart-teacher {
    grid-column: 1 / -1 !important;
  }

  .app-container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .sound-control {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
  }

  .sound-text {
    display: none;
  }
}

.answer-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(139, 115, 85, 0.6);
  color: var(--color-dark-text);
  padding: 18px 20px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  outline: none;
  font-family: var(--font-hebrew);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.answer-btn:hover {
  background: var(--color-gold);
  border-color: #8b7355;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(139, 115, 85, 0.2);
}

.answer-btn:active {
  transform: translateY(0);
}

/* Buttons Styling */
.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-family: var(--font-hebrew);
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #b08d49, #8b6c2f);
  color: white;
  border: 1px solid var(--color-gold);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-gold), #b08d49);
  box-shadow: var(--shadow-neon);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-accent {
  background: linear-gradient(135deg, #740001, #4b0002);
  color: white;
  border: 1px solid #740001;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #a52a2a, #740001);
  box-shadow: 0 0 10px rgba(116, 0, 1, 0.5);
}

.btn-warning {
  background: linear-gradient(135deg, #ecb939, #b08200);
  color: #1f1a0e;
  border: 1px solid #b08200;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ffd700, #ecb939);
  box-shadow: 0 0 8px rgba(236, 185, 57, 0.5);
}

.btn-danger {
  background: #7f1d1d;
  color: white;
  border: 1px solid #b91c1c;
}

.btn-danger:hover {
  background: #991b1b;
}

.data-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 15px;
  border-top: 1px solid rgba(139, 115, 85, 0.35);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffd700;
  outline-offset: 3px;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.15rem;
}

/* Feedback Overlay & Card */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.feedback-card {
  max-width: 500px;
  width: 100%;
  padding: 35px;
  text-align: center;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.feedback-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: popScale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-card h2 {
  font-family: var(--font-magic);
  color: var(--color-gryffindor);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.feedback-message {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--color-dark-text);
  margin-bottom: 20px;
}

.difficulty-change-indicator {
  background: rgba(199, 160, 84, 0.2);
  border: 1px solid var(--color-gold);
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #7b5c3b;
  margin-bottom: 15px;
}

.xp-earned-banner {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-gryffindor);
  margin-bottom: 25px;
}

.animated-pop {
  animation: popScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popScale {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Results Screen */
.results-card {
  max-width: 650px;
  margin: 40px auto;
  padding: 40px;
}

.results-crest {
  font-size: 5rem;
  text-shadow: 0 0 12px var(--color-gold);
  margin-bottom: 20px;
}

.results-card h2 {
  font-family: var(--font-magic);
  color: var(--color-gryffindor);
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.results-stats {
  display: flex;
  justify-content: space-around;
  margin: 30px 0;
  background: rgba(0,0,0,0.05);
  border-radius: 12px;
  padding: 20px 10px;
  border: 1px solid rgba(139, 115, 85, 0.3);
}

.results-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.results-stat-item span:last-child {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b5c3b;
}

.results-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-gryffindor);
}

.feedback-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-dark-text);
  margin-bottom: 30px;
  line-height: 1.5;
}

.actions-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .results-stats {
    flex-direction: column;
    gap: 20px;
  }
}

/* Interactive Math Step-by-Step Solver Style */
.math-steps-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.steps-assigned-box, .steps-options-box {
  background: rgba(255, 255, 255, 0.4);
  border: 2px dashed rgba(139, 115, 85, 0.4);
  border-radius: 12px;
  padding: 18px;
}

.steps-assigned-box h4, .steps-options-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #5c2d1b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.empty-steps-text {
  font-size: 0.95rem;
  color: #7b6d51;
  text-align: center;
  line-height: 60px;
  font-style: italic;
}

.shuffled-steps-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(199, 160, 84, 0.6);
  color: var(--color-dark-text);
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: right;
  width: 100%;
  font-family: var(--font-hebrew);
}

.step-card:hover {
  background: var(--color-gold);
  color: white;
  border-color: #8b7355;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(199, 160, 84, 0.25);
}

.step-card.correct-done {
  background: #e2f0d9;
  border-color: #a8d08d;
  color: #385723;
  cursor: default;
}

.step-card.correct-done:hover {
  transform: none;
  box-shadow: none;
  background: #e2f0d9;
  color: #385723;
}

.step-badge {
  background: rgba(139, 115, 85, 0.2);
  color: #5c2d1b;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.step-card.correct-done .step-badge {
  background: #a8d08d;
  color: white;
}

/* ==========================================
   DETAILED STATISTICS SCREEN & SMART TEACHER
   ========================================== */

.stats-screen-container {
  padding: 30px;
  margin-bottom: 30px;
  background-image: radial-gradient(circle, transparent 20%, var(--color-parchment-dark) 100%);
}

.stats-screen-header {
  border-bottom: 2px dashed rgba(139, 115, 85, 0.4);
  padding-bottom: 20px;
  margin-bottom: 25px;
  text-align: center;
  position: relative;
}

.stats-screen-header h2 {
  font-family: var(--font-magic);
  color: var(--color-gryffindor);
  font-size: 1.8rem;
  margin-top: 15px;
  margin-bottom: 8px;
}

.stats-screen-header p {
  font-size: 1.05rem;
  color: #5c4d3c;
  font-style: italic;
}

.stats-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(139, 115, 85, 0.2);
  padding-bottom: 10px;
}

.stats-tab {
  background: rgba(139, 115, 85, 0.15);
  border: 1px solid rgba(139, 115, 85, 0.4);
  color: var(--color-dark-text);
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-hebrew);
  font-size: 1rem;
}

.stats-tab:hover {
  background: rgba(139, 115, 85, 0.3);
}

.stats-tab.active {
  background: var(--color-gryffindor);
  color: white;
  border-color: var(--color-gryffindor);
  box-shadow: 0 4px 8px rgba(116, 0, 1, 0.2);
}

.stats-tab-content {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.stats-tab-content.active {
  display: block;
}

/* Overview Layout */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.overview-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(139, 115, 85, 0.05);
}

.overview-card h4 {
  font-size: 1.1rem;
  color: #5c2d1b;
  margin-bottom: 15px;
  width: 100%;
  border-bottom: 1px solid rgba(139, 115, 85, 0.2);
  padding-bottom: 8px;
  text-align: center;
}

.accuracy-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #parchment 60%, transparent 61%),
              conic-gradient(var(--color-gold) 0%, rgba(139, 115, 85, 0.1) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-gryffindor);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1), inset 0 0 10px rgba(0,0,0,0.05);
}

.subject-bars-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.subject-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.subject-progress-row span:first-child {
  width: 70px;
  font-weight: 700;
  color: var(--color-dark-text);
}

.subject-progress-row span:last-child {
  width: 45px;
  font-weight: 800;
  text-align: left;
  color: var(--color-gryffindor);
}

.progress-bar-bg.small {
  height: 12px;
  flex-grow: 1;
}

/* Quick Totals */
.quick-totals-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .quick-totals-row {
    grid-template-columns: 1fr 1fr;
  }
}

.total-box {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.total-box span:first-child {
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
  color: var(--color-gryffindor);
}

.total-box span:last-child {
  font-size: 0.85rem;
  font-weight: 700;
  color: #5c4d3c;
}

/* Subjects detail lists */
.subjects-stats-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.subject-detail-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.02);
}

.subject-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(139, 115, 85, 0.2);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.subject-detail-header h3 {
  font-family: var(--font-magic);
  color: var(--color-dark-text);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-accuracy-badge {
  background: var(--color-gold);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-weight: 800;
  font-size: 0.9rem;
}

.subject-detail-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .subject-detail-grid {
    grid-template-columns: 1fr;
  }
}

.topics-accuracy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-accuracy-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  border-right: 3px solid var(--color-gold);
}

.topic-accuracy-row.warning {
  border-right-color: #d9534f;
  background: rgba(217, 83, 79, 0.05);
}

.topic-accuracy-row.success {
  border-right-color: #5cb85c;
  background: rgba(92, 184, 92, 0.05);
}

.subject-recommendation-box {
  background: rgba(199, 160, 84, 0.08);
  border: 1px dashed rgba(139, 115, 85, 0.4);
  border-radius: 8px;
  padding: 15px;
  font-size: 0.95rem;
  color: #4b3c2a;
  line-height: 1.4;
}

.subject-recommendation-box h5 {
  font-weight: 700;
  margin-bottom: 5px;
  color: #7c5c00;
}

/* Recommendations list */
.recommendations-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
  padding: 0;
}

.recommendations-list li {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(139, 115, 85, 0.25);
  border-right: 5px solid var(--color-gold);
  border-radius: 8px;
  padding: 15px;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--color-dark-text);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.recommendations-list li::before {
  content: '🧙‍♂️';
  font-size: 1.2rem;
}

.recommendations-list li.high-priority {
  border-right-color: var(--color-gryffindor);
  background: rgba(116, 0, 1, 0.03);
}

.recommendations-list li.high-priority::before {
  content: '🚨';
}

/* Smart Teacher Styles */
.smart-teacher-status {
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
