/* =====================================================================
   ShadowOS — "Shadow Mobile" (Apple / iOS style) theme
   Activated by body.mode-apple. Pure UI layer: same apps, same features.
   ===================================================================== */

.apple-bar { display: none; }

body.mode-apple {
  --taskbar-h: 96px;
  --radius-win: 14px;
  --radius: 9px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro Icons", "Segoe UI", system-ui, sans-serif;
  --accent: #0a84ff;
  --accent-2: #64d2ff;
  --surface: rgba(30, 30, 34, 0.55);
  --surface-solid: #1c1c1e;
  --surface-2: rgba(44, 44, 48, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --blur: blur(30px) saturate(180%);
}
body.light.mode-apple {
  --surface: rgba(245, 245, 247, 0.62);
  --surface-solid: #f2f2f7;
  --surface-2: rgba(255, 255, 255, 0.75);
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
}

/* ----- top menu bar ----- */
body.mode-apple .apple-bar {
  display: flex; align-items: center; position: fixed; top: 0; left: 0; right: 0; height: 30px;
  z-index: 5100; padding: 0 12px; font-size: 12.5px; color: var(--text);
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
body.no-transparency.mode-apple .apple-bar { background: var(--surface-solid); }
.apple-bar .ab-left { display: flex; align-items: center; gap: 8px; }
.apple-bar .ab-apple { width: 26px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text); }
.apple-bar .ab-apple:hover { background: var(--hover); }
.apple-bar .ab-app { font-weight: 600; }
.apple-bar .ab-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.apple-bar .ab-ic { height: 24px; min-width: 26px; padding: 0 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; color: var(--text); position: relative; }
.apple-bar .ab-ic:hover { background: var(--hover); }
.apple-bar .ab-clock { font-variant-numeric: tabular-nums; }
.apple-bar .ab-ic .dot { position: absolute; top: 3px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

/* push desktop content below the top bar */
body.mode-apple .windows { top: 30px; }
body.mode-apple .desktop-icons { top: 42px; }
body.mode-apple .widgets { bottom: calc(var(--taskbar-h) + 8px); }

/* ----- taskbar -> iOS dock ----- */
body.mode-apple .taskbar {
  left: 50%; right: auto; transform: translateX(-50%);
  bottom: 12px; height: 70px; width: auto; max-width: calc(100vw - 20px);
  padding: 0 12px; border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: rgba(30, 30, 34, 0.5);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
body.light.mode-apple .taskbar { background: rgba(245, 245, 247, 0.6); }
body.no-transparency.mode-apple .taskbar { background: var(--surface-solid); }
body.mode-apple .taskbar-left, body.mode-apple .taskbar-right { display: none; }
body.mode-apple .taskbar-center { justify-content: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
body.mode-apple .taskbar-center::-webkit-scrollbar { display: none; }
body.mode-apple .tb-btn {
  width: 50px; height: 50px; border-radius: 15px;
  background: var(--control); transition: transform .12s ease, background .12s ease;
}
body.mode-apple .tb-btn:hover { background: var(--control-hover); transform: translateY(-2px); }
body.mode-apple .tb-btn:active { transform: scale(.92); }
body.mode-apple .tb-start { background: linear-gradient(160deg, #64d2ff, #0a84ff); color: #fff; }
body.mode-apple .tb-btn.active::after,
body.mode-apple .tb-btn.running::after { display: none; }
body.mode-apple .tb-btn svg { width: 26px; height: 26px; }
body.mode-apple .task-list { gap: 8px; margin-left: 0; }
body.mode-apple .task-item {
  width: 50px; height: 50px; min-width: 50px; padding: 0; border-radius: 15px;
  justify-content: center;
}
body.mode-apple .task-item .ti-ico, body.mode-apple .task-item .ti-ico svg, body.mode-apple .task-item .ti-ico img { width: 30px; height: 30px; }
body.mode-apple .task-item .ti-label { display: none; }
body.mode-apple .task-item::after { display: none; }
body.mode-apple .task-item.active { background: var(--active); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ----- windows: macOS chrome ----- */
body.mode-apple .win { border-radius: var(--radius-win); }
body.mode-apple .w-titlebar { height: 36px; padding-left: 12px; }
body.mode-apple .w-controls { order: -1; margin-left: 0; margin-right: 10px; height: 100%; align-items: center; gap: 8px; }
body.mode-apple .w-btn { width: 13px; height: 13px; border-radius: 50%; background: #b6b6b6; color: transparent; }
body.mode-apple .w-btn svg { display: none; }
body.mode-apple .w-btn.close { background: #ff5f57; order: 1; }
body.mode-apple .w-btn.min { background: #febc2e; order: 2; }
body.mode-apple .w-btn.max { background: #28c840; order: 3; }
body.mode-apple .w-btn:hover { filter: brightness(.92); }
body.mode-apple .w-btn.close:hover { background: #ff5f57; color: transparent; }
body.mode-apple .w-title { text-align: center; font-weight: 600; }
body.mode-apple .window-max .w-titlebar { }

/* ----- start menu -> Launchpad ----- */
body.mode-apple .start-menu {
  left: 50%; top: 50%; bottom: auto;
  transform: translate(-50%, -46%) scale(.94);
  width: calc(100vw - 40px); max-width: 1040px;
  height: auto; max-height: calc(100vh - 130px);
  padding: 28px 32px 0; border-radius: 26px;
  background: rgba(28, 28, 32, 0.72);
}
body.mode-apple .start-menu:not(.hidden) { transform: translate(-50%, -50%) scale(1); }
body.light.mode-apple .start-menu { background: rgba(242, 242, 247, 0.8); }
body.mode-apple .start-search { border-radius: 12px; }
body.mode-apple .pinned-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
body.mode-apple .pin-item { padding: 18px 6px; }
body.mode-apple .pin-item .i, body.mode-apple .pin-item .i svg, body.mode-apple .pin-item .i img { width: 52px; height: 52px; }
body.mode-apple .pin-item .n { font-size: 12.5px; }
body.mode-apple .start-foot { border-radius: 0 0 26px 26px; }

/* ----- desktop icons ----- */
body.mode-apple .d-icon .i, body.mode-apple .d-icon .i svg, body.mode-apple .d-icon .i img { width: 48px; height: 48px; }
body.mode-apple .d-icon .i { border-radius: 12px; }
body.mode-apple .d-icon .n { text-shadow: 0 1px 4px rgba(0,0,0,.7); }

/* ----- Finder-like file explorer ----- */
body.mode-apple .ex-side { background: rgba(255,255,255,.06); border-right-color: var(--border); }
body.light.mode-apple .ex-side { background: rgba(0,0,0,.03); }
body.mode-apple .ex-crumb, body.mode-apple .field { border-radius: 8px; }
body.mode-apple .file { border-radius: 10px; }
body.mode-apple .file.sel { background: rgba(10,132,255,.3); border-color: rgba(100,210,255,.5); }
body.mode-apple .ex-item { border-radius: 8px; }

/* ----- flyouts / menus rounding ----- */
body.mode-apple .flyout { border-radius: 16px; }
body.mode-apple .context-menu { border-radius: 12px; }
body.mode-apple .toast { border-radius: 16px; }
body.mode-apple .widget-card { border-radius: 16px; }
body.mode-apple .set-card { border-radius: 14px; }
body.mode-apple .btn { border-radius: 8px; }
