/* iOS shell: device frame, status bar, Dynamic Island, lock screen, home screen, folders, dock, banners, alerts.
   The phone is laid out at a fixed design width of 393px and scaled to fit (see fitPhone in shell.js). */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", "Segoe UI", Tahoma, sans-serif;
  --icon: 62px;
  --row-gap: 14px;
  --blue: #0A84FF;
  --sheet: #f2f2f7;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 30%, #23232b, #0b0b0e 70%);
  font-family: var(--font); color: #111; overflow: hidden;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
#stage { position: fixed; inset: 0; }
#device { position: absolute; left: 50%; top: 50%; transform-origin: center center; }
body.locked #status .time { opacity: 0; }
#lock .more { align-self: center; border: 0; border-radius: 14px; padding: 5px 12px; font-size: 12.5px; color: #fff; background: #ffffff2e;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#phone {
  position: relative; width: 393px; height: var(--ph, 852px); overflow: hidden; background: #000;
  border-radius: 55px; isolation: isolate; touch-action: none;
}
.framed #device { padding: 11px; border-radius: 66px; background: linear-gradient(145deg, #3a3a40, #121216 40%, #2a2a30);
  box-shadow: 0 0 0 1.5px #55555c, 0 30px 90px #000c, inset 0 0 0 2px #0008; }
.framed #device::before, .framed #device::after { content: ""; position: absolute; width: 4px; border-radius: 3px; background: #2a2a30; }
.framed #device::before { left: -3px; top: 190px; height: 60px; box-shadow: 0 80px 0 #2a2a30; }
.framed #device::after { right: -3px; top: 240px; height: 95px; }
.fullscreen #phone { border-radius: 0; }
#caption { position: fixed; bottom: 10px; left: 0; right: 0; text-align: center; color: #fff6; font-size: 12px; pointer-events: none; }
.fullscreen #caption { display: none; }

/* ---------- wallpaper ---------- */
#wall { position: absolute; inset: 0; background: #000 url('../assets/wallpaper/wallpaper.jpg') center / cover no-repeat; transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .45s; }
body.in-app #wall, body.folder-open #wall { filter: blur(0); }

/* ---------- status bar & island ---------- */
#status { position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 80; display: flex; align-items: center;
  justify-content: space-between; padding: 0 32px 0 34px; padding-top: 4px; color: #fff; pointer-events: none; direction: ltr; transition: color .25s; }
#status.dark { color: #000; }
#status .time { font-weight: 600; font-size: 17px; letter-spacing: -.2px; width: 70px; text-align: center; }
#status .icons { display: flex; gap: 6px; align-items: center; width: 80px; justify-content: flex-end; }
#status svg { display: block; }
#lock-active #status .time { opacity: 0; }
#island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 125px; height: 37px; border-radius: 20px;
  background: #000; z-index: 90; transition: width .45s cubic-bezier(.3,1.4,.5,1), height .45s cubic-bezier(.3,1.4,.5,1), border-radius .45s; }
#island.pulse { width: 150px; }

/* ---------- home indicator ---------- */
#homebar { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 200px; height: 34px; z-index: 85;
  display: grid; place-items: center; cursor: pointer; touch-action: none; }
#homebar::after { content: ""; width: 139px; height: 5px; border-radius: 3px; background: #fff; transition: background .25s; }
#homebar.dark::after { background: #000; }

/* ---------- lock screen ---------- */
#lock { position: absolute; inset: 0; z-index: 60; color: #fff; overflow: hidden; touch-action: none; }
#lock .bg { position: absolute; inset: 0; background: url('../assets/wallpaper/wallpaper.jpg') center / cover no-repeat; }
#lock .content { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; }
#lock .padlock { margin-top: 58px; height: 22px; opacity: .95; transition: transform .3s; }
#lock .ldate { margin-top: 6px; font-size: 19px; font-weight: 600; text-shadow: 0 1px 6px #0006; }
#lock .ltime { font-size: 96px; line-height: 1; font-weight: 700; letter-spacing: -2px; margin-top: 2px; direction: ltr;
  font-feature-settings: "tnum"; text-shadow: 0 2px 16px #0005; font-family: "SF Pro Rounded", -apple-system, "Segoe UI", sans-serif; }
#lock .lwidgets { display: flex; gap: 10px; margin-top: 10px; }
.lw { height: 64px; border-radius: 20px; background: #ffffff26; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  padding: 8px 13px; display: flex; flex-direction: column; justify-content: center; text-shadow: none; min-width: 120px; }
.lw .k { font-size: 11px; opacity: .8; font-weight: 600; }
.lw .v { font-size: 15px; font-weight: 700; margin-top: 2px; }
.lw .s { font-size: 11px; opacity: .8; margin-top: 1px; }
#lock .notifs { margin-top: auto; width: 100%; padding: 0 10px; display: flex; flex-direction: column; gap: 7px; max-height: 260px; overflow: auto; }
#lock .notifs:empty { display: none; }
#lock .notifs.expanded { max-height: 420px; }
#lock .controls { width: 100%; display: flex; justify-content: space-between; padding: 14px 46px 0; }
#lock .hint { font-size: 12.5px; opacity: .78; margin: 14px 0 40px; text-align: center; text-shadow: 0 1px 4px #0008; }
.lbtn { width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff;
  background: #2c2c2e99; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: transform .15s, background .2s; }
.lbtn:active { transform: scale(1.12); }
.lbtn.on { background: #fff; color: #000; }
#lock.unlocking { transition: transform .38s cubic-bezier(.2,.7,.2,1), opacity .38s; }

/* ---------- notification card (lock + banners) ---------- */
.ncard { display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px; border-radius: 22px; color: #111; text-align: start;
  background: #f5f5f7d9; backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); cursor: pointer;
  border: 0; width: 100%; box-shadow: 0 6px 24px #0003; }
.ncard .nicon { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.ncard .nicon svg { width: 100%; height: 100%; display: block; }
.ncard .nbody { flex: 1; min-width: 0; }
.ncard .nhead { display: flex; justify-content: space-between; gap: 8px; }
.ncard .napp { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncard .nwhen { font-size: 12.5px; color: #6e6e73; white-space: nowrap; }
.ncard .ntext { font-size: 14px; line-height: 1.35; margin-top: 1px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#banner { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 95; transform: translateY(-140%); transition: transform .45s cubic-bezier(.2,1.1,.3,1); }
#banner.show { transform: translateY(0); }
#banner.shake { animation: nshake .5s; }
@keyframes nshake { 20%,60% { translate: -3px 0 } 40%,80% { translate: 3px 0 } }

/* ---------- home ---------- */
#home { position: absolute; inset: 0; z-index: 10; color: #fff; }
#home.hidden { visibility: hidden; }
#pagesview { position: absolute; top: 60px; left: 0; right: 0; bottom: 136px; overflow: hidden; touch-action: none; }
#track { display: flex; height: 100%; direction: rtl; will-change: transform; }
.hpage { flex: 0 0 393px; height: 100%; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc(var(--icon) + 20px); row-gap: var(--row-gap); align-content: start; direction: rtl; }
.hpage > * { justify-self: center; }
.app { border: 0; background: none; padding: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; width: 74px; touch-action: none; }
.app .ic { width: var(--icon); height: var(--icon); border-radius: 22.5%; overflow: hidden; position: relative; box-shadow: 0 2px 8px #0003; transition: transform .18s, filter .18s; }
.app .ic svg { width: 100%; height: 100%; display: block; }
.app:active .ic, .app.pressed .ic { transform: scale(.9); filter: brightness(.75); }
.app .lbl { font-size: 11.5px; line-height: 1.15; text-shadow: 0 1px 3px #000a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76px; }
.app:focus, .widget:focus, .lbtn:focus, .ncard:focus, #homebar:focus { outline: none; }
.app:focus-visible .ic { outline: 3px solid #fff; outline-offset: 2px; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 12px; background: #FF3B30;
  color: #fff; font-size: 14px; font-weight: 600; display: grid; place-items: center; z-index: 2; direction: ltr; }
.badge.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.3) } }
.fold .ic { background: #ffffff38 !important; backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  padding: 7px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; align-content: start; }
.fold .mini { width: 13px; height: 13px; border-radius: 3.5px; overflow: hidden; }
.fold .mini svg { width: 100%; height: 100%; display: block; }

/* widgets */
.widget-wrap { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.widget { width: 158px; height: 158px; border-radius: 24px; overflow: hidden; position: relative; border: 0; padding: 0; text-align: start; color: #fff; box-shadow: 0 4px 16px #0004; }
.widget-wrap .lbl { font-size: 11.5px; text-shadow: 0 1px 3px #000a; }
.w-prayer { background: linear-gradient(160deg, #1d2a4a, #0d1424); padding: 13px 14px; display: flex; flex-direction: column; }
.w-prayer .top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; opacity: .85; font-weight: 600; }
.w-prayer { padding: 11px 13px 10px; }
.w-prayer .next { font-size: 19px; font-weight: 700; line-height: 1.2; margin-top: 1px; }
.w-prayer .at { font-size: 11.5px; color: #F5D67B; font-weight: 600; white-space: nowrap; }
.w-prayer ul { list-style: none; padding: 0; margin: auto 0 0; font-size: 10.5px; }
.w-prayer li { display: flex; justify-content: space-between; opacity: .7; line-height: 1.3; }
.w-prayer li.on { opacity: 1; color: #F5D67B; font-weight: 700; }
.w-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; }
.w-photo img.on { opacity: 1; }
.w-photo .cap { position: absolute; bottom: 0; left: 0; right: 0; padding: 26px 12px 10px; background: linear-gradient(transparent, #000a); font-size: 13px; font-weight: 700; }

#dots { position: absolute; bottom: 112px; left: 0; right: 0; display: flex; justify-content: center; }
#dots .pill { display: flex; gap: 8px; padding: 6px 10px; border-radius: 14px; background: #ffffff1f; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); direction: rtl; }
#dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #ffffff70; }
#dots button.on { background: #fff; }
#dock { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 92px; border-radius: 34px; display: flex; justify-content: space-around;
  align-items: center; padding: 0 10px; background: #ffffff33; backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6); direction: rtl; }
#dock .lbl { display: none; }

/* ---------- folder overlay ---------- */
#folder { position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; flex-direction: column;
  background: #0003; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }
#folder.open { display: flex; }
#folder h2 { color: #fff; font-size: 30px; font-weight: 700; margin: 0 0 18px; text-shadow: 0 1px 8px #0005; }
#folder .panel { width: 312px; min-height: 312px; border-radius: 40px; padding: 24px 14px; background: #ffffff38;
  backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 96px; align-content: start; direction: rtl; }
#folder .panel .app { justify-self: center; }

/* ---------- app container ---------- */
#appview { position: absolute; inset: 0; z-index: 30; display: none; overflow: hidden; border-radius: 55px; background: var(--sheet); color: #111; }
#appview.show { display: block; }
#appview.dark { background: #000; color: #fff; }
#appview .scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding-top: 54px; padding-bottom: 34px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.fullscreen #appview { border-radius: 0; }
.scroller, #lock .notifs { scrollbar-width: none; }
.scroller::-webkit-scrollbar, #lock .notifs::-webkit-scrollbar { display: none; }

/* ---------- alerts ---------- */
#modal { position: absolute; inset: 0; z-index: 92; display: none; align-items: center; justify-content: center; background: #0006; }
#modal.open { display: flex; animation: fade .2s; }
@keyframes fade { from { opacity: 0 } }
.dialog { width: 270px; border-radius: 14px; overflow: hidden; background: #f2f2f7e6; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  color: #000; text-align: center; animation: alertin .25s cubic-bezier(.2,1.2,.4,1); }
@keyframes alertin { from { transform: scale(1.15); opacity: 0 } }
.dialog h2 { font-size: 17px; margin: 20px 16px 4px; font-weight: 600; }
.dialog p { font-size: 13.5px; margin: 0 16px 18px; line-height: 1.45; }
.dialog .actions { display: flex; flex-direction: column; }
.dialog .actions button, .dialog > button { border: 0; border-top: .5px solid #3c3c4349; background: none; color: var(--blue); font-size: 17px; padding: 11px; width: 100%; margin: 0; border-radius: 0; }
.dialog button.primary { font-weight: 600; color: var(--blue); background: none; }
.dialog button[style*="background"] { color: #FF3B30; background: none !important; }

/* ---------- Face ID glyph ---------- */
.faceid { width: 64px; height: 64px; margin: 18px auto 4px; color: var(--blue); }
.faceid.fail { animation: nshake .45s; color: #FF3B30; }

/* ---------- camera ---------- */
.camera { position: absolute; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; }
.camera .vf { flex: 1; margin: 96px 0 0; background: radial-gradient(ellipse at 50% 45%, #2a2a2e, #0c0c0e 75%); display: grid; place-items: center; text-align: center; font-size: 14px; color: #ffffffa0; padding: 0 40px; position: relative; }
.camera .vf .grid { position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent 33.1%, #ffffff22 33.3%, transparent 33.5%, transparent 66.5%, #ffffff22 66.7%, transparent 66.9%),
  linear-gradient(transparent 33.1%, #ffffff22 33.3%, transparent 33.5%, transparent 66.5%, #ffffff22 66.7%, transparent 66.9%); }
.camera .modes { display: flex; justify-content: center; gap: 22px; font-size: 13px; font-weight: 600; letter-spacing: .5px; padding: 16px 0 10px; color: #ffffffb0; }
.camera .modes .on { color: #FFD60A; }
.camera .bottom { height: 150px; display: flex; align-items: center; justify-content: space-around; padding-bottom: 30px; }
.camera .shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: none; padding: 4px; }
.camera .shutter::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.camera .shutter:active::after { transform: scale(.88); }
.camera .thumb { width: 46px; height: 46px; border-radius: 8px; background: #222 center/cover; border: 0; }
.camera .flip { width: 46px; height: 46px; border-radius: 50%; background: #ffffff22; border: 0; color: #fff; font-size: 20px; }
.flash { position: absolute; inset: 0; background: #fff; z-index: 99; pointer-events: none; animation: flash .35s forwards; }
@keyframes flash { to { opacity: 0 } }

/* placeholder app */
.ph-app { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 34px 120px; }
.ph-app .ic { width: 92px; height: 92px; border-radius: 22.5%; overflow: hidden; box-shadow: 0 6px 20px #0002; }
.ph-app .ic svg { width: 100%; height: 100%; display: block; }
.ph-app h2 { margin: 18px 0 6px; font-size: 24px; }
.ph-app p { color: #6e6e73; font-size: 14.5px; line-height: 1.6; margin: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* mixed Arabic/English lines: each line takes the direction of its own first strong character */
.gm-sub, .gm-snip, .gm-l1 b, .gm-vbody h2, .gm-text, .wa-prev, .wa-t, .wa-l1 b, .sm-b, .sm-prev, .ncard .ntext, .ncard .napp, .ph-mid b, .info b, .info p, .msg, .note p { unicode-bidi: plaintext; }

/* ---------- Notification Center ---------- */
#topedge { position: absolute; top: 0; left: 0; right: 0; height: 40px; z-index: 82; cursor: ns-resize; touch-action: none; }
body.locked #topedge { display: none; }
#nc { position: absolute; inset: 0; z-index: 70; display: none; color: #fff; overflow: hidden; touch-action: none; }
#nc.open { display: block; }
.nc-bg { position: absolute; inset: 0; background: url('../assets/wallpaper/wallpaper.jpg') center / cover; filter: blur(22px) brightness(.55); transform: scale(1.1); }
.nc-in { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; padding: 58px 10px 40px; }
.nc-date { font-size: 18px; font-weight: 600; }
.nc-time { font-size: 80px; font-weight: 700; line-height: 1; direction: ltr; letter-spacing: -1px; }
.nc-head { align-self: stretch; display: flex; justify-content: space-between; align-items: center; margin: 22px 6px 8px; }
.nc-head b { font-size: 20px; }
.nc-head button { border: 0; border-radius: 14px; background: #ffffff2e; color: #fff; padding: 5px 12px; font-size: 13px; }
.nc-list { align-self: stretch; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: none; touch-action: pan-y; }
.nc-list::-webkit-scrollbar { display: none; }
.nc-empty { text-align: center; opacity: .7; margin-top: 40px; }
.nc-hint { font-size: 12px; opacity: .6; margin-top: 8px; }
#sidebtn { position: absolute; right: -4px; top: 250px; width: 5px; height: 96px; border: 0; padding: 0; border-radius: 0 4px 4px 0; background: #3a3a40; cursor: pointer; z-index: 2; }
#sidebtn:hover { background: #6a6a72; }
.fullscreen #sidebtn { display: none; }
.framed #device::after { display: none; }
