/* ─────────────────────────────────────────────────────────────────────────────
   layout.css — App shell, navbar, drawer, player bar
   zeni.gg · Rosé Tournament Theme
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── App Shell ──────────────────────────────────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--navbar-height);
  padding-bottom: var(--player-bar-height);
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-navbar);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  gap: var(--space-3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Hamburger */
.navbar__hamburger {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: background 0.15s;
}

.navbar__hamburger:hover {
  background: var(--color-surface-2);
}

.navbar__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-muted);
  border-radius: 2px;
  transition: background 0.15s;
}

.navbar__hamburger:hover span {
  background: var(--color-text);
}

/* Logo */
.navbar__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  text-transform: uppercase;
  flex-shrink: 0;
  text-shadow: 0 0 20px var(--color-accent-glow);
  transition: text-shadow 0.2s;
}

.navbar__logo:hover {
  text-shadow: 0 0 32px rgba(232, 84, 122, 0.4);
}

/* Nav Links (center, hidden on mobile) */
.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-4);
  flex: 1;
}

.navbar__link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.navbar__link:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.navbar__link.active {
  color: var(--color-accent);
}

.navbar__link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

/* Dimmed "coming soon" links */
.navbar__link--soon {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Right side */
.navbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Listener count badge */
.navbar__listeners {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Mobile: hide nav links */
@media (max-width: 640px) {
  .navbar__links { display: none; }
}

/* ─── Drawer Backdrop ────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-drawer) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ─── Drawer ─────────────────────────────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--drawer-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.24s ease-out;
  overflow-y: auto;
  overflow-x: hidden;
}

.drawer.is-open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-3) var(--space-4);
  height: var(--navbar-height);
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border);
}

.drawer__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 1.3rem;
  transition: color 0.15s, background 0.15s;
}

.drawer__close:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* Drawer Now Playing */
.drawer__now-playing {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  min-height: 72px;
}

.drawer__now-playing.is-hidden {
  display: none;
}

.drawer__track-info {
  flex: 1;
  overflow: hidden;
}

.drawer__track-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.drawer__track-artist {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Drawer Nav */
.drawer__nav {
  padding: var(--space-2) var(--space-3);
}

.drawer__nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}

.drawer__nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.drawer__nav-link.active {
  color: var(--color-accent);
  background: var(--color-accent-glow);
}

.drawer__nav-link--soon {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.drawer__nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Drawer sections */
.drawer__section {
  padding: var(--space-3) var(--space-4);
}

.drawer__section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: var(--space-2);
}

/* $ZENI info */
.drawer__zeni-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.drawer__zeni-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.drawer__zeni-label {
  color: var(--color-text-dim);
}

.drawer__zeni-value {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Social links */
.drawer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.drawer__social-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--color-text-dim);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  transition: color 0.15s, border-color 0.15s;
}

.drawer__social-link:hover {
  color: var(--color-text);
  border-color: var(--color-text-dim);
}

/* Drawer footer (wallet button) */
.drawer__footer {
  margin-top: auto;
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.drawer__server-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
}

/* ─── Player Bar ─────────────────────────────────────────────────────────── */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-bar-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  gap: var(--space-3);
}

/* LIVE edge indicator */
.player-bar__live-edge {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  border-radius: 0 2px 2px 0;
  transition: background 0.3s;
}

.player-bar__live-edge.is-offline {
  background: var(--color-border);
}

/* Cover */
.player-bar__cover {
  width: var(--cover-md);
  height: var(--cover-md);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  object-fit: cover;
  flex-shrink: 0;
}

/* Track info */
.player-bar__info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.player-bar__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.player-bar__artist {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}

.player-bar__info--offline .player-bar__title {
  color: var(--color-text-dim);
}

/* Progress bar */
.player-bar__progress-wrap {
  flex: 1;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.player-bar__progress {
  width: 100%;
  height: 3px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  cursor: default;
}

.player-bar__progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width 1s linear;
  width: 0%;
}

.player-bar__progress-fill.is-offline {
  background: var(--color-border);
}

.player-bar__times {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-text-dim);
}

/* Volume */
.player-bar__volume {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.player-bar__vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  outline: none;
  cursor: pointer;
}

.player-bar__vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
}

.player-bar__vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: none;
}

/* Player actions */
.player-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Hide volume + progress on very small screens */
@media (max-width: 480px) {
  .player-bar__progress-wrap { display: none; }
  .player-bar__volume { display: none; }
}

@media (max-width: 360px) {
  .player-bar__info { display: none; }
}

/* ─── Drawer Wallet Card ─────────────────────────────────────────────────────
   Shown in drawer footer when wallet is connected.
   ───────────────────────────────────────────────────────────────────────────── */

.drawer__wallet-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-1);
}

/* Wallet address pill — overrides the global .wallet-address */
.drawer__wallet-card .wallet-address {
  font-size: 0.75rem;
  padding: 2px var(--space-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.drawer__wallet-card .wallet-address:hover {
  color: var(--color-text);
  border-color: var(--color-text-dim);
  background: var(--color-surface);
}

.drawer__wallet-card .wallet-address:active {
  background: var(--color-accent-glow);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
