/* The wallet balance in the bottom bar is a button that opens Cüzdan geçmişi. */
button.walletBalance {
  padding: 4px 8px;
  margin-right: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

button.walletBalance:hover,
button.walletBalance:focus-visible {
  background: rgb(var(--border-rgb) / 0.08);
  color: var(--text);
}

button.walletBalance:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Cüzdan geçmişi */
.walletHistoryModal {
  width: min(460px, calc(100vw - 32px));
  max-width: 460px;
  height: min(680px, calc(100vh - var(--titlebar-height, 0px) - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text);
  overflow: visible;
  z-index: 10000;
}

.walletHistoryModal.hidden,
.walletHistoryModal:not([open]) {
  display: none;
}

.walletHistoryModal::backdrop {
  background: rgb(var(--bg-deep-rgb) / 0.82);
}

.walletHistoryContent {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding: 20px 20px 0;
  border-radius: inherit;
  background: var(--popover-bg);
  box-shadow: 0 0 0 1px rgb(var(--border-rgb) / 0.1), var(--shadow-lg);
  overflow: hidden;
}

.walletHistoryHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.walletHistoryHeader h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.walletHistoryClose {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(var(--border-rgb) / 0.08);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.walletHistoryClose:hover {
  color: var(--text);
}

.walletHistoryFilters {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(var(--border-rgb) / 0.06);
}

.walletHistoryFilter {
  flex: 1;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.walletHistoryFilter:hover {
  color: var(--text);
}

.walletHistoryFilter.active {
  background: var(--popover-bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 0 0 1px rgb(var(--border-rgb) / 0.08);
  color: var(--text);
}

.walletHistoryScroll {
  min-height: 0;
  margin: 0 -20px;
  padding: 0 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.walletHistoryList,
.walletHistoryDay ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.walletHistoryDay + .walletHistoryDay {
  margin-top: 14px;
}

.walletHistoryDay h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 6px 0;
  background: var(--popover-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.walletHistoryRow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.walletHistoryIcon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(var(--border-rgb) / 0.06);
  color: var(--text-secondary);
}

.walletHistoryIcon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.walletHistoryIcon[data-icon='in'] {
  color: var(--success);
}

.walletHistoryIcon[data-icon='out'] {
  color: var(--danger);
}

.walletHistoryText,
.walletHistoryMoney {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.walletHistoryText strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.walletHistoryText small,
.walletHistoryMoney small {
  color: var(--muted);
  font-size: 11.5px;
}

.walletHistoryMoney {
  justify-items: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.walletHistoryMoney strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.walletHistoryRow[data-direction='in'] .walletHistoryMoney strong {
  color: var(--success);
}

.walletHistoryStatus {
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.walletHistoryStatus[data-error='true'] {
  color: var(--danger);
}

.walletHistoryMore {
  display: block;
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border: 0;
  border-radius: var(--radius-md, 10px);
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(var(--border-rgb) / 0.08);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.walletHistoryMore:disabled {
  cursor: default;
  opacity: 0.6;
}

.walletHistoryMore[hidden],
.walletHistoryStatus[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  button.walletBalance,
  .walletHistoryFilter {
    transition: none;
  }
}
