/* Dock — auto-hides after 6s of inactivity. Six buttons total.
   No theme toggle (solar-driven). No photos button unless photos picked. */

.portal-dock {
  position: absolute;
  left: 8px;
  right: 8px;
  /* #app overscans by --app-bleed (burn-in shift); add it back so the dock
     rests flush against the real viewport bottom rather than below it. */
  bottom: var(--app-bleed);
  z-index: var(--z-dock);
  height: var(--dock-height);
  transform: translateY(calc(100% + 4px));
  transition: transform 360ms var(--ease-out), opacity 240ms var(--ease-out);
  opacity: 0;
  pointer-events: none;
}

#app.dock-visible .portal-dock {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.dock-surface {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 100%;
  padding: 0 6px;
  gap: 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: var(--shadow-md);
}

.dock-section {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.dock-section--center {
  position: relative;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.dock-frame-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  max-width: 40vw;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-frame-title.visible {
  opacity: 0.95;
}

.dock-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: background var(--dur-tap) var(--ease-out),
    color var(--dur-tap) var(--ease-out),
    transform var(--dur-tap) var(--ease-out);
  flex-shrink: 0;
}

.dock-button svg {
  width: 16px;
  height: 16px;
}

.dock-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.dock-button:active {
  transform: scale(0.92);
}

.dock-button.active,
.dock-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.dock-button[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

/* Center nav (frames) */
.dock-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dock-nav::-webkit-scrollbar {
  display: none;
}

.dock-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  height: 28px;
  border-radius: var(--radius-pill);
  font-size: var(--t-caption);
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background var(--dur-tap) var(--ease-out),
    color var(--dur-tap) var(--ease-out),
    transform var(--dur-tap) var(--ease-out);
  flex-shrink: 0;
}

.dock-nav-item svg {
  width: 13px;
  height: 13px;
}

.dock-nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.dock-nav-item:active {
  transform: scale(0.96);
}

/* Right side: status pill + actions */
.dock-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 0 6px;
  font-size: var(--t-caption);
  line-height: 1.1;
  color: var(--text-2);
  border-right: 1px solid var(--border-soft);
  margin-right: 2px;
  height: 22px;
}

.dock-status-time {
  font-weight: 700;
  color: var(--text);
  font-feature-settings: var(--feat-tnum);
}

.dock-status-weather {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* Quote prev/next, only visible on quotes/quran frames */
.dock-quote-actions {
  display: none;
  gap: 1px;
  margin-left: 2px;
}

.dock-quote-actions.visible {
  display: inline-flex;
}


/* Lite mode: single-screen Home experience — compact right-aligned utility pill */
.lite-mode .portal-dock {
  left: auto;
  right: 12px;
}

.lite-mode .dock-surface {
  display: inline-flex;
  padding: 0 6px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(14, 15, 20, 0.92);
}

.lite-mode .dock-section--left,
.lite-mode .dock-section--center {
  display: none;
}

/* Compact viewport overrides */
@media (max-width: 512px) and (max-height: 320px) {
  .portal-dock {
    left: 4px;
    right: 4px;
    height: 36px;
  }

  .lite-mode .portal-dock {
    left: auto;
    right: 8px;
  }

  .dock-button {
    width: 26px;
    height: 26px;
  }

  .dock-button svg {
    width: 14px;
    height: 14px;
  }

  .dock-nav-item {
    height: 24px;
    padding: 4px 7px;
  }

  .dock-nav-item span {
    display: none;
  }

  .dock-status {
    padding: 0 4px;
  }

  .dock-status-weather {
    display: none;
  }
}
