/* ===================================================
   فرّغ — ملف التصميم (style.css)
   كل ما يخصّ الألوان، الخطوط، والأشكال
   =================================================== */

/* ----- المتغيّرات: ألوان التطبيق في مكان واحد ----- */
:root{
  --bg:#fbf9f4;          /* خلفية الصفحة */
  --bg-warm:#f5f1e8;     /* خلفية دافئة للعناصر */
  --ink:#1a1614;         /* لون النص الأساسي */
  --ink-soft:#4a423d;    /* نص أفتح */
  --mist:#8a7f76;        /* نص رمادي */
  --line:#e6ddd0;        /* لون الحدود */
  --card:#ffffff;        /* خلفية البطاقات */
  --brand:#c8633a;       /* اللون البرتقالي الأساسي */
  --brand-deep:#a84e2a;  /* برتقالي غامق */
  --brand-soft:#fbeee7;  /* برتقالي فاتح جداً */
  --gold:#d99e3f;        /* ذهبي للمسات */
  --green:#5b8c5a;       /* أخضر للنجاح */
}

/* ----- إعادة ضبط أساسية ----- */
*{ margin:0; padding:0; box-sizing:border-box; }

body{
  font-family:'Tajawal', sans-serif;
  background:var(--bg);
  color:var(--ink);
  min-height:100vh;
  line-height:1.7;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(200,99,58,.04), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(217,158,63,.05), transparent 45%);
}

.mono{
  font-family:'IBM Plex Mono', monospace;
  direction:ltr;
  display:inline-block;
}

/* ----- الشريط العلوي ----- */
.top{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 26px; max-width:880px; margin:0 auto;
}
.logo{ display:flex; align-items:center; gap:12px; }
.logo-mark{
  width:44px; height:44px; border-radius:13px;
  background:linear-gradient(145deg, var(--brand), var(--brand-deep));
  display:grid; place-items:center;
  box-shadow:0 8px 20px rgba(200,99,58,.25);
}
.logo-mark svg{ width:24px; height:24px; }
.logo-text{ font-weight:900; font-size:22px; letter-spacing:-.5px; }
.logo-sub{ font-size:12px; color:var(--mist); font-weight:500; margin-top:-4px; }

/* زر الوضع الليلي */
.theme-btn{
  background:var(--card); border:1px solid var(--line);
  width:44px; height:44px; border-radius:13px; cursor:pointer;
  font-size:20px; display:grid; place-items:center; transition:.2s;
}
.theme-btn:hover{ border-color:var(--brand); transform:translateY(-2px); }

/* ----- العنوان الرئيسي ----- */
.hero{ max-width:880px; margin:0 auto; padding:30px 26px 16px; text-align:center; }
.hero h1{
  font-size:clamp(28px, 6vw, 44px); font-weight:900;
  letter-spacing:-1px; line-height:1.2; margin-bottom:14px;
}
.hero h1 .hl{ color:var(--brand); position:relative; }
.hero h1 .hl::after{
  content:''; position:absolute; left:0; right:0; bottom:4px; height:9px;
  background:rgba(217,158,63,.3); z-index:-1; border-radius:3px;
}
.hero p{ font-size:clamp(15px, 3vw, 18px); color:var(--ink-soft); max-width:540px; margin:0 auto; }

/* ----- الحاوية الرئيسية ----- */
.shell{ max-width:720px; margin:0 auto; padding:24px 22px 40px; }

/* ----- منطقة رفع الملف ----- */
.drop{
  background:var(--card);
  border:2px dashed var(--line);
  border-radius:22px;
  padding:46px 30px; text-align:center;
  transition:.3s; cursor:pointer; position:relative;
}
.drop:hover{ border-color:var(--brand); background:#fffdfa; }
.drop.dragging{ border-color:var(--brand); background:var(--brand-soft); transform:scale(1.01); }
.drop-ic{
  width:72px; height:72px; margin:0 auto 18px;
  border-radius:20px; background:var(--brand-soft);
  display:grid; place-items:center;
}
.drop-ic svg{ width:34px; height:34px; color:var(--brand); }
.drop h3{ font-size:20px; font-weight:800; margin-bottom:7px; }
.drop p{ font-size:14px; color:var(--mist); margin-bottom:20px; }
.drop-btn{
  display:inline-flex; align-items:center; gap:9px;
  background:linear-gradient(145deg, var(--brand), var(--brand-deep));
  color:#fff; font-family:'Tajawal', sans-serif; font-weight:700; font-size:15px;
  border:none; border-radius:13px; padding:14px 28px; cursor:pointer;
  box-shadow:0 6px 18px rgba(200,99,58,.25); transition:.2s;
}
.drop-btn:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(200,99,58,.3); }
.drop-btn svg{ width:18px; height:18px; }
.formats{ margin-top:18px; font-size:12px; color:var(--mist); }
.formats .mono{ background:var(--bg-warm); padding:2px 8px; border-radius:6px; margin:0 2px; }

/* ----- شاشة المعالجة ----- */
.stage{ display:none; }
.stage.show{ display:block; animation:fade .5s ease; }
@keyframes fade{ from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:translateY(0);} }

.file-bar{
  background:var(--card); border:1px solid var(--line);
  border-radius:16px; padding:16px 20px;
  display:flex; align-items:center; gap:14px; margin-bottom:18px;
}
.file-bar .fw{
  width:46px; height:46px; border-radius:12px; flex-shrink:0;
  background:linear-gradient(145deg, var(--brand), var(--brand-deep));
  display:grid; place-items:center;
}
.file-bar .fw svg{ width:22px; height:22px; color:#fff; }
.file-bar .fi{ flex:1; min-width:0; }
.file-bar .fi b{ display:block; font-size:15px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-bar .fi span{ font-size:12px; color:var(--mist); }
.file-bar .reset{
  background:var(--bg-warm); border:none; border-radius:10px;
  width:38px; height:38px; cursor:pointer; color:var(--mist);
  display:grid; place-items:center; flex-shrink:0; transition:.2s;
}
.file-bar .reset:hover{ background:var(--brand-soft); color:var(--brand); }
.file-bar .reset svg{ width:18px; height:18px; }

/* ----- شريط التقدّم ----- */
.proc{
  background:var(--card); border:1px solid var(--line);
  border-radius:18px; padding:26px; margin-bottom:18px;
}
.proc-head{ display:flex; align-items:center; gap:11px; margin-bottom:20px; }
.spinner{
  width:22px; height:22px; border:2.5px solid var(--line);
  border-top-color:var(--brand); border-radius:50%;
  animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.proc-head b{ font-size:16px; font-weight:800; }

.pbar-track{ height:8px; background:var(--bg-warm); border-radius:10px; overflow:hidden; margin-bottom:8px; }
.pbar-fill{ height:100%; width:0; background:linear-gradient(90deg, var(--brand), var(--gold)); border-radius:10px; transition:width .4s ease; }
.pbar-label{ display:flex; justify-content:space-between; font-size:12px; color:var(--mist); }

.steps{ margin-top:22px; display:flex; flex-direction:column; gap:2px; }
.pstep{ display:flex; align-items:center; gap:12px; padding:8px 0; font-size:14px; color:var(--mist); transition:.3s; }
.pstep .si{
  width:24px; height:24px; border-radius:7px; flex-shrink:0;
  display:grid; place-items:center; font-size:12px;
  background:var(--bg-warm); transition:.3s;
}
.pstep.on{ color:var(--ink); }
.pstep.on .si{ background:var(--brand-soft); color:var(--brand); }
.pstep.fin{ color:var(--ink-soft); }
.pstep.fin .si{ background:rgba(91,140,90,.12); color:var(--green); }

/* ----- النتيجة ----- */
.result{ display:none; }
.result.show{ display:block; animation:fade .5s ease; }

.res-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:14px; flex-wrap:wrap; gap:12px;
}
.res-title{ display:flex; align-items:center; gap:10px; font-size:17px; font-weight:800; }
.res-title .dot{ width:9px; height:9px; border-radius:50%; background:var(--green); }
.res-actions{ display:flex; gap:9px; }
.act-btn{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--card); border:1px solid var(--line);
  color:var(--ink-soft); font-family:'Tajawal', sans-serif; font-weight:600; font-size:13px;
  border-radius:11px; padding:9px 15px; cursor:pointer; transition:.2s;
}
.act-btn:hover{ border-color:var(--brand); color:var(--brand); }
.act-btn.primary{ background:linear-gradient(145deg, var(--brand), var(--brand-deep)); color:#fff; border:none; }
.act-btn.primary:hover{ color:#fff; transform:translateY(-1px); }
.act-btn svg{ width:15px; height:15px; }

.transcript{
  background:var(--card); border:1px solid var(--line);
  border-radius:18px; padding:8px;
}
.seg{ display:flex; gap:14px; padding:14px 16px; border-radius:12px; transition:.2s; cursor:pointer; }
.seg:hover{ background:var(--bg-warm); }
.seg:hover .seg-time{ background:var(--brand); color:#fff; }
.seg.playing{ background:var(--brand-soft); box-shadow:inset 3px 0 0 var(--brand); }
.seg.playing .seg-time{ background:var(--brand); color:#fff; }
.seg-time{
  font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--brand);
  flex-shrink:0; padding-top:3px; direction:ltr; font-weight:500;
  background:var(--brand-soft); height:fit-content; padding:3px 8px; border-radius:6px;
}
.seg-text{ font-size:16px; line-height:1.85; color:var(--ink); }
.seg-speaker{ font-size:12px; font-weight:700; color:var(--mist); display:block; margin-bottom:3px; }

/* ----- إشعار النسخ ----- */
.toast{
  position:fixed; bottom:30px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff; padding:12px 22px; border-radius:12px;
  font-size:14px; font-weight:600; opacity:0; transition:.3s; z-index:100;
  display:flex; align-items:center; gap:8px;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast svg{ width:16px; height:16px; color:var(--green); }

/* ----- شريط المميزات ----- */
.why{ max-width:720px; margin:0 auto; padding:10px 22px 50px; }
.why-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; }
.why-card{
  background:var(--card); border:1px solid var(--line);
  border-radius:16px; padding:20px; text-align:center;
}
.why-card .wic{
  width:46px; height:46px; margin:0 auto 12px; border-radius:13px;
  background:var(--brand-soft); display:grid; place-items:center;
}
.why-card .wic svg{ width:22px; height:22px; color:var(--brand); }
.why-card b{ display:block; font-size:15px; font-weight:800; margin-bottom:5px; }
.why-card span{ font-size:13px; color:var(--mist); line-height:1.5; }

/* ----- ملاحظة المحرّك ----- */
.note{ max-width:720px; margin:0 auto 40px; padding:0 22px; }
.note-inner{
  background:var(--bg-warm); border:1px solid var(--line);
  border-radius:16px; padding:20px;
}
.note-inner b{
  color:var(--brand-deep); font-weight:800; display:flex; align-items:center; gap:8px;
  margin-bottom:8px; font-size:14px;
}
.note-inner b svg{ width:18px; height:18px; }
.note-inner p{ font-size:13px; color:var(--ink-soft); line-height:1.7; }

/* ----- التذييل ----- */
.foot{
  text-align:center; padding:24px; font-size:12px; color:var(--mist);
  border-top:1px solid var(--line); max-width:720px; margin:0 auto;
}

/* ----- التجاوب مع الجوال ----- */
@media(max-width:560px){
  .why-grid{ grid-template-columns:1fr; }
  .drop{ padding:36px 20px; }
  .res-toolbar{ flex-direction:column; align-items:stretch; }
  .res-actions{ justify-content:stretch; }
  .act-btn{ flex:1; justify-content:center; }
}


/* ===================================================
   الوضع الليلي (يُفعّل عند إضافة class="dark" للـ body)
   نعيد تعريف المتغيّرات بألوان داكنة
   =================================================== */
body.dark{
  --bg:#0f1115;
  --bg-warm:#1a1d24;
  --ink:#e8eaed;
  --ink-soft:#b0b4bb;
  --mist:#7a8089;
  --line:#2a2e36;
  --card:#181b21;
  --brand:#e0843f;
  --brand-deep:#c66a28;
  --brand-soft:#2a1f17;
  --gold:#d99e3f;
  --green:#5fa85e;
}

/* تعديلات بصرية للوضع الليلي */
body.dark{
  background-image:
    radial-gradient(circle at 15% 0%, rgba(224,132,63,.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(217,158,63,.04), transparent 45%);
}

body.dark .hero h1 .hl::after{ background:rgba(217,158,63,.2); }
body.dark .drop:hover{ background:#1d2027; }
body.dark .seg-text{ color:var(--ink); }


/* ===================================================
   تنسيقات الميزات الجديدة
   =================================================== */

/* قائمة التنزيل المنسدلة (ميزة 2) */
.dl-wrap{ position:relative; }
.dl-menu{
  position:absolute; top:calc(100% + 6px); left:0; z-index:50;
  background:var(--card); border:1px solid var(--line);
  border-radius:12px; padding:6px; min-width:190px;
  box-shadow:0 10px 30px rgba(0,0,0,.15);
  animation:fade .2s ease;
}
.dl-menu button{
  display:block; width:100%; text-align:right;
  background:none; border:none; cursor:pointer;
  font-family:'Tajawal',sans-serif; font-size:14px; color:var(--ink);
  padding:11px 14px; border-radius:8px; transition:.15s;
}
.dl-menu button:hover{ background:var(--brand-soft); color:var(--brand); }

/* الفقرة النشطة أثناء التشغيل (ميزة 3) */
.seg{ cursor:pointer; }
.seg.playing{
  background:var(--brand-soft);
  box-shadow:inset 3px 0 0 var(--brand);
}
.seg.playing .seg-time{ background:var(--brand); color:#fff; }

/* وضع التعديل (ميزة 1) */
.seg.editing{ background:var(--bg-warm); cursor:default; }
.seg.editing .seg-words{
  outline:2px solid var(--brand); outline-offset:3px;
  border-radius:6px; padding:2px 4px; background:var(--card);
}
.act-btn.active{
  background:var(--green); color:#fff; border-color:var(--green);
}
.act-btn.active:hover{ color:#fff; }


/* ===================================================
   شاشة الاشتراك
   =================================================== */
.subscribe-screen{
  text-align:center; padding:20px 0 40px; animation:fade .5s ease;
}
.sub-reason{
  display:inline-flex; align-items:center; gap:10px;
  background:#fdf6ee; border:1px solid #f0d9c4;
  color:#a84e2a; font-size:14px; font-weight:600;
  padding:12px 20px; border-radius:14px; margin-bottom:26px;
}
.sub-reason svg{ width:20px; height:20px; flex-shrink:0; }
.sub-title{ font-size:26px; font-weight:900; margin-bottom:8px; letter-spacing:-.5px; }
.sub-sub{ font-size:15px; color:var(--mist); margin-bottom:30px; }

.plans{
  display:grid; grid-template-columns:repeat(2,1fr); gap:18px;
  max-width:640px; margin:0 auto;
}
.plan{
  background:var(--card); border:1.5px solid var(--line);
  border-radius:20px; padding:28px 24px; text-align:right;
  position:relative; transition:.25s;
}
.plan:hover{ transform:translateY(-4px); box-shadow:0 14px 36px rgba(0,0,0,.08); }
.plan.featured{
  border-color:var(--brand);
  box-shadow:0 10px 30px rgba(200,99,58,.15);
}
.plan-badge{
  position:absolute; top:-12px; left:24px;
  background:linear-gradient(145deg,var(--brand),var(--brand-deep));
  color:#fff; font-size:12px; font-weight:700;
  padding:5px 14px; border-radius:20px;
}
.plan-name{ font-size:18px; font-weight:800; color:var(--brand); margin-bottom:10px; }
.plan-price{ margin-bottom:20px; }
.plan-price .amount{ font-size:38px; font-weight:900; letter-spacing:-1px; }
.plan-price .per{ font-size:15px; color:var(--mist); font-weight:500; }
.plan-feats{ list-style:none; margin-bottom:24px; }
.plan-feats li{
  font-size:14px; color:var(--ink-soft); padding:7px 0;
  border-bottom:1px solid var(--line-soft);
}
.plan-feats li:last-child{ border-bottom:none; }
.plan-btn{
  width:100%; padding:14px; border-radius:13px; cursor:pointer;
  font-family:'Tajawal',sans-serif; font-weight:700; font-size:15px;
  background:var(--bg-warm); color:var(--ink); border:1.5px solid var(--line);
  transition:.2s;
}
.plan-btn:hover{ border-color:var(--brand); color:var(--brand); }
.featured-btn{
  background:linear-gradient(145deg,var(--brand),var(--brand-deep));
  color:#fff; border:none;
}
.featured-btn:hover{ color:#fff; transform:translateY(-2px); box-shadow:0 8px 20px rgba(200,99,58,.3); }
.sub-back{
  margin-top:30px; background:none; border:none; cursor:pointer;
  font-family:'Tajawal',sans-serif; font-size:15px; font-weight:600; color:var(--mist);
  padding:10px 20px; border-radius:10px; transition:.2s;
}
.sub-back:hover{ color:var(--brand); background:var(--bg-warm); }

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


/* ===================================================
   عدّاد الملفات المجانية
   =================================================== */
.quota-bar{
  margin-top:22px; text-align:center;
  background:var(--bg-warm); border:1px solid var(--line);
  border-radius:12px; padding:12px 18px;
  font-size:13px; color:var(--ink-soft);
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.quota-bar b{ color:var(--brand); font-weight:800; }
.quota-dot{
  width:9px; height:9px; border-radius:50%; background:var(--green);
  display:inline-block; flex-shrink:0;
}
.quota-dot.empty{ background:#c0392b; }
.quota-bar.empty{ background:#fdf0ef; border-color:#f0d0cc; }
.quota-bar a{
  color:var(--brand); font-weight:700; cursor:pointer; text-decoration:underline;
}
