/* استوديو مقاطع التلاوة — هوية كحلية وذهبية */
:root{
  --navy:#0B1D33;
  --navy-2:#10283f;
  --navy-3:#16324e;
  --gold:#C9A227;
  --gold-soft:#E3C565;
  --ink:#F4EFE3;
  --ink-dim:#B9C4CE;
  --danger:#d9534f;
  --radius:16px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"Segoe UI",Tahoma,Arial,sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -100px, #1b3a5c 0%, transparent 60%),
    var(--navy);
  color:var(--ink);
  min-height:100vh;
}
a{color:var(--gold-soft)}
.hidden{display:none !important}

/* ---------- الترويسة ---------- */
.hero{
  text-align:center;
  padding:34px 16px 8px;
  position:relative;
}
.hero h1{
  margin:6px 0 8px;
  font-size:clamp(28px,6vw,44px);
  color:var(--gold-soft);
  font-weight:800;
  letter-spacing:.2px;
}
.hero-sub{
  margin:0 auto;
  max-width:560px;
  color:var(--ink-dim);
  font-size:clamp(15px,3.6vw,18px);
  line-height:1.9;
}
.hero-ornament{
  font-size:34px;color:var(--gold);opacity:.85;line-height:1;
}
.hero-ornament.flip{transform:scaleX(-1)}

/* ---------- التخطيط ---------- */
main{
  max-width:760px;
  margin:0 auto;
  padding:14px 14px 40px;
  display:flex;flex-direction:column;gap:18px;
}
.card{
  background:linear-gradient(180deg,var(--navy-2),var(--navy-3));
  border:1px solid rgba(201,162,39,.35);
  border-radius:var(--radius);
  padding:20px 18px 22px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.card h2{
  margin:0 0 14px;
  font-size:22px;
  color:var(--ink);
  display:flex;align-items:center;gap:10px;
}
.step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:50%;
  background:var(--gold);color:var(--navy);
  font-weight:900;font-size:18px;flex:0 0 auto;
}
.note{color:var(--ink-dim);line-height:1.9;font-size:15px}
.note.error{color:#ffb3ae}
.note.center{text-align:center}
.note b{color:var(--gold-soft)}

/* ---------- الحقول ---------- */
.field{display:block;margin:0 0 14px}
.field>span,.field-label{
  display:block;margin-bottom:7px;font-size:15px;color:var(--ink-dim);font-weight:600;
}
.field input[type="text"],.field select,.field input[type="file"]{
  width:100%;
  padding:13px 14px;
  font-size:17px;
  font-family:inherit;
  color:var(--ink);
  background:#0a1a2c;
  border:1px solid rgba(201,162,39,.45);
  border-radius:12px;
  min-height:52px;
}
.field input[type="file"]{padding:11px 14px}
.field input:focus,.field select:focus{outline:2px solid var(--gold);outline-offset:1px}

/* ---------- التبويبات ---------- */
.tabs{display:flex;gap:10px;margin-bottom:16px}
.tab{
  flex:1;
  padding:14px 8px;
  font-size:16.5px;font-family:inherit;font-weight:700;
  color:var(--ink-dim);
  background:#0a1a2c;
  border:1px solid rgba(201,162,39,.35);
  border-radius:12px;cursor:pointer;min-height:54px;
}
.tab.active{background:var(--gold);color:var(--navy);border-color:var(--gold)}

/* ---------- المشغّل ---------- */
.player-box{
  margin-top:6px;
  background:#0a1a2c;
  border:1px dashed rgba(201,162,39,.4);
  border-radius:12px;
  padding:14px;
}
.now-playing{font-size:16px;color:var(--gold-soft);margin-bottom:10px;font-weight:700;line-height:1.8}
.player-box audio{width:100%}

/* ---------- القص ---------- */
.trim-row{margin-bottom:18px}
.trim-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.trim-head label{font-size:17px;font-weight:700}
.time-input{
  width:92px;text-align:center;
  padding:9px 6px;font-size:17px;font-family:inherit;
  color:var(--ink);background:#0a1a2c;
  border:1px solid rgba(201,162,39,.45);border-radius:10px;
  direction:ltr;
}
input[type="range"]{
  width:100%;height:44px;accent-color:var(--gold);cursor:pointer;
}
.mini-btn{
  margin-top:2px;
  padding:9px 12px;font-size:14.5px;font-family:inherit;
  color:var(--gold-soft);background:transparent;
  border:1px solid rgba(201,162,39,.5);border-radius:10px;cursor:pointer;min-height:42px;
}
.trim-actions{
  display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;
  border-top:1px solid rgba(201,162,39,.25);padding-top:14px;
}
.seg-length{font-size:17px}
.seg-length b{color:var(--gold-soft)}
.check{display:inline-flex;align-items:center;gap:9px;font-size:16px;cursor:pointer;min-height:44px}
.check input{width:22px;height:22px;accent-color:var(--gold)}

/* ---------- الأزرار ---------- */
.btn{
  display:inline-block;text-align:center;
  padding:14px 22px;font-size:17px;font-family:inherit;font-weight:800;
  border-radius:12px;border:1px solid transparent;cursor:pointer;
  text-decoration:none;min-height:54px;
}
.btn.gold{background:var(--gold);color:var(--navy)}
.btn.gold:active{background:var(--gold-soft)}
.btn.danger{background:transparent;color:#ffb3ae;border-color:var(--danger)}
.btn.big{width:100%;font-size:19px;padding:16px}
.btn[disabled]{opacity:.45;pointer-events:none}

/* ---------- الرقائق ---------- */
.chips{display:flex;flex-wrap:wrap;gap:9px}
.chip{
  padding:12px 14px;font-size:15.5px;font-family:inherit;font-weight:700;
  color:var(--ink-dim);background:#0a1a2c;
  border:1px solid rgba(201,162,39,.35);border-radius:999px;cursor:pointer;min-height:48px;
}
.chip.active{background:var(--gold);color:var(--navy);border-color:var(--gold)}

/* ---------- مسرح المعاينة ---------- */
.canvas-wrap{
  margin:16px auto 6px;
  display:flex;justify-content:center;
}
.canvas-wrap canvas{
  height:min(62vh,560px);
  max-width:100%;
  border-radius:14px;
  border:1px solid rgba(201,162,39,.5);
  box-shadow:0 14px 40px rgba(0,0,0,.5);
  background:#071526;
}
.canvas-wrap.horizontal canvas{height:auto;width:100%}

/* ---------- التصدير ---------- */
.progress-track{
  height:16px;border-radius:999px;background:#0a1a2c;
  border:1px solid rgba(201,162,39,.4);overflow:hidden;margin-top:16px;
}
.progress-fill{
  height:100%;width:0%;
  background:linear-gradient(90deg,var(--gold),var(--gold-soft));
  transition:width .2s linear;
}
.progress-label{text-align:center;margin-top:8px;font-size:16px;color:var(--gold-soft);font-weight:700}
#result-box{margin-top:18px;display:flex;flex-direction:column;gap:14px}
#result-video{width:100%;border-radius:12px;background:#000;max-height:60vh}

/* ---------- النشر على قناتنا (يوتيوب) ---------- */
.yt-panel{
  border-top:1px solid rgba(201,162,39,.25);
  padding-top:16px;
  display:flex;flex-direction:column;gap:12px;
}
.yt-panel h3{margin:0;font-size:19px;color:var(--gold-soft)}
.yt-panel .note{margin:0}
.yt-text-box{
  background:#0a1a2c;
  border:1px solid rgba(201,162,39,.4);
  border-radius:12px;
  padding:13px 14px;
}
.yt-title{font-weight:800;font-size:16.5px;line-height:1.8;color:var(--ink);margin-bottom:8px}
.yt-desc{
  margin:0;font-family:inherit;font-size:14.5px;line-height:1.9;
  color:var(--ink-dim);white-space:pre-wrap;word-break:break-word;
}

/* ---------- التنبيه العابر (توست) ---------- */
.toast{
  position:fixed;bottom:22px;left:50%;transform:translateX(-50%);
  background:var(--gold);color:var(--navy);
  font-weight:800;font-size:16px;font-family:inherit;
  padding:11px 24px;border-radius:999px;
  box-shadow:0 10px 26px rgba(0,0,0,.45);
  z-index:60;opacity:0;transition:opacity .25s;pointer-events:none;
  max-width:88vw;text-align:center;
}
.toast.show{opacity:1}

/* ---------- التذييل ---------- */
.site-footer{text-align:center;color:var(--ink-dim);font-size:14.5px;line-height:2;padding:6px 10px 0}

@media (max-width:480px){
  .card{padding:16px 13px 18px}
  .tabs{flex-direction:column}
  .trim-actions{flex-direction:column;align-items:stretch;text-align:center}
  .trim-actions .btn{width:100%}
  .check{justify-content:center}
}

/* إعدادات وضع المصحف */
.mushaf-controls{
  border:1px solid rgba(227,197,101,.35);
  background:rgba(227,197,101,.06);
  border-radius:14px;
  padding:14px 16px;
  margin-top:14px;
}
.mushaf-controls input[type="number"]{max-width:130px}
#ayah-status{margin-top:6px}
