/* ayah-repeat.css — لوحة تكرار الآيات للحفظ (المصحف) */
.ar-panel{
  position:fixed; z-index:8600; direction:rtl; inset-inline:0; margin-inline:auto; box-sizing:border-box;
  bottom:calc(10px + env(safe-area-inset-bottom, 0px)); width:min(560px, calc(100vw - 16px));
  max-height:calc(100dvh - 90px); overflow-y:auto; overscroll-behavior:contain;
  padding:12px 14px 14px; border-radius:20px; border:1px solid var(--gold, #c9a24b);
  background:var(--surface, #121f3b); color:var(--text, #f3efe3);
  box-shadow:0 16px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.2);
  font-family:var(--font-body, 'Tajawal', sans-serif); animation:arIn .22s ease both;
}
@keyframes arIn{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }
@media (max-width:768px){ body.has-bnav .ar-panel{ bottom:calc(80px + env(safe-area-inset-bottom, 0px)); max-height:calc(100dvh - 160px); } }
body.has-ar{ padding-bottom:calc(330px + env(safe-area-inset-bottom, 0px)) !important; }
body.has-ar .toast{ bottom:calc(360px + env(safe-area-inset-bottom, 0px)); }
/* الوضع السينمائي: الأكشن بار بتاع الآية ميتداخلش مع اللوحة */

.ar-head{ display:flex; align-items:center; gap:6px; }
.ar-title{ flex:1; font-weight:800; font-size:.95rem; color:var(--gold-bright, #e6c877); }
.ar-surah{ font-weight:600; color:var(--text-dim, #a9b3c9); font-size:.82rem; }
.ar-icon{
  width:34px; height:34px; border-radius:50%; cursor:pointer; font-size:.95rem; line-height:1; font-family:inherit;
  border:1px solid var(--border, rgba(201,162,75,.3)); background:var(--surface-2, #1a2a4d); color:var(--text, #f3efe3);
}
.ar-icon:hover, .ar-icon:focus-visible{ border-color:var(--gold, #c9a24b); outline:none; }

.ar-now{ text-align:center; margin:8px 0 4px; }
.ar-now-main{ font-family:var(--font-display, 'Amiri', serif); font-size:1.7rem; font-weight:700; line-height:1.3; color:var(--text, #f3efe3); }
.ar-now-sub{ font-size:.8rem; color:var(--text-dim, #a9b3c9); min-height:1.3em; margin-top:2px; }
.ar-bar{ height:5px; border-radius:99px; background:var(--surface-2, #1a2a4d); overflow:hidden; margin:9px auto 0; max-width:340px; }
.ar-bar i{ display:block; height:100%; width:0; border-radius:99px; background:linear-gradient(90deg, var(--gold, #c9a24b), var(--gold-bright, #e6c877)); transition:width .35s ease; }

.ar-ctrls{ display:flex; justify-content:center; align-items:center; gap:14px; margin:10px 0 4px; direction:ltr; }
.ar-ctl{
  width:46px; height:46px; border-radius:50%; cursor:pointer; font-size:1.05rem; font-family:inherit;
  border:1px solid var(--border, rgba(201,162,75,.3)); background:var(--surface-2, #1a2a4d); color:var(--text, #f3efe3);
  transition:transform .12s ease, border-color .15s ease;
}
.ar-ctl:hover, .ar-ctl:focus-visible{ border-color:var(--gold, #c9a24b); outline:none; }
.ar-ctl:active{ transform:scale(.94); }
.ar-ctl.ar-main{ width:62px; height:62px; font-size:1.5rem; background:var(--gold, #c9a24b); color:#171203; border-color:var(--gold, #c9a24b); box-shadow:0 6px 18px color-mix(in srgb, var(--gold, #c9a24b) 40%, transparent); }
.ar-panel.ar-playing-now .ar-ctl.ar-main{ animation:arPulse 2.2s ease-in-out infinite; }
@keyframes arPulse{ 0%,100%{ box-shadow:0 6px 18px color-mix(in srgb, var(--gold, #c9a24b) 40%, transparent); } 50%{ box-shadow:0 6px 26px color-mix(in srgb, var(--gold, #c9a24b) 70%, transparent); } }

.ar-settings{ margin-top:8px; padding-top:10px; border-top:1px dashed var(--border, rgba(201,162,75,.3)); display:flex; flex-direction:column; gap:10px; }
.ar-settings.ar-collapsed{ display:none; }
.ar-row{ display:flex; align-items:center; flex-wrap:wrap; gap:8px 10px; }
.ar-lbl{ font-size:.8rem; font-weight:700; color:var(--text-dim, #a9b3c9); min-width:74px; }
.ar-range-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; }
.ar-cell{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.ar-cell .ar-lbl{ min-width:0; }
.ar-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.ar-chip{
  font-family:inherit; font-weight:800; font-size:.82rem; cursor:pointer; padding:6px 13px; border-radius:99px; min-width:38px;
  border:1px solid var(--border, rgba(201,162,75,.3)); background:var(--surface-2, #1a2a4d); color:var(--text, #f3efe3);
  transition:background .18s ease, color .18s ease, border-color .18s ease;
}
.ar-chip:hover{ border-color:var(--gold, #c9a24b); }
.ar-chip.on{ background:var(--gold, #c9a24b); color:#171203; border-color:var(--gold, #c9a24b); }
.ar-step{ display:inline-flex; align-items:center; gap:4px; direction:ltr; }
.ar-stepbtn{
  width:32px; height:32px; border-radius:10px; cursor:pointer; font-size:1.1rem; font-weight:800; font-family:inherit; line-height:1;
  border:1px solid var(--border, rgba(201,162,75,.3)); background:var(--surface-2, #1a2a4d); color:var(--text, #f3efe3);
}
.ar-stepbtn:hover, .ar-stepbtn:focus-visible{ border-color:var(--gold, #c9a24b); outline:none; }
.ar-num{
  width:58px; height:32px; box-sizing:border-box; text-align:center; font-family:inherit; font-weight:800; font-size:.95rem;
  border-radius:10px; border:1px solid var(--border, rgba(201,162,75,.3)); background:var(--surface-2, #1a2a4d); color:var(--text, #f3efe3);
  -moz-appearance:textfield; appearance:textfield;
}
.ar-num::-webkit-outer-spin-button, .ar-num::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.ar-hint{ font-size:.72rem; color:var(--text-dim, #a9b3c9); margin-top:-4px; }
.ar-select{
  flex:1; min-width:150px; height:36px; padding:0 10px; border-radius:10px; font-family:inherit; font-size:.88rem;
  border:1px solid var(--border, rgba(201,162,75,.3)); background:var(--surface-2, #1a2a4d); color:var(--text, #f3efe3);
}

/* تظليل الآيات في المصحف */
.ayah.ar-range{ background:color-mix(in srgb, var(--gold, #c9a24b) 11%, transparent); border-radius:6px; -webkit-box-decoration-break:clone; box-decoration-break:clone; }
.ayah.ar-playing{
  background:color-mix(in srgb, var(--gold, #c9a24b) 30%, transparent); border-radius:8px;
  box-shadow:0 0 0 2px color-mix(in srgb, var(--gold, #c9a24b) 60%, transparent), 0 0 16px 2px color-mix(in srgb, var(--gold, #c9a24b) 35%, transparent);
  -webkit-box-decoration-break:clone; box-decoration-break:clone; transition:background .3s ease, box-shadow .3s ease;
}
.ayah.ar-playing .ayah-end{ background:var(--gold, #c9a24b); color:#171203; border-color:var(--gold, #c9a24b); }

[data-theme="light"] .ar-title, [data-theme="light"] .ar-now-main{ color:color-mix(in srgb, var(--gold-bright, #fbbf24) 55%, #000); }
[data-theme="light"] .ar-panel{ box-shadow:0 14px 34px rgba(0,0,0,.2); }
@media (max-width:380px){ .ar-lbl{ min-width:100%; } }
@media (prefers-reduced-motion:reduce){ .ar-panel, .ar-panel.ar-playing-now .ar-ctl.ar-main{ animation:none; } .ar-bar i{ transition:none; } }
@media print{ .ar-panel{ display:none !important; } body.has-ar{ padding-bottom:0 !important; } }
