/* ════════════════════════════════════════════════
   PIANO SUITE — LAYOUT
   ════════════════════════════════════════════════ */

/* ── TOP BAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--top);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  z-index: 200; padding: 0 16px; gap: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.topbar::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,var(--a1),var(--a3),var(--a5),var(--a6),var(--a3),var(--a1));
  background-size: 300% 100%;
  animation: gradientShift 6s linear infinite;
  opacity: 0.6;
}
.topbar.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.topbar-logo {
  display: flex; align-items: center; gap: 10px;
  padding-right: 20px; border-right: 1px solid var(--border);
  margin-right: 10px; text-decoration: none;
  transition: opacity .15s;
}
.topbar-logo:hover { opacity: 0.8; }
.topbar-logo-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg,var(--a1),var(--a3),var(--a5));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,71,225,0.3);
}
.topbar-logo:hover .topbar-logo-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0,71,225,0.4);
}
.topbar-logo-name {
  font-size: 14px; font-weight: 600;
  color: var(--text); letter-spacing: -0.01em; white-space: nowrap;
}
.topbar-nav { display: flex; gap: 2px; flex: 1; }
.topbar-tab {
  padding: 7px 15px; font-size: 13px; font-weight: 400;
  color: var(--text2); background: transparent; border: none;
  border-radius: var(--r); cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden;
}
.topbar-tab::before {
  content: ''; position: absolute; inset: 0;
  background: var(--accent-soft); border-radius: var(--r);
  opacity: 0; transition: opacity .18s;
}
.topbar-tab:hover { color: var(--text); }
.topbar-tab:hover::before { opacity: 1; }
.topbar-tab.active { color: var(--accent-text); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.topbar-tab.active::before { opacity: 1; }
.topbar-tab.active::after {
  content: ''; position: absolute; bottom: 2px; left: 50%;
  width: 60%; height: 2px;
  background: linear-gradient(90deg,var(--a2),var(--a5));
  border-radius: 1px; transform: translateX(-50%);
}
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-btn {
  width: 32px; height: 32px; border-radius: var(--r);
  border: 1px solid var(--border2); background: transparent;
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.theme-btn:hover {
  background: var(--surface2); color: var(--text);
  border-color: var(--accent); transform: scale(1.08);
}

/* ── APP BODY ── */
.app-body { padding-top: var(--top); height: 100vh; display: flex; }

/* ── VIEWS ── */
.view { display: none; flex: 1; overflow: hidden; height: 100%; }
.view.active { display: flex; }
.view.active .main-content { animation: fadeIn .22s var(--ease); }
.view.active .sidebar      { animation: slideInLeft .22s var(--ease); }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--side);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto; padding: 8px 0;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar-section {
  font-family: var(--mono); font-size: 9px; color: var(--text3);
  letter-spacing: .12em; text-transform: uppercase;
  padding: 14px 14px 5px; font-weight: 500;
}
.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; cursor: pointer; font-size: 12.5px;
  color: var(--text2); border-left: 2px solid transparent;
  position: relative; font-weight: 400; user-select: none;
}
.sidebar-item::before {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg,transparent,var(--accent-soft));
  transition: width .2s;
}
.sidebar-item:hover { color: var(--text); background: var(--surface2); }
.sidebar-item:hover::before { width: 100%; }
.sidebar-item.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.sidebar-item.active::before { width: 0; }
.sidebar-item-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-num { font-family: var(--mono); font-size: 9px; color: var(--text3); min-width: 16px; }
.sidebar-item.active .sidebar-num { color: var(--accent-text); }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1; overflow-y: auto;
  padding: 24px 32px; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  scroll-behavior: smooth;
}
.sub-panel { display: none; width: 100%; max-width: 900px; }
.sub-panel#sp-3 { max-width: 100%; }
.sub-panel.active {
  display: block;
  animation: fadeInUp .25s var(--ease);
}
.sub-panel.active .card             { animation: fadeInUp .22s var(--ease) both; }
.sub-panel.active .card:nth-child(2) { animation-delay: .04s; }
.sub-panel.active .card:nth-child(3) { animation-delay: .08s; }
.sub-panel.active .card:nth-child(4) { animation-delay: .12s; }
.sub-panel.active .card:nth-child(5) { animation-delay: .16s; }

/* Partial Analyzer has no sidebar */
#view-partial { flex-direction: column; }
#view-partial .main-content { padding-top: 28px; }
#view-partial .main-content .sub-panel,
#view-partial .main-content > * { width: 100%; max-width: 900px; }

/* ── LANDING ── */
#view-landing { display: flex; flex: 1; overflow-y: auto; }
.landing {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: calc(100vh - var(--top));
  padding: 40px 24px; text-align: center; width: 100%;
}
.landing-logo {
  width: 80px; height: 80px; border-radius: 22px;
  background: linear-gradient(135deg,var(--a1),var(--a3),var(--a5));
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 0 auto 28px;
  box-shadow: 0 8px 32px rgba(0,71,225,0.35);
  animation: fadeInUp .5s var(--ease), pulseGlow 3s ease-in-out infinite;
  transition: transform .2s;
}
.landing-logo:hover { transform: scale(1.06) rotate(-3deg); }
.landing-title {
  font-size: 32px; font-weight: 700;
  color: var(--text); margin-bottom: 10px; letter-spacing: -0.02em;
  animation: fadeInUp .5s .08s var(--ease) both;
  background: linear-gradient(135deg, var(--text) 60%, var(--a3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block;
}
.landing-sub {
  font-size: 14px; color: var(--text2); margin-bottom: 44px;
  max-width: 460px; line-height: 1.6; font-weight: 300;
  animation: fadeInUp .5s .15s var(--ease) both;
}
.landing-cards {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px; max-width: 760px; width: 100%; margin-bottom: 32px;
}
.landing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 22px; cursor: pointer;
  text-align: left; position: relative; overflow: hidden;
  animation: fadeInUp .5s var(--ease) both;
  box-shadow: var(--shadow-sm);
}
.landing-card:nth-child(1) { animation-delay: .20s; }
.landing-card:nth-child(2) { animation-delay: .27s; }
.landing-card:nth-child(3) { animation-delay: .34s; }
.landing-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,transparent,var(--accent),transparent);
  opacity: 0; transition: opacity .22s;
}
.landing-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,71,225,0.12), var(--shadow-sm);
}
.landing-card:hover::before { opacity: 1; }
.landing-card-icon  { font-size: 26px; margin-bottom: 14px; }
.landing-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.landing-card-desc  { font-size: 12px; color: var(--text2); line-height: 1.55; font-weight: 300; }

.accent-bar {
  height: 3px; width: 80px;
  background: linear-gradient(90deg,var(--a1),var(--a5));
  background-size: 200% 100%;
  animation: fadeIn .5s .1s both, gradientShift 4s linear infinite;
  border-radius: 2px; margin: 0 auto 28px;
}

/* ── DARK MODE CARD INNER GLOW ── */
[data-theme="dark"] .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}
[data-theme="dark"] .card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}
