/* Desktop quick-action rail — spread across the top bar (not clustered on the right) */

.top-nav__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.top-quick-actions {
  display: none;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 clamp(12px, 3vw, 40px);
  gap: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.top-quick-actions[data-logged-in="true"] {
  display: flex;
  justify-content: space-evenly;
}

.top-action-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 56px;
  max-width: 140px;
  padding: 4px 10px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.top-action-chip__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(71, 85, 105, 0.5);
  color: inherit;
}

.top-action-chip__label {
  white-space: nowrap;
}

.top-action-chip--deposit {
  color: #6ee7b7;
}

.top-action-chip--deposit .top-action-chip__icon {
  background: rgba(6, 78, 59, 0.45);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.top-action-chip--deposit:hover {
  background: rgba(6, 95, 70, 0.25);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.22);
}

.top-action-chip--withdraw {
  color: #fcd34d;
}

.top-action-chip--withdraw .top-action-chip__icon {
  background: rgba(120, 53, 15, 0.4);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.top-action-chip--withdraw:hover {
  background: rgba(146, 64, 14, 0.28);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.2);
}

.top-action-chip--history {
  color: #c4b5fd;
}

.top-action-chip--history .top-action-chip__icon {
  background: rgba(76, 29, 149, 0.35);
  border-color: rgba(167, 139, 250, 0.45);
  color: #a78bfa;
}

.top-action-chip--history:hover {
  background: rgba(91, 33, 182, 0.28);
  border-color: rgba(196, 181, 253, 0.5);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.22);
}

.top-action-chip--chat {
  color: #7dd3fc;
}

.top-action-chip--chat .top-action-chip__icon {
  background: rgba(12, 74, 110, 0.45);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.top-action-chip--chat:hover {
  background: rgba(14, 116, 144, 0.3);
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.2);
}

.top-action-chip--scanner {
  color: #a5f3fc;
}

.top-action-chip--scanner .top-action-chip__icon {
  background: rgba(8, 47, 73, 0.65);
  border-color: rgba(34, 211, 238, 0.5);
  color: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

.top-action-chip--scanner:hover {
  background: rgba(14, 116, 144, 0.35);
  border-color: rgba(103, 232, 249, 0.75);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.28);
}

@media (max-width: 900px) {
  .top-quick-actions,
  .top-quick-actions[data-logged-in="true"] {
    display: none !important;
  }

  .top-action-chip--in-rail {
    display: none !important;
  }

  .top-nav__right {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
  }

  /* Hidden until login/register (JS sets data-logged-in and removes [hidden]) */
  .top-action-chip--mobile-bar {
    display: none !important;
  }

  .top-action-chip--mobile-bar[data-logged-in="true"]:not([hidden]) {
    display: inline-flex !important;
    flex: 0 0 auto;
    min-width: 48px;
    max-width: none;
    min-height: 32px;
    padding: 4px 7px 4px;
    box-sizing: border-box;
  }

  .top-action-chip--mobile-bar .top-action-chip__icon {
    width: 22px;
    height: 22px;
  }

  .top-action-chip--mobile-bar .top-action-chip__label {
    font-size: 9px;
  }

  .top-nav__right .balance-display[data-logged-in="true"] {
    display: flex !important;
  }
}

@media (min-width: 901px) {
  .top-action-chip--mobile-bar {
    display: none !important;
  }
}

@media (min-width: 901px) {
  .top-nav {
    display: grid;
    grid-template-columns: minmax(200px, auto) minmax(0, 1fr) minmax(220px, auto);
    align-items: center;
    column-gap: clamp(8px, 2vw, 24px);
    padding-left: 88px;
    padding-right: 20px;
  }

  .nav-left {
    grid-column: 1;
    min-width: 0;
  }

  .top-quick-actions[data-logged-in="true"] {
    grid-column: 2;
    justify-content: space-evenly;
    align-self: stretch;
    align-items: center;
    padding-top: 2px;
    padding-bottom: 2px;
    border-top: 1px solid rgba(51, 65, 85, 0.25);
    border-bottom: 1px solid rgba(51, 65, 85, 0.25);
    background: linear-gradient(
      90deg,
      rgba(2, 6, 23, 0) 0%,
      rgba(15, 23, 42, 0.55) 12%,
      rgba(15, 23, 42, 0.55) 88%,
      rgba(2, 6, 23, 0) 100%
    );
  }

  .top-nav__right {
    grid-column: 3;
    justify-content: flex-end;
    margin-left: 0;
    position: static;
    top: auto;
    right: auto;
  }

  /* Logged out: auth stays right; middle column unused */
  .top-nav:not(:has(.top-quick-actions[data-logged-in="true"])) {
    grid-template-columns: minmax(200px, auto) 1fr minmax(220px, auto);
  }
}

@media (min-width: 1200px) {
  .top-quick-actions[data-logged-in="true"] {
    padding-left: clamp(24px, 5vw, 80px);
    padding-right: clamp(24px, 5vw, 80px);
  }

  .top-action-chip {
    max-width: 160px;
  }
}
