/* app-specific styles go here */

/* ── BLUR BACKGROUND ─────────────────────────────────────────────────── */

html { background: #000; }
body { background: transparent; }

#bg {
  position: fixed;
  inset: -10%;
  background-image: url('/background.webp');
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.75);
  transform: scale(1.1);
  z-index: -1;
}

.placeholder {
  color: rgba(255, 255, 255, 0.92);
  font-size: 36px;
  letter-spacing: .2em;
  font-style: italic;
}

/* ── PROFILE MENU: grouped action list ───────────────────────────────────
   Flat solid menu — background shares one color with the un-hovered rows, so
   rows only reveal themselves on hover. Log out keeps a red accent at rest.
   Overrides shell.css's translucent popover + per-row bordered buttons. */

.profile-popover {
  background: #1c1c1e;                     /* flat solid: same color the rows show */
  border-color: rgba(255, 255, 255, 0.10);
}

.pi-list {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;                       /* clip rows to the rounded corners */
}

.pi-list .pi-action {
  border: none;
  border-radius: 0;
  padding: 11px 14px;
  font-size: 13px;
  background: #1c1c1e;                     /* exact menu color when not hovered */
}

/* divider only BETWEEN rows, never on the first one */
.pi-list .pi-action + .pi-action { border-top: 1px solid rgba(255, 255, 255, 0.10); }

.pi-list .pi-action:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.95); }

/* the one intentional color: log out is red — red text + faint red fill at rest */
.pi-list .pi-logout {
  color: #e58787;
  background: rgba(200, 70, 70, 0.08);
  border-top-color: rgba(200, 70, 70, 0.45);
}
.pi-list .pi-logout:hover { color: #ffbfbf; background: rgba(200, 70, 70, 0.18); }

/* ── TAB PANELS ──────────────────────────────────────────────────────── */

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── APP GRID ────────────────────────────────────────────────────────── */

/* Neutral glassy palette override.
   shell.css defines these as a purple theme but only consumes --text itself,
   so redefining here retints everything app-side to clean white-translucent
   glass without touching the do-not-edit shell.css. */
:root {
  --border:        rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.42);
  --text:          rgba(255, 255, 255, 0.82);
  --text-dim:      rgba(255, 255, 255, 0.45);
  --accent:        rgba(255, 255, 255, 0.95);
  --neon:          #ffffff;

  /* traffic-light status palette (shell palette has no green/amber/red) */
  --ok:   #4ade80;
  --warn: #fbbf24;
  --bad:  #f87171;
}

.apps-wrap {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}

/* trim the shared content padding so the panel breathes wider on a phone
   (shell.css uses 24px; overriding here, not editing shell.css) */
.app-content { padding: 20px 14px; }

/* one glass panel; the apps are rows inside it, split by hairlines */
.app-grid {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

.app-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: background 0.15s, opacity 0.15s;
}

/* hairline divider between adjacent rows (inset from the panel edges) */
.app-card + .app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* the full-row overlay link sits above the row but below the info button */
.app-open {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.app-card:not(.blocked):hover { background: rgba(255, 255, 255, 0.04); }
/* dim only icon + name when blocked, so the colour dot stays vivid */
.app-card.blocked .app-icon,
.app-card.blocked .app-name { opacity: 0.5; }
.app-card.blocked .app-open { cursor: not-allowed; }

/* ── icon (temp placeholder tile) ────────────────────────────────────── */

.app-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  overflow: hidden;
}

/* image tiles fill edge-to-edge — no inner glass frame, just the rounded clip */
.app-icon:has(img) {
  padding: 0;
  background: none;
  border: none;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── status dot + name ───────────────────────────────────────────────── */

.app-card .dot {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-dim);
}

.app-name {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card.checking .dot { background: var(--text-dim); animation: dot-pulse 1.1s ease-in-out infinite; }
.app-card.online   .dot { background: var(--ok);   box-shadow: 0 0 8px var(--ok); }
.app-card.partial  .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.app-card.offline  .dot { background: var(--bad);  box-shadow: 0 0 8px var(--bad); }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* ── info button ─────────────────────────────────────────────────────── */

.app-info-btn {
  position: relative;
  z-index: 2; /* above the overlay link */
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 13px;
  font-style: italic;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.app-info-btn:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

/* ── refresh button ──────────────────────────────────────────────────── */

.app-refresh {
  align-self: center;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.app-refresh:hover { border-color: var(--border-active); background: rgba(255, 255, 255, 0.1); }
.app-refresh.spinning { color: var(--text-dim); pointer-events: none; animation: spin 0.8s linear infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── info modal ──────────────────────────────────────────────────────── */

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}

.app-modal-backdrop.open { display: flex; }

.app-modal {
  width: 100%;
  max-width: 360px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
}

.app-modal-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-modal-features li {
  position: relative;
  padding-left: 20px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.app-modal-features li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}

.app-modal-name {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  font-weight: 600;
}

.app-modal-desc {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.app-modal-close {
  align-self: flex-end;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  transition: border-color 0.15s, color 0.15s;
}

.app-modal-close:hover { border-color: var(--border-active); color: var(--accent); }

/* status popup: colour-accented variant of the modal */
.status-modal.warn { border-color: rgba(251, 191, 36, 0.5); }
.status-modal.bad  { border-color: rgba(248, 113, 113, 0.5); }
.status-modal.warn .app-modal-name { color: var(--warn); }
.status-modal.bad  .app-modal-name { color: var(--bad); }

/* ── desktop: same layout, just centered & roomier ───────────────────── */

@media (min-width: 640px) {
  .app-card { padding: 18px 24px; }
}

/* ── INFO PAGE ───────────────────────────────────────────────────────── */

.info-card {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px 26px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  color: var(--text);
  font-size: 13px;
  line-height: 1.9;
}

.info-card strong { color: rgba(255, 255, 255, 0.92); font-weight: 600; }

.info-card .info-foot { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

/* inline links inside paragraphs */
.info-card p a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.info-card p a:hover { border-bottom-color: rgba(255, 255, 255, 0.7); }

/* contact links as glassy buttons */
.info-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.info-link {
  display: inline-block;
  padding: 15px 26px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.info-link:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
}

/* ── toast (copied confirmation) ─────────────────────────────────────── */

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 400;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── PROFILE POPOVER: glassy action buttons ─────────────────────────── */

.pi-readme {
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pi-readme:hover {
  border-color: rgba(255, 255, 255, 0.4) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

.pi-logout {
  background: rgba(255, 80, 80, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
