/* assets/style.css — مدرّسي (AI Teacher) — نظام التصميم الموحّد */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600&display=swap');

:root {
  --ink: #14202B;
  --ink-soft: #1F2E3C;
  --sand: #EFE6D3;
  --sand-dim: #E4D9C2;
  --paper: #F7F5EF;
  --white: #FFFFFF;
  --turq: #2F8F8A;
  --turq-dim: #24726E;
  --turq-tint: #E4F2F1;
  --gold: #C9973B;
  --gold-tint: #FBF3E4;
  --clay: #B5563C;
  --clay-tint: #F7E9E5;
  --ink-70: rgba(20, 32, 43, .72);
  --ink-45: rgba(20, 32, 43, .45);
  --border: #E3E7EA;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 30px -14px rgba(20, 32, 43, .28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--sand);
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { direction: rtl; }

h1, h2, h3, .display { font-family: 'Cairo', sans-serif; }

a { color: inherit; text-decoration: none; }

/* ===== شريط السدو (توقيع بصري متكرر) ===== */
.sadu-strip {
  height: 10px;
  background:
    linear-gradient(135deg, var(--gold) 25%, transparent 25%) -5px 0/10px 10px,
    linear-gradient(225deg, var(--gold) 25%, transparent 25%) -5px 0/10px 10px,
    linear-gradient(315deg, var(--clay) 25%, transparent 25%) 0 0/10px 10px,
    linear-gradient(45deg, var(--clay) 25%, transparent 25%) 0 0/10px 10px;
  background-color: var(--turq);
  opacity: .9;
  flex: none;
}

/* ===== الهيكل العام ===== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--ink);
  color: var(--sand);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex: none;
}
.topbar .brand { font-family: 'Cairo'; font-weight: 800; font-size: 15px; letter-spacing: .02em; color: var(--gold); }
.topbar .sub { font-size: 11px; color: rgba(239,230,211,.55); margin-top: 2px; }
.topbar button.icon-btn {
  background: rgba(239,230,211,.08); border: none; color: var(--sand);
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer;
}

main { flex: 1; padding: 20px 16px 90px; max-width: 480px; margin: 0 auto; width: 100%; }

/* ===== بطاقات ===== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.card.dark { background: var(--ink); color: var(--sand); border: none; }
.card.tint-turq { background: var(--turq-tint); border-color: rgba(47,143,138,.25); }
.card.tint-gold { background: var(--gold-tint); border-color: rgba(201,151,59,.3); }
.card.tint-clay { background: var(--clay-tint); border-color: rgba(181,86,60,.3); }

/* ===== أزرار ===== */
.btn {
  font-family: inherit; font-weight: 700; font-size: 14.5px; border: none;
  border-radius: var(--radius-md); padding: 14px 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--turq); color: var(--white); }
.btn-primary:hover { background: var(--turq-dim); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink-70); border: 1.5px solid var(--border); }
.btn-clay { background: var(--clay); color: var(--white); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }

/* ===== نماذج ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-70); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font-family: inherit; font-size: 14.5px; padding: 13px 14px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--white);
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--turq); outline-offset: 1px; border-color: var(--turq); }
.error-text { color: var(--clay); font-size: 12.5px; margin-top: 8px; min-height: 16px; }
.hint-text { color: var(--ink-45); font-size: 12px; margin-top: 6px; }

/* ===== شارات وتقدم ===== */
.pill { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill-turq { background: var(--turq-tint); color: var(--turq-dim); }
.pill-gold { background: var(--gold-tint); color: #8A6B2E; }
.pill-clay { background: var(--clay-tint); color: var(--clay); }

.progress-track { height: 8px; background: var(--sand-dim); border-radius: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--turq); border-radius: 8px; transition: width .3s ease; }

/* ===== شاشة تحميل ===== */
.center-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 14px;
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--sand-dim);
  border-top-color: var(--turq); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== قائمة سفلية للتنقل (طالب) ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--white);
  border-top: 1px solid var(--border); display: flex; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
}
.bottom-nav a {
  flex: 1; text-align: center; font-size: 11px; color: var(--ink-45); padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottom-nav a.active { color: var(--turq-dim); font-weight: 700; }
.bottom-nav .nav-icon { font-size: 18px; }

/* ===== فقاعات محادثة (الشرح) ===== */
.bubble { padding: 12px 15px; border-radius: 14px; font-size: 14px; line-height: 1.8; max-width: 92%; }
.bubble.bot { background: var(--sand-dim); border-bottom-right-radius: 4px; }

/* ===== أدوات مساعدة ===== */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--ink-45); font-size: 12.5px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--turq-dim); margin-bottom: 10px; }
