@use "sass:color";
@use "vars";
@use "theme";

* {
    box-sizing: border-box;
    font-family: "Noto Sans", sans;
}

.monospace {
    font-family: "Noto Mono", sans;
}

body {
    font-size: 14px;
    margin: 0;
    background: var(--color-secondary-600);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
}
body::-webkit-scrollbar {
    display: none;
}
::selection {
    background: var(--color-primary);
    color: var(--color-secondary-700);
}

footer {
    text-align: center;
    padding: 12px 0;
    margin-top: 42px;
}

.flex {
    display: flex;
}

.headline,
h1 {
    color: var(--color-white-30);
    font-weight: 800;
}

h2 {
    margin-bottom: 0;
    margin-top: 6px;
}
h2 + p {
    margin-top: 0;
}

hr {
    margin: 10px 0;
    border: none;
    height: 1px;
    background: var(--color-white-10);
}
hr.spacer {
    margin: 4px 0;
    opacity: 0;
}

.icon-reload {
    cursor: pointer;
    vertical-align: middle;
    display: inline-block;
    padding: 0 6px;
}
.icon-reload img {
    width: 20px;
}

.asset-text {
    font-size: 16px;
    text-transform: uppercase;
    margin-left: 4px;
}

.asset-wrap {
    background-color: var(--color-dark-gray);
    border: 1px solid var(--color-white-15);
    position: absolute;
    border-radius: 29px;
    padding: 0px;
    padding-right: 8px;
    top: 10px;
    left: 10px;
    cursor: pointer;
    &:hover {
        background: var(--color-secondary-600);
    }
}

.asset-selection {
    display: flex;
    align-items: center;
    padding: 1px;
    padding-right: 8px;
}

.fees-dyn {
    display: flex;
    justify-content: center;
}
.fees-dyn > * {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: start;
}
.fees-dyn,
.icons > div {
    position: relative;
    text-align: right;
}
.icons > div {
    margin: 9px 0;
}

#invoice-qr {
    width: 66.666%;
}

#invoiceLabel {
    display: block;
    margin-bottom: 6px;
}

#reverse input {
    cursor: pointer;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    margin: 0;
    outline: none;
    border: none;
}

.btn {
    cursor: pointer;
    margin-top: 10px;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 16px;
    background-color: var(--color-primary);
    color: var(--color-secondary-700);
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    width: 100%;
    display: flex;
    justify-content: center;
    svg {
        margin-right: 3px;
    }
}

.btn-small {
    background-color: var(--color-primary);
    color: var(--color-secondary-700);
    border-radius: 7px;
    padding: 0 6px;
    cursor: pointer;
    text-decoration: none;
}

[data-status="swap.expired"],
[data-status="swap.waitingForRefund"],
[data-status="invoice.expired"],
[data-status="transaction.refunded"],
[data-status="invoice.failedToPay"],
[data-status="transaction.lockupFailed"] {
    > p > .btn-small {
        background-color: var(--color-error-500);
        color: var(--color-text);
    }
}

[data-status="swap.expired"],
[data-status="swap.refunded"],
[data-status="invoice.settled"],
[data-status="transaction.confirmed"],
[data-status="transaction.claimed"],
[data-status="transaction.claim.pending"],
[data-status="quote.available"] {
    > p > .btn-small {
        background-color: var(--color-success-500);
        color: var(--color-text);
    }
}

.tag .btn {
    background-color: var(--color-black-20);
    color: var(--color-text);
}

.btn:disabled:hover,
.btn:disabled {
    color: var(--color-secondary-600);
    background-color: var(--color-medium-gray);
    cursor: not-allowed;
}

.btn-active {
    background-color: var(--color-text);
    color: var(--color-secondary-700);
}
@media (hover: hover) {
    .btn-small:hover,
    .btn:hover,
    .tag .btn:hover {
        background-color: var(--color-secondary-200);
        color: var(--color-secondary-700);
    }
}
@media (hover: hover) {
    .btn-small:hover,
    .btn:hover,
    .tag .btn:hover {
        background-color: var(--color-secondary-200);
        color: var(--color-secondary-700);
    }
}

.btn-light {
    color: var(--color-text);
    background-color: var(--color-black-40);
}
@media (hover: hover) {
    .btn-light:hover {
        background-color: var(--color-primary);
    }
}
.btn-explorer {
    background: var(--color-tertiary);
    color: var(--color-text);
}
@media (hover: hover) {
    .btn-explorer:hover {
        background: var(--color-secondary-100);
        color: var(--color-tertiary);
    }
}

.btn-success {
    background-color: var(--color-success-500);
    color: var(--color-text);
}

@media (hover: hover) {
    .btn-success:hover {
        background-color: var(--color-secondary-200);
    }
}
.btn-danger:disabled,
.btn-danger {
    background-color: var(--color-error-700);
    color: var(--color-text);
}
@media (hover: hover) {
    .btn-danger:hover {
        background: var(--color-secondary-200);
    }
}
.center,
.btns {
    display: flex;
    align-items: center;
    justify-content: center;
}
.btns-space-between {
    justify-content: space-between;
}
.btns .btn {
    width: auto;
    margin: 3px;
    flex-grow: 1;
}
.btns .no-grow {
    flex-grow: 0;
}

.fee {
    padding: 0 24px;
}

.fees {
    display: flex;
    justify-content: space-between;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

textarea {
    resize: none;
}

input,
textarea {
    color: var(--color-white-30);
    background: var(--color-black-30);
    border: 1px dashed var(--color-white-30);
    border-radius: 10px;
    width: 100%;
    font-size: 15px;
    font-weight: normal;
    text-align: center;
    margin: 0;
    padding: 7px 8px;
    box-sizing: border-box;
}
input:focus,
textarea:focus {
    outline: none;
    color: var(--color-white-80);
    border-color: var(--color-primary);
}
input.invalid,
textarea.invalid {
    outline: none;
    color: var(--color-white-80);
    border-color: var(--color-error-500);
}
.fees-dyn label {
    display: block;
}
#receiveAmount,
#sendAmount {
    font-size: 33px;
    text-align: right;
}
@media (max-width: 488px) {
    #receiveAmount,
    #sendAmount {
        font-size: 30px;
    }
}
.invoice-input {
    min-height: 198px;
}

#refundAddress {
    margin: 8px 0 0;
}

#steps {
    padding: 0 12px;
}
#steps > .frame > div {
    display: none;
}

#steps > .frame > .active {
    display: block;
}

.toggle {
    cursor: pointer;
    flex-grow: 0;
    background: var(--color-black-30);
    border-radius: 18px;
    border: 1px dashed var(--color-white-30);
    padding: 0 5px;
    align-items: center;
    display: flex;
    justify-content: start;
    height: 38px;
    &:hover {
        background: var(--color-secondary-600);
    }
    > * {
        min-width: 30px;
        height: 30px;
        border-radius: 50%;
        user-select: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    > :first-child {
        margin-right: 5px;
    }
    .active {
        color: var(--color-btc-orange);
        background: var(--color-secondary-700);
        border: 1px solid var(--color-white-25);
    }
}
.denomination-desktop {
    display: flex;
    max-width: max-content;
    flex-grow: 0;
    gap: 1px;
    padding: 2px;
    height: fit-content;
    border: 1px dashed var(--color-white-10);
    background: var(--color-secondary-700);
    border-radius: 20px;
    span {
        filter: grayscale(1);
    }
    button {
        font-size: 14px;
        display: flex;
        align-items: center;
        flex-grow: 0;
        gap: 10px;
        padding: 0.3rem 0.9rem;
        background: var(--color-black-30);
        color: var(--color-white-50);
        cursor: pointer;
        position: relative;
        box-sizing: border-box;
        border: 1px solid transparent; // ensures the button is always the same size
        &:first-child {
            border-radius: 20px 0 0 20px;
        }
        &:last-child {
            border-radius: 0 20px 20px 0;
        }
        @media (hover: hover) {
            &:hover {
                background: var(--color-secondary-600);
                color: var(--color-white-80);
                border: 1px dashed var(--color-btc-orange-15);
            }
        }
        &.active {
            color: var(--color-btc-orange);
            background: var(--color-secondary-500);
            border: 1px dashed var(--color-btc-orange-20);
            span {
                filter: none;
            }
        }
        // for keyboard navigation
        &:focus-visible {
            outline: none;
            border: 1px solid var(--color-primary);
        }
        &.active:focus-visible {
            outline: none;
            border: 1px solid var(--color-primary);
        }
    }
}
@media (max-width: 488px) {
    .denomination-desktop {
        display: none;
    }
}
@media (min-width: 489px) {
    .denomination-mobile {
        display: none;
    }
}
.denomination img {
    filter: brightness(10);
    cursor: pointer;
    width: 28px;
}
.denominator {
    filter: brightness(10);
    width: 15px;
    height: 11px;
    background-repeat: no-repeat;
    background-size: contain;
    display: inline-block;
    transform: scale(2.1);
    background-position: right;
}
.denominator-big {
    width: 33px;
    height: 30px;
    transform: scale(1.5);
}

[data-denominator="btc"] {
    background-image: url(../assets/btc.svg);
}
[data-denominator="sat"] {
    background-image: url(../assets/sat.svg);
}
.denomination .active {
    filter: none;
    border-radius: 50%;
    background-color: var(--color-secondary-700);
    border: 1px solid var(--color-white-25);
}

.hidden {
    display: none;
}

.frame {
    color: var(--color-text);
    padding: 12px;
    min-width: 360px;
    max-width: 480px;
    margin: 0 auto;
    border: 1px solid var(--color-white-10);
    position: relative;
    border-left: 0;
    border-right: 0;
    background: var(--color-secondary-700);
}
.swap-status {
    display: inline-flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.6rem;
}
.vertical-line {
    border-left: 1px solid var(--color-white-10);
    align-self: stretch;
    height: auto;
}
.refund {
    max-width: fit-content;

    p {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 488px) {
    .frame {
        max-width: 480px;
    }
}

@media (min-width: 488px) {
    .frame {
        margin-top: 74px;
        margin-bottom: 56px;
        border: 1px solid var(--color-white-10);
        border-radius: 16px;
    }
}

@media (max-width: 488px) {
    .frame-header {
        display: flex;
        align-items: end;
        justify-content: space-evenly;
        font-size: 0.85rem;

        #settings-cog {
            position: unset;
            margin-bottom: -2px;
        }
    }
    .swap-status {
        margin-top: 0.25rem;
    }
}

.error {
    background: var(--color-error-700);
    color: var(--color-white-80);
    padding: 6px 10px;
    display: inline-block;
}

#flip-assets {
    width: 32px;
    height: 32px;
    padding: 8px;
    background: var(--color-secondary-800);
    margin: -21px auto;
    border: 1px dashed var(--color-medium-gray);
    border-radius: 6px;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 0 7px var(--color-black-40);
    color: var(--color-secondary-100);
    position: absolute;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}
@media (hover: hover) {
    #flip-assets:hover {
        background: var(--color-secondary-500);
    }
}

#flip-assets svg {
    width: 100%;
    opacity: 0.5;
}

.arrow-down {
    border: solid white;
    display: inline-block;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 4px;
    margin-left: 8px;
    position: relative;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    top: -2px;
}

.asset-select {
    display: flex;
    align-items: center;
    background-color: var(--color-white-05);
    border: 1px solid var(--color-white-15);
    border-radius: 29px;
    padding: 1px;
    padding-right: 16px;
    cursor: pointer;
    display: inline-flex;
    text-transform: uppercase;
    margin: 5px 12px;
}
[data-selected="true"],
.asset-select:hover {
    background-color: var(--color-white-25);
}
.assets-select {
    background: var(--color-secondary-700);
    position: absolute;
    width: 100%;
    left: 0;
    top: 64px;
    z-index: 999;
    display: none;
    box-shadow: 0 0 12px var(--color-black);
    margin: 0;
}
.assets-select.active {
    display: block;
}
.assets-select:after {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-black-50);
    z-index: -1;
}

.close {
    cursor: pointer;
    user-select: none;
    z-index: 1000;
    position: absolute;
    top: 8px;
    right: 15px;
    font-size: 30px;
    margin-top: 5px;
}

#close {
    cursor: pointer;
    transform: rotate(45deg);
    -webkit-tap-highlight-color: transparent;
    transition: transform 400ms;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    z-index: 1000;
    position: absolute;
    top: 8px;
    right: 8px;
}
#close .line {
    fill: none;
    transition:
        stroke-dasharray 400ms,
        stroke-dashoffset 400ms;
    stroke: var(--color-secondary-100);
    stroke-width: 5.5;
    stroke-linecap: round;
}
#close .top {
    stroke-dashoffset: -68px;
    stroke-dasharray: 40 121;
}
#close .bottom {
    stroke-dashoffset: -68px;
    stroke-dasharray: 40 121;
}
.btn-inline {
    display: inline-block;
    width: auto;
}
.network-fee,
.boltz-fee {
    margin-right: 4px;
}

.globe {
    cursor: pointer;
    padding-left: 20px !important;
    padding-top: 6px;
    display: inline-block;
}

.external svg {
    padding-left: 6px;
    float: right;
}

.break-word {
    word-break: break-all;
}

.copy-box {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 0.63rem;
    user-select: none;
    font-size: 1.13rem;
    background-color: var(--color-black-20);
    border-radius: 0.43rem;
    padding: 0.63rem;
    border: 1px solid var(--color-white-10);
    color: var(--color-white-50);
    margin: 0;
    cursor: pointer;
}

.bulletpoints {
    text-align: left;
    display: inline-block;
    margin: 0;
}

.pointer {
    cursor: pointer;
}

@media (max-width: 488px) {
    .hidden-mobile {
        display: none;
    }
}

#refundUpload {
    margin-top: 7px;
}

.quote {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 400;
}

.quote > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.quote > div > span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20rem;
    padding: 7px 8px;
    margin: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-black-30);
    border: 1px dashed var(--color-white-30);
    border-radius: 10px;
    box-sizing: border-box;
    .denominator {
        width: 15px;
        height: 15px;
        margin-left: 0.5rem;
    }
}

header {
    margin-bottom: 1rem;
}

.not-found {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.swap-limits {
    display: inline-flex;
    gap: 0.8rem;
}

.text-bold {
    font-weight: 600;
    color: var(--color-secondary-200);
}

.text-highlight {
    color: var(--color-primary);
}

.mnemonic-number {
    min-width: 1.3rem;
    color: var(--color-medium-gray);
}

.backup-mnemonic-container {
    display: flex;
    justify-content: center;
    max-width: 18rem;
    padding: 1rem;
    margin: 0 auto;

    color: var(--color-secondary-100);
    background: var(--color-black-30);
    border: 1px dashed var(--color-white-30);
    border-radius: 10px;

    user-select: none;

    .mnemonic-wordlist {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, auto);
        grid-auto-flow: column;
        column-gap: 2rem;
        row-gap: 0.1rem;

        .mnemonic-item {
            display: flex;
            justify-content: start;
            gap: 0.5rem;
        }
    }
}

.verification-words {
    display: flex;
    flex-direction: row;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    align-items: start;
    font-size: 1rem;
    gap: 1rem;

    .mnemonic-item {
        display: flex;
        align-items: flex-end;
        gap: 0.4rem;
    }

    .verification-item {
        min-width: 4rem;
        border-bottom: 2px solid currentColor;
        color: var(--color-primary);
        border-radius: 0;

        .mnemonic-number {
            color: var(--color-primary);
        }
    }
}

.verification-buttons {
    width: 100%;
}

.mnemonic-input-container {
    display: flex;
    flex-direction: column;
    margin-top: 0.625rem;
    gap: 10px;

    .mnemonic-inputs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
        grid-auto-flow: column;
        column-gap: 1rem;
        row-gap: 0.5rem;

        max-width: 18rem;
        padding: 1rem;
        margin: 0 auto;

        color: var(--color-secondary-100);
        background: var(--color-black-30);
        border: 1px dashed var(--color-white-30);
        border-radius: 10px;

        .input-box {
            display: flex;
            gap: 0.8rem;
            justify-content: space-around;

            .mnemonic-input {
                padding: 0;

                color: var(--color-secondary-100);
                background: transparent;
                font-weight: 600;
                text-align: left;

                border: none;
                border-bottom: 1px dashed var(--color-white-10);
                border-radius: 0;
            }
            .mnemonic-input:focus {
                border-bottom: 1px dotted var(--color-primary);

                &.invalid {
                    border-bottom: 1px dashed var(--color-error-500);
                }
            }

            .invalid {
                border-bottom: 1px dashed var(--color-error-500);
            }
        }
    }
}

.mnemonic-backup-verify-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.fee-comparison-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: var(--color-black-10);
    border-radius: 0.5rem;

    a {
        color: var(--color-text);
    }
    a:hover {
        color: var(--color-primary);
    }

    th,
    td {
        text-align: center;
    }

    th {
        padding: 0.2rem 1rem;
    }

    td {
        padding: 0.7rem 1rem;
    }

    th {
        border-top: 1px solid var(--color-white-05);
        text-transform: uppercase;
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--color-medium-gray);
    }

    tr {
        border-bottom: 1px solid var(--color-white-05);
    }

    tbody tr:last-child {
        border-bottom: none;
    }

    .no-data-row a {
        display: inline-flex;
        justify-content: center;
        align-items: end;
        gap: 0.3rem;
    }

    .fee-comparison-row:not(.no-data-row) td:first-child {
        display: flex;
        justify-content: center;
    }

    .fee-comparison-alerts {
        margin-top: 0.5rem;
        font-size: 0.8rem;
    }

    .fee-comparison-row:not(.no-data-row) {
        cursor: pointer;
        transition: background-color 0.2s ease;

        @media (hover: hover) {
            &:hover {
                background-color: var(--color-secondary-700);
            }
        }
    }
}

.lower-fee {
    color: var(--color-lower-fee);
    text-shadow:
        0 0 4px var(--color-lower-fee-glow),
        0 0 8px var(--color-lower-fee-glow);
}

.negative-fee {
    color: var(--color-negative-fee);
    text-shadow:
        0 0 4px var(--color-negative-fee-glow),
        0 0 8px var(--color-negative-fee-glow);
}

.accordion {
    margin-top: 0.5rem;
    border: 1px dashed var(--color-white-10);
    background: var(--color-black-20);
    border-radius: 0.5rem;
    overflow: hidden;

    .accordion-header {
        background: var(--color-black-10);
        color: var(--color-text);
        padding: 0.3rem 0rem;
        width: 100%;
        text-align: left;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        border: none;
        outline: none;
        text-transform: uppercase;

        transition: text-shadow 0.2s ease;

        @media (hover: hover) {
            &:hover {
                text-shadow: 0 0 4px var(--color-text-glow);
            }
        }

        .accordion-icon {
            font-size: 1.25rem;
            margin-bottom: -0.3rem;
        }
    }

    .accordion-content {
        animation: slideDown 0.25s ease-in;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.optimized-route {
    color: var(--color-link-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.creating-swap-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30dvh;
}

#copy-destination {
    all: unset;
    display: flex;
    gap: 4px;
    align-items: center;
    opacity: 0.5;
    border-bottom: 1px dotted var(--color-white-50);
}
