/* Shared styles for inner pages (wallet, profile, orders, deposit, withdraw) */

/* Account layout with sidebar */
.account-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
}

.account-sidebar {
  width: 300px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
}

.account-sidebar__section {
  padding: 0 16px;
  margin-bottom: 20px;
}

.account-sidebar__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-third);
  padding: 8px 0;
}

.account-sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.account-sidebar a:hover {
  color: var(--accent);
  background: rgba(240,185,11,0.04);
}

.account-sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(240,185,11,0.06);
  font-weight: 600;
}

.account-sidebar a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.account-content {
  flex: 1;
  min-width: 0;
}

.account-mobile-nav {
  display: none;
  padding: 16px 16px 0;
}

.account-mobile-nav__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.account-mobile-nav__track::-webkit-scrollbar { display: none; }

.account-mobile-nav__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.account-mobile-nav__chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.account-mobile-nav__chip.active {
  color: var(--accent);
  border-color: rgba(240,185,11,0.35);
  background: rgba(240,185,11,0.08);
}

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px;
  min-height: calc(100vh - var(--navbar-h));
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
}

/* Wallet overview */
.wallet-total {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.wallet-total__value {
  font-size: 36px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.wallet-total__label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.wallet-total__actions {
  display: flex;
  gap: 10px;
}

.wallet-total__actions a {
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Asset table */
.asset-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.asset-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-third);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.asset-table th:last-child { text-align: right; }

.asset-table td {
  padding: 16px 16px;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.asset-table td:last-child { text-align: right; }

.asset-table tr:last-child td { border-bottom: none; }

.asset-table tr:hover { background: var(--bg-tertiary); }

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

.asset-cell__info {
  line-height: 1.3;
}

.asset-cell__name { font-weight: 600; }
.asset-cell__full { font-size: 12px; color: var(--text-third); }

.asset-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.asset-actions a {
  font-size: 12px;
  color: var(--accent);
  padding: 4px 8px;
  border-radius: var(--radius);
}

.asset-actions a:hover { background: rgba(240,185,11,0.1); }

/* Profile card */
.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 560px;
}

.profile-stack {
  display: grid;
  gap: 18px;
  max-width: 560px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #181a20;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar:hover::after {
  content: 'Edit';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}

.profile-info h2 { font-size: 20px; margin-bottom: 4px; }
.profile-info p { font-size: 13px; color: var(--text-secondary); }

.profile-field {
  margin-bottom: 20px;
}

.profile-field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-field input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 6px;
}

.profile-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-kyc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.profile-kyc-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-kyc-card__header h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-kyc-card__header p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 360px;
}

.profile-kyc-card__status {
  display: grid;
  gap: 10px;
}

.profile-kyc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.profile-kyc-pill.is-pending {
  background: rgba(240,185,11,0.14);
  color: var(--accent);
}

.profile-kyc-pill.is-approved {
  background: rgba(14,203,129,0.15);
  color: var(--green);
}

.profile-kyc-pill.is-rejected {
  background: rgba(246,70,93,0.14);
  color: var(--red);
}

.profile-kyc-meta {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Deposit/Withdraw forms */
.form-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 520px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-field select,
.form-field input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 6px;
}

.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23848e9c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 32px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-third);
  margin-top: 4px;
}

/* Deposit address display */
.deposit-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-input);
  border-radius: 8px;
  text-align: center;
}

.deposit-result__qr {
  margin: 0 auto 12px;
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.deposit-result__qr img { width: 100%; height: 100%; }

.deposit-result__address {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-top: 8px;
  cursor: pointer;
  position: relative;
}

.deposit-result__address:hover { background: var(--bg-tertiary); }

.deposit-result__copy {
  font-size: 11px;
  color: var(--accent);
  margin-top: 6px;
}

/* Orders table */
.orders-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.orders-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-third);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.orders-table td {
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border);
}

.orders-table tr:last-child td { border-bottom: none; }

.order-buy { color: var(--green); }
.order-sell { color: var(--red); }
.order-filled { color: var(--green); }
.order-cancelled { color: var(--text-third); }

.orders-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-third);
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.filter-tabs button {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
}

.filter-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Responsive */
@media (max-width: 900px) {
  .account-sidebar { display: none; }
  .account-mobile-nav { display: block; }
}

@media (max-width: 768px) {
  .page-container { padding: 16px 12px; }
  .page-title { font-size: 20px; margin-bottom: 16px; }

  .wallet-total { padding: 16px; flex-direction: column; align-items: flex-start; }
  .wallet-total__value { font-size: 24px; }
  .wallet-total__actions { width: 100%; }
  .wallet-total__actions a { flex: 1; justify-content: center; padding: 12px; font-size: 13px; }

  .asset-table { font-size: 12px; }
  .asset-table th { padding: 6px 8px; font-size: 10px; }
  .asset-table td { padding: 8px 8px; font-size: 13px; }
  .asset-cell { gap: 8px; }
  .asset-cell img { width: 22px !important; height: 22px !important; }
  .asset-cell__name { font-size: 13px; }
  .asset-cell__full { font-size: 10px; }
  .asset-actions {
    flex-direction: row; gap: 3px; justify-content: flex-end; flex-wrap: nowrap;
  }
  .asset-actions a {
    font-size: 9px; padding: 3px 6px; border-radius: 4px;
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--accent); font-weight: 600; white-space: nowrap;
    text-align: center; line-height: 1.2; text-decoration: none;
  }
  .asset-actions a:hover { background: rgba(240,185,11,0.12); }

  .profile-card { padding: 20px; }
  .profile-stack { max-width: 100%; }
  .profile-header { gap: 14px; }
  .profile-avatar { width: 56px; height: 56px; font-size: 22px; }
  .profile-kyc-card { padding: 18px; border-radius: 14px; }
  .profile-kyc-card__header { flex-direction: column; align-items: stretch; }
  .profile-kyc-card__header .btn-secondary { width: 100%; justify-content: center; }

  .form-card { padding: 20px; }

  .orders-table th, .orders-table td { padding: 8px 6px; font-size: 11px; }
}
