/* ===== Top bar, popovers, dock ===== */

/* ---------- top bar ---------- */
#topbar {
  position:fixed; top:0; left:0; right:0; height:var(--topbar-h); z-index:6500;
  display:flex; align-items:stretch; justify-content:space-between;
  background:#000; color:#fff;
  font-size:13px; font-weight:700;
  padding:0 6px;
}
#topbar .tb-btn {
  display:flex; align-items:center; gap:7px; padding:0 10px; border:none; background:transparent; color:#fff;
  border-radius:8px; font:inherit; cursor:pointer; transition:background .12s ease;
}
#topbar .tb-btn:hover { background:rgba(255,255,255,.14); }
#topbar .tb-btn.open { background:rgba(255,255,255,.22); }
#topbar .tb-btn svg { width:15px; height:15px; fill:#fff; }
#topbar .tb-left { display:flex; align-items:center; }
#topbar .tb-center { position:absolute; left:50%; transform:translateX(-50%); top:0; bottom:0; display:flex; align-items:center; }
#topbar #tb-clock { font-weight:700; letter-spacing:.1px; }
#topbar .tb-right { display:flex; align-items:center; }
#topbar .status-icons { display:flex; align-items:center; gap:9px; padding:0 4px; }
#topbar .battery-pct { font-size:12.5px; font-weight:500; }
#topbar .power-mode-chip svg { width:13px; height:13px; }

/* hot corner hint */
#hot-corner { position:fixed; top:0; left:0; width:14px; height:6px; z-index:6520; }

/* ---------- popover shared ---------- */
.popover {
  position:fixed; z-index:7200; color:var(--fg);
  background:var(--menu-bg); border-radius:18px; box-shadow:var(--shadow-pop);
  animation:pop-in .16s cubic-bezier(.3,1.2,.4,1);
  transform-origin:top center; overflow:hidden;
}
@keyframes pop-in { from { opacity:0; transform:translateY(-8px) scale(.97); } }

/* ---------- calendar / notifications popover ---------- */
#calendar-pop { width:664px; max-width:calc(100vw - 20px); padding:14px 16px 12px; }
#calendar-pop .cal-grid-wrap { display:flex; gap:18px; }
@media (max-width:700px) { #calendar-pop .cal-grid-wrap { flex-direction:column; } }

.cal-section { flex:1.25; min-width:0; }
.cal-head { display:flex; align-items:center; margin-bottom:8px; }
.cal-head .cal-title { font-size:14px; font-weight:700; flex:1; text-align:center; }
.cal-nav { width:30px; height:30px; border-radius:99px; border:none; background:transparent; color:var(--fg); display:flex; align-items:center; justify-content:center; }
.cal-nav:hover { background:var(--hover-row); }
.cal-nav svg { width:14px; height:14px; fill:currentColor; }
.cal-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.cal-table th { font-size:11px; font-weight:500; color:var(--fg-dim); padding:4px 0; }
.cal-table td { text-align:center; padding:1px; }
.cal-day {
  width:100%; aspect-ratio:1.35; border:none; background:transparent; border-radius:8px;
  font-size:12.5px; color:var(--fg); cursor:pointer; position:relative;
}
.cal-day:hover { background:var(--hover-row); }
.cal-day.other { color:var(--fg-dim); opacity:.55; }
.cal-day.today { background:var(--accent); color:var(--accent-fg); font-weight:700; }
.cal-day.has-event::after {
  content:''; position:absolute; bottom:3px; left:50%; transform:translateX(-50%);
  width:4px; height:4px; border-radius:99px; background:currentColor; opacity:.75;
}
.cal-day.today.has-event::after { background:var(--accent-fg); }

.notif-section { flex:1; min-width:0; display:flex; flex-direction:column; max-height:340px; }
.notif-section-head { display:flex; align-items:center; justify-content:space-between; padding:2px 4px 8px; }
.notif-section-head .label { font-size:12.5px; font-weight:700; color:var(--fg-dim); letter-spacing:.4px; }
.notif-clear { border:none; background:transparent; color:var(--link); font-size:12.5px; cursor:pointer; padding:2px 6px; border-radius:6px; }
.notif-clear:hover { background:var(--hover-row); }
.notif-list { overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding-right:2px; }
.notif-card {
  background:var(--card-bg); border-radius:14px; padding:10px 12px; position:relative;
  box-shadow:0 1px 3px rgba(0,0,0,.14), inset 0 0 0 1px var(--border);
  animation:notif-in .2s ease;
}
@keyframes notif-in { from { opacity:0; transform:translateY(6px); } }
.notif-card .nc-head { display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.notif-card .nc-appicon { width:17px; height:17px; flex:none; }
.notif-card .nc-appicon img, .notif-card .nc-appicon svg { width:100%; height:100%; }
.notif-card .nc-app { font-size:11.5px; font-weight:700; color:var(--fg-dim); }
.notif-card .nc-time { margin-left:auto; font-size:11px; color:var(--fg-dim); }
.notif-card .nc-close {
  position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:99px; border:none;
  background:color-mix(in srgb, var(--fg) 12%, transparent); color:var(--fg);
  display:none; align-items:center; justify-content:center; cursor:pointer;
}
.notif-card:hover .nc-close { display:flex; }
.notif-card .nc-close svg { width:11px; height:11px; fill:currentColor; }
.notif-card .nc-title { font-size:13.5px; font-weight:700; margin-bottom:1px; padding-right:20px; }
.notif-card .nc-body { font-size:12.5px; color:var(--fg-dim); line-height:1.35; user-select:text; }
.notif-card .nc-actions { display:flex; gap:8px; margin-top:8px; }
.notif-card .nc-actions button {
  flex:1; border:none; border-radius:8px; padding:5px 0; font-size:12.5px; font-weight:700; cursor:pointer;
  background:color-mix(in srgb, var(--fg) 10%, transparent); color:var(--fg);
}
.notif-card .nc-actions button:hover { background:color-mix(in srgb, var(--fg) 16%, transparent); }
.notif-empty { text-align:center; color:var(--fg-dim); font-size:12.5px; padding:26px 0; }
.dnd-row { display:flex; align-items:center; justify-content:space-between; padding:8px 4px 2px; font-size:12.5px; font-weight:700; color:var(--fg-dim); }

/* ---------- quick settings popover ---------- */
#qs-pop { width:388px; max-width:calc(100vw - 16px); padding:14px; }
.qs-sliders { display:flex; flex-direction:column; gap:14px; margin-bottom:14px; }
.qs-slider-row { display:flex; align-items:center; gap:12px; }
.qs-slider-row .sym { width:17px; height:17px; fill:var(--fg); flex:none; }
.qs-slider-row input[type=range] { flex:1; }
.qs-toggles { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-bottom:12px; }
.qs-toggle {
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:14px; cursor:pointer;
  background:color-mix(in srgb, var(--fg) 8%, transparent);
  transition:background .15s ease; border:none; text-align:left; color:var(--fg); font:inherit;
}
.qs-toggle:hover { background:color-mix(in srgb, var(--fg) 13%, transparent); }
.qs-toggle.on { background:var(--accent); color:var(--accent-fg); }
.qs-toggle .arrow { margin-left:auto; opacity:.7; display:flex; }
.qs-toggle .arrow svg { width:12px; height:12px; fill:currentColor; }
.qs-toggle .qt-icon { width:17px; height:17px; fill:currentColor; flex:none; }
.qs-toggle .qt-labels { display:flex; flex-direction:column; min-width:0; }
.qs-toggle .qt-name { font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qs-toggle .qt-sub { font-size:11px; opacity:.8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qs-battery {
  display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:14px; margin-bottom:12px;
  background:color-mix(in srgb, var(--fg) 8%, transparent); font-size:13px;
}
.qs-battery .sym { width:17px; height:17px; fill:var(--fg); }
.qs-battery .qb-pct { margin-left:auto; font-weight:700; }
.qs-actions { display:flex; justify-content:center; gap:14px; padding-top:4px; }
.qs-action {
  width:44px; height:44px; border-radius:99px; border:none; cursor:pointer;
  background:color-mix(in srgb, var(--fg) 10%, transparent); color:var(--fg);
  display:flex; align-items:center; justify-content:center; transition:background .12s ease;
}
.qs-action:hover { background:color-mix(in srgb, var(--fg) 18%, transparent); }
.qs-action svg { width:19px; height:19px; fill:currentColor; }
.qs-subpage { position:absolute; inset:0; background:var(--menu-bg); padding:14px; display:flex; flex-direction:column; animation:subslide .18s ease; }
@keyframes subslide { from { transform:translateX(30px); opacity:0; } }
.qs-subpage .sub-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.qs-subpage .sub-head .title { font-weight:700; font-size:14px; }
.qs-netrow { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:10px; cursor:pointer; font-size:13.5px; }
.qs-netrow:hover { background:var(--hover-row); }
.qs-netrow .sym { width:16px; height:16px; fill:currentColor; }
.qs-netrow .check { margin-left:auto; width:15px; height:15px; fill:var(--accent); visibility:hidden; }
.qs-netrow.connected .check { visibility:visible; }
.qs-netrow .lock { width:12px; height:12px; fill:var(--fg-dim); }

/* ---------- dock ---------- */
#dock {
  position:fixed; z-index:6000; display:flex; flex-direction:column; align-items:center;
  left:0; top:var(--topbar-h); bottom:0; width:72px;
  background:rgba(24,24,24,.78);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  border-right:1px solid rgba(255,255,255,.08);
  padding:5px 0 4px; gap:3px;
  transition:transform .22s cubic-bezier(.4,0,.2,1);
  overflow:hidden;
}
body[data-theme="light"] #dock { background:rgba(32,32,32,.82); }
#dock.bottom {
  flex-direction:row; left:0; right:0; top:auto; bottom:0; width:auto; height:72px;
  border-right:none; border-top:1px solid rgba(255,255,255,.08); padding:0 5px 2px;
}
#dock.hidden-dock { transform:translateX(-100%); }
#dock.bottom.hidden-dock { transform:translateY(100%); }
#dock.reveal { transform:translateX(0); }
#dock.bottom.reveal { transform:translateY(0); }

.dock-icon {
  position:relative; width:56px; height:56px; flex:none;
  display:flex; align-items:center; justify-content:center;
  border-radius:14px; cursor:pointer;
  border:none; padding:0; background:transparent;
  transition:background .12s ease;
}
#dock.bottom .dock-icon { width:56px; height:56px; }
.dock-icon:hover { background:rgba(255,255,255,.12); }
.dock-icon img, .dock-icon > .app-svg { width:48px; height:48px; display:block; filter:drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.dock-icon.launching { animation:dock-bounce .9s cubic-bezier(.3,.9,.4,1) infinite; }
@keyframes dock-bounce {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-9px); }
}
.dock-icon .running-dots {
  position:absolute; left:-1px; top:50%; transform:translateY(-50%);
  display:flex; flex-direction:column; gap:3px;
}
#dock.bottom .dock-icon .running-dots { left:50%; top:auto; bottom:1px; transform:translateX(-50%); flex-direction:row; }
.dock-icon .running-dots i { width:4px; height:4px; border-radius:99px; background:var(--accent); box-shadow:0 0 3px rgba(0,0,0,.5); }
.dock-sep { width:34px; height:1px; background:rgba(255,255,255,.22); margin:4px 0; flex:none; }
#dock.bottom .dock-sep { width:1px; height:34px; margin:0 4px; }
#dock-spacer { flex:1; }
.dock-icon.show-apps svg { width:34px; height:34px; fill:#fff; opacity:.92; }
.dock-icon.trash svg { width:44px; height:44px; }

/* dock edge reveal strip when auto-hidden */
#dock-reveal-strip { position:fixed; left:0; top:var(--topbar-h); bottom:0; width:4px; z-index:5900; }
#dock.bottom ~ #dock-reveal-strip { display:none; }
