/* Nimiq TransactionList — wallet transaction-history rows with month headers.
   Port of wallet TransactionListItem.vue scoped styles (+ TransactionList.vue
   .month-label and the wallet button.reset global), all namespaced under
   .transaction-list. Requires the Nimiq legacy stylesheet
   (nimiq-style.min.css: html{font-size:8px}, --nimiq-* vars) and Fira Mono
   for the address font. Set the list width on .transaction-list. */

.transaction-list {
    /* Wallet theme vars used by the component (wallet themes.scss) */
    --bg-primary: var(--nimiq-white);
    --body-size: 2rem;
    --small-size: 1.75rem;
    --label-size: 1.75rem;
    --small-label-size: 1.5rem;
    --text-50: rgba(31, 35, 72, 0.5);
    --text-12: rgba(31, 35, 72, 0.12);

    color: var(--nimiq-blue);
}

/* --- Month header (TransactionList.vue .month-label) --- */

.transaction-list .month-label {
    display: flex;
    flex-direction: row;
    padding: 5rem 2rem 2rem;
    justify-content: space-between;
    align-items: center;
}

.transaction-list .month-label label {
    letter-spacing: 1.5px;
    font-size: var(--label-size);
    line-height: 2rem;
    text-transform: uppercase;
    font-weight: bold;
    opacity: 0.4;
}

/* --- Row (TransactionListItem.vue) --- */

.transaction-list .transaction svg {
    display: block;
}

.transaction-list .transaction {
    /* wallet button.reset global, merged in (same specificity as the layout
       rule below would otherwise fight it) */
    outline: none;
    font-family: inherit;
    line-height: inherit;
    font-weight: inherit;
    color: inherit;
    text-align: inherit;

    display: flex;
    align-items: center;
    flex-direction: row;
    width: 100%;
    padding: 1.5rem 1rem;
    border: 0;
    background: transparent;
    border-radius: .75rem;
    cursor: pointer;
    transition: background 400ms var(--nimiq-ease);
    font-size: var(--body-size);
}

.transaction-list .transaction:hover,
.transaction-list .transaction:focus {
    background: var(--nimiq-highlight-bg);
}

.transaction-list .transaction:hover .identicon .cashlink-or-swap,
.transaction-list .transaction:focus .identicon .cashlink-or-swap {
    border-color: #F2F2F4;
}

.transaction-list .transaction > * {
    margin: 0rem 1rem;
}

.transaction-list .transaction .date {
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.4;
    flex-grow: 0;
    letter-spacing: 0.0125em;
    line-height: 1;
    flex-shrink: 0;
}

.transaction-list .transaction .date > .month {
    font-size: var(--small-label-size);
    letter-spacing: 0.0667em;
    text-transform: uppercase;
}

.transaction-list .transaction .date,
.transaction-list .transaction .pending,
.transaction-list .transaction .new,
.transaction-list .transaction .invalid {
    width: 3.75rem;
    text-align: center;
    flex-shrink: 0;
}

.transaction-list .transaction .identicon {
    position: relative;
    width: 6rem;
    height: 6rem;
    flex-shrink: 0;
}

.transaction-list .transaction .identicon img {
    width: 100%;
    height: 100%;
}

.transaction-list .transaction .identicon .cashlink-or-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: -0.5rem;
    right: -0.125rem;
    color: white;
    background: var(--nimiq-blue-bg);
    border: 0.375rem solid var(--bg-primary);
    transition: border-color 400ms var(--nimiq-ease);
    border-radius: 2rem;
    height: 2.75rem;
    width: 2.75rem;
}

.transaction-list .transaction .data {
    flex-grow: 1;
    overflow: hidden;
    line-height: 1.4;
}

.transaction-list .transaction .data .label,
.transaction-list .transaction .data .address {
    white-space: nowrap;
    -webkit-mask: linear-gradient(90deg, white, white calc(100% - 3rem), rgba(255,255,255, 0));
    mask: linear-gradient(90deg, white, white calc(100% - 3rem), rgba(255,255,255, 0));
}

.transaction-list .transaction .data .label {
    font-weight: 600;
}

.transaction-list .transaction .data .address {
    font-family: 'Fira Mono', monospace;
    word-spacing: -0.2em;
}

.transaction-list .transaction .data .time-and-message {
    font-size: var(--small-size);
    font-weight: 600;
    color: var(--text-50);
    white-space: nowrap;
    -webkit-mask: linear-gradient(90deg, white, white calc(100% - 3rem), rgba(255,255,255, 0));
    mask: linear-gradient(90deg, white, white calc(100% - 3rem), rgba(255,255,255, 0));
}

.transaction-list .transaction .data .time-and-message .dot {
    margin: 0 0.875rem;
    opacity: 0.6;
}

/* --- Amounts column --- */

.transaction-list .transaction .amounts {
    --fiat-amount-height: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.4;
}

.transaction-list .transaction .amounts .amount {
    --size: var(--body-size);
    white-space: nowrap;
    font-weight: bold;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.transaction-list .transaction .amounts > .fiat-amount {
    --size: var(--small-size);
    font-size: var(--size);
    font-weight: 600;
    opacity: 0.4;
    align-items: center;
    line-height: 1;
}

/* Fiat value still loading: breathing placeholder bar */
.transaction-list .transaction .amounts > .fiat-amount.fiat-loading {
    min-width: 4rem;
    height: 1.6rem;
    background-color: var(--text-12);
    border-radius: 0.5rem;
    animation: nq-tx-amount-loading-breathe 1s infinite;
}

@keyframes nq-tx-amount-loading-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.2; }
}

.transaction-list .transaction .amounts > .fiat-amount.fiat-unavailable {
    opacity: 0.3;
}

.transaction-list .transaction .amounts > * {
    white-space: nowrap;
    text-align: right;
}

/* Outgoing: dimmed plain amount with '-' prefix */
.transaction-list .transaction .amounts:not(.isIncoming):not(.signalling) .amount {
    opacity: 0.6;
}

.transaction-list .transaction .amounts:not(.isIncoming):not(.signalling) .amount::before {
    content: '-';
    margin-right: -0.1em;
}

/* Incoming: green tinted pill with '+' prefix */
.transaction-list .transaction .amounts.isIncoming .amount {
    color: var(--nimiq-green);
    background: rgba(33, 188, 165, 0.1);
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    margin-right: -0.75rem;
}

.transaction-list .transaction .amounts.isIncoming .amount::before {
    content: '+';
    margin-right: -0.1em;
}
