/* ============================================================
   layout.css — Body, container, top-bar, bottom-nav, views
   UPInspect v2.0
   ============================================================ */

/* ─── Body ─── */
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  padding-bottom: calc(var(--nav-height) + 20px);
  transition: background 0.4s, color 0.4s;
  opacity: 0;
  animation: bodyLoad 0.5s ease 0.1s forwards;
}

/* Ambient gradient overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(27, 79, 196, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(0, 229, 160, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: 580px;
  position: relative;
  z-index: 1;
  padding-top: 16px;
}

/* ─── Top Bar ─── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(27, 79, 196, 0.4);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.brand-name span { color: var(--accent); }

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-accent);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Bottom Nav ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(8, 15, 30, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 1000;
}

body.light .bottom-nav {
  background: rgba(240, 244, 255, 0.9);
}

.nav-item {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s;
  padding: 8px 0;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: all 0.25s;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active { color: var(--accent); }
.nav-item.active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
}

/* ─── App Views ─── */
.app-view { display: none; }
.app-view.active {
  display: block;
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Utility ─── */
.hidden { display: none !important; }

@media (max-width: 480px) {
  .btn-group { flex-direction: column; }
}
