/* TradeClick — Navigator (side rail on desktop, drawer on mobile) */

:root {
  --nav-rail-width: 64px;
  --nav-drawer-width: 280px;
  --nav-bg: #080C16;
  --nav-border: rgba(255, 255, 255, 0.06);
  --nav-item-active: rgba(29, 158, 117, 0.12);
  --nav-item-active-border: rgba(29, 158, 117, 0.4);
}

/* Body offset on desktop so the wallet content doesn't sit underneath the rail.
   We use a CSS custom property so existing layouts using flex/grid on body can
   still center themselves correctly — they just see a slightly smaller viewport. */
@media (min-width: 768px) {
  body.has-nav {
    padding-left: var(--nav-rail-width);
  }
  /* On pages already using flex/center patterns (like dashboard.html's app-wrap),
     the padding above is enough — the centered content auto-shifts right. */
}

/* ──────────────────────────────────────────
   The rail container
   ────────────────────────────────────────── */
.tc-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-rail-width);
  background: var(--nav-bg);
  border-right: 0.5px solid var(--nav-border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  overflow: hidden;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile: hidden off-canvas by default */
@media (max-width: 767px) {
  .tc-nav {
    transform: translateX(-100%);
    width: var(--nav-drawer-width);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .tc-nav.tc-nav-open {
    transform: translateX(0);
  }
}

/* Desktop expanded state — hover or pinned */
@media (min-width: 768px) {
  .tc-nav:hover,
  .tc-nav.tc-nav-expanded {
    width: var(--nav-drawer-width);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .tc-nav:hover .tc-nav-label,
  .tc-nav.tc-nav-expanded .tc-nav-label {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Mobile: always show labels when drawer is open */
@media (max-width: 767px) {
  .tc-nav.tc-nav-open .tc-nav-label {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ──────────────────────────────────────────
   Nav header (logo + close button on mobile)
   ────────────────────────────────────────── */
.tc-nav-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 44px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.tc-nav-logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(0, 214, 143, 0.55));
}

.tc-nav-logo i {
  font-size: 18px;
  color: white;
}

.tc-nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tc-nav-brand {
  font-size: 15px;
  font-weight: 600;
  color: white;
  letter-spacing: -0.01em;
}

/* ──────────────────────────────────────────
   Nav items
   ────────────────────────────────────────── */
.tc-nav-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.tc-nav-items::-webkit-scrollbar { width: 0; }

.tc-nav-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(229, 233, 240, 0.35);
  padding: 14px 12px 6px;
  white-space: nowrap;
}

.tc-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}

.tc-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: white;
}

.tc-nav-item.active {
  background: var(--nav-item-active);
  border: 0.5px solid var(--nav-item-active-border);
  color: white;
  box-shadow: inset 0 0 12px rgba(29, 158, 117, 0.1);
}

.tc-nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--green-bright);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--green-glow);
}

.tc-nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tc-nav-icon i {
  font-size: 18px;
}

.tc-nav-label {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-nav-item-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(29, 158, 117, 0.15);
  color: var(--green-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ──────────────────────────────────────────
   Bottom — status pill + collapse handle
   ────────────────────────────────────────── */
.tc-nav-footer {
  border-top: 0.5px solid var(--nav-border);
  padding: 12px 8px 8px;
  flex-shrink: 0;
}

.tc-nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(29, 158, 117, 0.06);
  border: 0.5px solid rgba(29, 158, 117, 0.2);
  cursor: pointer;
  transition: background 120ms ease;
  white-space: nowrap;
}

.tc-nav-status:hover {
  background: rgba(29, 158, 117, 0.12);
}

.tc-nav-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 8px var(--green-bright);
  flex-shrink: 0;
  animation: tc-pulse 2s ease-in-out infinite;
}

@keyframes tc-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.tc-nav-status-text {
  font-size: 11px;
  flex: 1;
  min-width: 0;
}

.tc-nav-status-name {
  color: white;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-nav-status-sub {
  color: rgba(229, 233, 240, 0.45);
  font-size: 10px;
  white-space: nowrap;
}

/* ──────────────────────────────────────────
   Mobile top bar with hamburger
   ────────────────────────────────────────── */
.tc-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--nav-border);
}

@media (max-width: 767px) {
  .tc-topbar { display: flex; }
}

.tc-topbar-trigger {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tc-topbar-trigger i {
  font-size: 18px;
  color: var(--text-primary);
}

.tc-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.tc-topbar-brand-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px rgba(0, 214, 143, 0.5));
}

.tc-topbar-brand-logo i { font-size: 14px; color: white; }

.tc-topbar-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tc-topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(29, 158, 117, 0.1);
  border: 0.5px solid rgba(29, 158, 117, 0.3);
  font-size: 11px;
  font-weight: 500;
  color: white;
}

.tc-topbar-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 6px var(--green-bright);
}

/* ──────────────────────────────────────────
   Drawer backdrop on mobile
   ────────────────────────────────────────── */
.tc-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 220ms ease;
}

.tc-nav-backdrop.tc-nav-backdrop-open {
  display: block;
  opacity: 1;
}

/* ──────────────────────────────────────────
   Wallet centering on wide screens
   ────────────────────────────────────────── */
.tc-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tc-wallet {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 20px;
}

@media (min-width: 768px) {
  .tc-wallet {
    padding: 32px 20px;
  }
}

@media (min-width: 900px) {
  .tc-wallet {
    max-width: 1100px;
    width: 90%;
    padding: 40px 48px 100px;
  }
}

@media (min-width: 1280px) {
  .tc-wallet {
    max-width: 1280px;
    width: 85%;
    padding: 48px 64px 100px;
  }
}
