/* ============================================================
   AcadMind - עיצוב האפליקציה
   מועתק ומותאם מ-style.css של "עפרי מורה פרטי" (הוראת נתי:
   נראות פתיחה = הנראות של אפליקציית עפרי).
   ============================================================ */

:root {
  color-scheme: light only;
  --primary: #4A90D9;
  --primary-dark: #2E6BB5;
  --primary-light: #7FB3E8;
  --warm: #FF8C42;
  --warm-light: #FFB380;
  --success: #52B788;
  --success-light: #95D5B2;
  --gold: #FFD700;
  --bg: #FFF9F0;
  --bg-card: #FFFFFF;
  --text: #2D3142;
  --text-soft: #6B7280;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(45, 49, 66, 0.08);
  --shadow-md: 0 4px 12px rgba(45, 49, 66, 0.10);
  --shadow-lg: 0 12px 32px rgba(45, 49, 66, 0.14);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

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

html {
  direction: rtl;
  font-family: 'Sora', 'Heebo', -apple-system, sans-serif;
  font-size: 18px;
  background: linear-gradient(180deg, #FFE8F3 0%, #FFF9F0 30%, #FDF4E6 100%) !important;
  background-attachment: fixed !important;
  color: var(--text) !important;
  -webkit-font-smoothing: antialiased;
}
body { background: transparent !important; color: var(--text) !important; min-height: 100vh; display: flex; flex-direction: column; }

@media (prefers-color-scheme: dark) {
  html { background: linear-gradient(180deg, #FFE8F3 0%, #FFF9F0 30%, #FDF4E6 100%) !important; color: var(--text) !important; }
  .login-card, .topic-card, .subject-card, .app-header, .lesson-card, .exercise-card {
    background-color: white !important;
    color: var(--text) !important;
  }
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary-light); }
.btn-ghost:hover { background: var(--primary-light); color: white; }
.btn-warm { background: var(--warm); color: white; box-shadow: var(--shadow-md); }
.btn-warm:hover { background: #E67730; box-shadow: var(--shadow-lg); }
.btn-secondary { font-size: 0.9rem !important; padding: 10px 18px !important; opacity: 0.85; }

input[type="text"], input[type="password"], input[type="email"], input[type="tel"] {
  font-family: inherit;
  font-size: 1.1rem;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  width: 100%;
  transition: border 0.12s ease;
  text-align: right;
}
input:focus { outline: none; border-color: var(--primary); }

/* === מסך כניסה (דפוס עפרי) === */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}
.login-card {
  background: var(--bg-card);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-title { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.login-subtitle { font-size: 1.05rem; color: var(--text-soft); margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form button { margin-top: 12px; }
.login-error { color: #DC2626; font-size: 0.95rem; margin-top: 8px; min-height: 1.4em; }
.login-join-link { margin-top: 16px; font-size: 0.92rem; color: var(--text-soft); }
.login-join-link a { color: var(--primary); font-weight: 700; }

.brand-logo { text-align: center; margin-bottom: 18px; }
.brand-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary), var(--warm));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.brand-tagline { font-size: 0.95rem; color: var(--text-soft); font-weight: 600; }

/* === עין סיסמה (דפוס עפרי) === */
.password-wrap { position: relative; width: 100%; }
.password-wrap input { width: 100%; padding-left: 48px; }
.password-eye {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background 0.15s ease;
}
.password-eye:hover { background: var(--bg); }
.password-eye.on { color: var(--primary); }

/* === כותרת אפליקציה === */
.app-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.app-header .hello { font-weight: 800; color: var(--primary-dark); font-size: 1.1rem; }
.app-header .grade-pill {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
}

/* === רשימת מקצועות ונושאים === */
.section-title { font-size: 1.3rem; font-weight: 800; color: var(--text); margin: 18px 0 12px; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.subject-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 3px solid transparent;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.subject-card .subject-emoji { font-size: 2.6rem; margin-bottom: 8px; }
.subject-card .subject-name { font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); }
.subject-card .subject-meta { color: var(--text-soft); font-size: 0.9rem; margin-top: 6px; }

.topic-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.topic-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.topic-card .topic-title { font-weight: 700; font-size: 1.05rem; }
.topic-card .topic-meta { color: var(--text-soft); font-size: 0.85rem; margin-top: 4px; }
.topic-card .topic-arrow { color: var(--primary); font-size: 1.4rem; flex-shrink: 0; }

.empty-state {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-soft);
}
.empty-state .emoji { font-size: 3.5rem; margin-bottom: 12px; }

/* === מסך נושא: שיעור ותרגול === */
.lesson-card, .exercise-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px;
  margin-bottom: 16px;
}
.lesson-card h3 { color: var(--primary-dark); margin-bottom: 10px; }
.lesson-step { margin-bottom: 20px; }
.lesson-step .step-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.lesson-step .step-explanation { line-height: 1.7; }
.worked-example {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 12px;
  border-right: 4px solid var(--primary-light);
}
.worked-example .we-q { font-weight: 700; margin-bottom: 8px; }
.worked-example ol { padding-right: 20px; line-height: 1.8; }
.worked-example .we-highlight { margin-top: 8px; font-weight: 700; color: var(--primary-dark); }
.memory-tip {
  background: linear-gradient(135deg, #FFF3D6, #FFE8B3);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

.choices { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.choice {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: right;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: var(--primary-light); }
.choice.selected { border-color: var(--primary); background: #EAF3FC; }
.choice.correct { border-color: var(--success); background: #E8F7EF; }
.choice.incorrect { border-color: #DC2626; background: #FDECEC; }
.choice:focus-visible {
  outline: 3px solid #4A90D9;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(74, 144, 217, 0.2);
}

.exercise-feedback { margin: 12px 0; font-weight: 700; min-height: 1.5em; }
.exercise-feedback.ok { color: var(--success); }
.exercise-feedback.bad { color: #DC2626; }
.hint-box {
  background: #FFF8E6;
  border-radius: var(--radius);
  border-right: 4px solid var(--gold);
  padding: 12px 16px;
  margin: 10px 0;
  line-height: 1.6;
}
.exercise-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.progress-line { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 10px; }

.back-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  font-size: 0.95rem;
  margin-bottom: 10px;
  text-align: right;
}
.back-link:hover { color: var(--primary-dark); }

.note-soft { color: var(--text-soft); font-size: 0.88rem; margin-top: 8px; }

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.9) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

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

/* מובייל 375 + 768 */
@media (max-width: 768px) {
  #app { padding: 12px; }
  .subject-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 480px) {
  html { font-size: 16px; }
  .login-card, .lesson-card, .exercise-card { padding: 20px; }
  .app-header { padding: 12px 14px; }
  .subject-grid { grid-template-columns: 1fr; }
}
