/* ArabicSteps — hand-written styles that complement Tailwind (works in CDN and built mode). */

[x-cloak] { display: none !important; }

/* Arabic text: generous line height so tashkeel never collides with lines above/below. */
.font-arabic,
[lang="ar"] {
  font-family: "Noto Naskh Arabic", "Amiri", "Scheherazade New", serif;
  font-feature-settings: "kern", "liga", "mark", "mkmk";
}

/* Arabic words inside English paragraphs */
.ar-inline {
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-size: 1.3em;
  line-height: 1.6;
  unicode-bidi: isolate;
  color: #0b3c3a;
}

/* Quiz options may mix English and Arabic */
.quiz-option { unicode-bidi: plaintext; }

/* Toggle buttons on the lesson page */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  border-width: 1px;
  border-radius: 9999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color .15s, color .15s, border-color .15s;
}
.toggle-btn:focus-visible { outline: 3px solid #a9d8d4; outline-offset: 2px; }

/* Lesson explanation typography */
.lesson-prose { color: #334155; font-size: 1.05rem; line-height: 1.8; }
.lesson-prose p { margin: 0 0 1rem; }
.lesson-prose h3 { font-weight: 700; color: #0f172a; font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.lesson-prose ul { margin: 0 0 1rem; padding-left: 1.25rem; list-style: disc; }
.lesson-prose li { margin: .35rem 0; }
.lesson-prose li::marker { color: #c98b2b; }
.lesson-prose strong { color: #0f172a; }

/* Admin */
.admin-btn {
  display: inline-flex; align-items: center;
  border: 1px solid #e2d1b0; background: #fff; color: #334155;
  border-radius: .6rem; padding: .35rem .7rem; font-size: .75rem; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.admin-btn:hover { border-color: #459e99; color: #0f5e5b; }
.admin-btn-primary { background: #0f5e5b; color: #fff; border-color: #0f5e5b; }
.admin-btn-primary:hover { background: #1a6b67; color: #fff; }
.admin-card { background: #fff; border: 1px solid #efe5d2; border-radius: 1rem; padding: 1.5rem; }
.admin-legend { font-weight: 700; color: #0d4a48; padding: 0 .4rem; }

/* ===================== v1.2.0 components ===================== */
.toggle-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.toggle-on  { background: #0f5e5b; color: #fff; border-color: #0f5e5b; }
.toggle-off { background: #fff; color: #475569; border-color: #e2d1b0; }

.chip { display: inline-flex; align-items: center; gap: .25rem; border-radius: 9999px; background: #f8f3ea; color: #334155;
        padding: .2rem .6rem; font-size: .75rem; font-weight: 600; }
.chip-brand { background: #eef7f6; color: #0f5e5b; }

.tile { display: block; border-radius: 1.25rem; background: #fff; border: 1px solid #efe5d2; padding: 1.25rem;
        transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: #76bdb8; box-shadow: 0 10px 25px -12px rgba(11, 60, 58, .25); transform: translateY(-1px); }

.btn-primary { display: inline-flex; align-items: center; gap: .5rem; border-radius: .9rem; background: #0f5e5b; color: #fff;
               padding: .75rem 1.25rem; font-weight: 600; transition: background .15s; }
.btn-primary:hover { background: #1a6b67; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { display: inline-flex; align-items: center; gap: .4rem; border-radius: .9rem; background: #fff; color: #0d4a48;
                 border: 1px solid #e2d1b0; padding: .6rem 1rem; font-weight: 600; transition: border-color .15s; }
.btn-secondary:hover { border-color: #459e99; }
.btn-secondary:disabled { opacity: .4; }
.input { width: 100%; border-radius: .75rem; border: 1px solid #e2d1b0; background: #fff; padding: .6rem .9rem; outline: none; }
.input:focus { border-color: #27827d; box-shadow: 0 0 0 3px #d5ecea; }

.stat { border-radius: 1rem; background: #fff; border: 1px solid #efe5d2; padding: .9rem .5rem; }
.stat-n { font-size: 1.6rem; font-weight: 800; color: #0f5e5b; }
.stat-l { font-size: .7rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }

/* Flip card */
.flip-card { perspective: 1400px; cursor: pointer; outline: none; }
.flip-inner { position: relative; min-height: 22rem; transition: transform .55s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flip-card.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
             text-align: center; padding: 2rem; border-radius: 1.75rem; background: #fff; border: 1px solid #efe5d2;
             box-shadow: 0 20px 40px -24px rgba(11, 60, 58, .35); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow-y: auto; }
.flip-back { transform: rotateY(180deg); background: linear-gradient(180deg, #fff, #fdfbf7); }
.flip-card:focus-visible .flip-face { outline: 3px solid #a9d8d4; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

/* Quran */
.quran-text { font-size: 2rem; line-height: 2.4; font-feature-settings: "kern", "liga", "mark", "mkmk"; }
@media (min-width: 640px) { .quran-text { font-size: 2.4rem; } }

/* Kids Corner */
.kids-body { background: radial-gradient(circle at 10% 10%, #fff7d6 0, transparent 40%), radial-gradient(circle at 90% 20%, #dff6ff 0, transparent 40%),
             radial-gradient(circle at 50% 90%, #ffe4ef 0, transparent 45%), #fffdf7; }
.text-kids { color: #f97316; text-shadow: 2px 2px 0 #fde68a; }
.kids-tile { display: flex; align-items: center; justify-content: center; gap: 1rem; border-radius: 2rem; padding: 2rem;
             color: #fff; box-shadow: 0 10px 0 rgba(0,0,0,.12); transition: transform .12s; }
.kids-tile:hover { transform: translateY(-3px) rotate(-1deg); }
.kids-tile:active { transform: translateY(3px); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.kids-tile-a { background: #f97316; } .kids-tile-b { background: #22c55e; } .kids-tile-c { background: #3b82f6; }
.kids-tile-d { background: #a855f7; } .kids-tile-e { background: #ec4899; }
.kids-card { display: flex; flex-direction: column; align-items: center; gap: .35rem; border-radius: 1.75rem; background: #fff;
             border: 4px solid #fde68a; padding: 1.25rem .75rem; box-shadow: 0 6px 0 #fcd34d; transition: transform .12s; }
.kids-card:hover { transform: translateY(-2px); }
.kids-pop { animation: kidspop .4s ease; }
@keyframes kidspop { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-3deg); } 100% { transform: scale(1); } }
.kids-back { display: inline-flex; align-items: center; gap: .3rem; border-radius: 9999px; background: #fff; padding: .55rem 1rem;
             font-weight: 800; color: #0d4a48; box-shadow: 0 3px 0 #e2d1b0; }

/* Admin layout */
.admin-nav a { display: flex; align-items: center; gap: .6rem; border-radius: .7rem; padding: .5rem .75rem; font-size: .875rem;
               font-weight: 600; color: #334155; }
.admin-nav a:hover { background: #f8f3ea; }
.admin-nav a.on { background: #0f5e5b; color: #fff; }
.admin-table { width: 100%; font-size: .85rem; }
.admin-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b;
                  background: #f8f3ea; padding: .6rem .8rem; }
.admin-table td { padding: .6rem .8rem; border-top: 1px solid #f8f3ea; vertical-align: top; }
.bar { height: .5rem; border-radius: 9999px; background: #27827d; }
