:root {
    --primary-color: #03d47c;

    /* font-sizes */
    --font-xsmall: 0.8rem;
    --font-small: 0.9rem;
    --font-normal: 1rem;
    --font-large: 1.2rem;
    --font-xlarge:1.5rem;
}

/*----------- Global reset --------------*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #F4FBF8;
    color: #333;
    overflow-x: hidden;
}


/*---------------- Header ---------------*/
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    background-color: #fff;
    padding: 10px;
    margin-bottom: 30px;
}

.header__logo {
    color: var(--primary-color);
    font-size: var(--font-xlarge);
    font-weight: bold;
    margin-left: 30px;
}

h1.protected__title {
    margin: 10px;
}

/* ------------- Wrapper -------------- */
.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.protectedContent {
    display: none;
}



/*----------------- Login ---------------*/
.login {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    border: solid 1px #ccc;
    border-radius: 8px;
    background-color: #fff;
}

.login__subtitle {
    color: #555555;
    font-size: var(--font-small);
    margin: 10px 0 20px 0;
    text-align: center;
}

.login__title {
    text-align: center;
    margin-bottom: 20px;
}

.login__form button{
    width: 100%;
    margin-top: 10px;
}


/*---------------Transactions Table ---------------*/

.transactions {
    width: 100%;
    max-width: 1200px;
    background-color: #fff;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.transactions__table {
    table-layout: auto;
    width: 100%;
    border-radius: 8px;
    border-collapse: collapse;
    margin: 0;
    font-size: var(--font-normal);
}

.transactions__title {
    margin-bottom: 10px;
}

.transactions__header th {
    position: sticky;
    top: 0;
    z-index: 999;
}

.transactions__body td {
    position: relative;
    max-width: 250px;
    overflow: hidden;
    white-space: nowrap;
    font-size: var(--font-normal);
    box-sizing: border-box;
}

.transactions__table thead tr, .transactions__header th {
    background-color: var(--primary-color);
    text-align: left;
    color:#fff;
}

.transactions__header th, .transactions__body td {
    padding: 12px 15px;
    white-space: nowrap;
}

.transactions__table tbody tr {
    border-bottom: solid 1px #dddddd;
}

#transactionTable tbody tr:nth-of-type(even){
    background-color: #f3f3f3;
}


.transactions__amount{
    text-align: right;
}

.transactions__wrapper {
    position: relative;
    width: 100%;
    overflow-y: auto;
    overflow-x: auto;
    display: block;
    margin: 0;
    padding: 0;
    height: 600px;
    min-height: 200px;
}

#transactionTableBody:empty {
    display: none;
}


.transaction-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    margin-bottom: 20px;
}


/*---------------- Modal ----------------*/
.modal{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    z-index: -1;

    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.open{
    opacity: 100%;
    z-index: 9998;
}

.modal__box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal__title {
    margin-bottom: 20px;
}

.modal__actions button {
    margin-left: 10px;
}



/*-------------- Buttons ----------------*/


.button {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.button--primary {
    background-color: var(--primary-color);
    color: #fff;
}

.button--secondary {
    background-color: #aaa;
    color: black;
}


/* ------------ Inputs --------------- */

label {
    color: #888;
}

input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    outline: none;
    border: solid 1px #ccc;
    margin: 5px 0 10px 0;
    box-sizing: border-box;

}



h3 {
    font-size: var(--font-large);
}


/*---------------- Spinner -------------------*/
.spinner {
    width: 45px;
    height: 45px;
    border: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    border-top: 5px solid transparent;

    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 10000; 
    margin: 15px auto;

    transform: translate(-50%, -50%);


    display: none;
}

.spinner.show {
    display: block;
}

@keyframes spin {
   to {transform:  translate(-50%, -50%) rotate(360deg);} 
}

#spinnerOverlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}


/*----------------- Filter ----------------------*/
.filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: #fff;
    margin-bottom: 10px;
    padding: 10px;
    justify-content: space-between;
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.filters label {
    font-size: var(--font-small);
}

.filters__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    column-gap: 10px;
}


#filter {
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
}

#filter:hover {
    text-decoration: underline;
}



/*-------------- ERROR STYLES  ---------------*/
#createTransactionError, #loginError {
    color: red;
    margin-bottom: 10px;
    font-size: var(--font-small);
    max-width: 400px;
}


.negativeAmount {
    color: red;
}
.positiveAmount {
    color: green;
}


/* ----------------- BADGE STYLES -------------- */
.badge {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
    color: #fff;
    display: inline-block;
    font-weight: 600;
}

.badge--verified {
    background-color: rgb(220 252 231);
    color: rgb(22 101 52);
}
.badge--unverified {
    background-color: rgb(254 249 195);
    color: rgb(114 59 19);
}


/*----------------- Tooltip -----------------------*/

td > .tooltip {
    display: inline-block;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid dotted black;
    vertical-align: middle;
    max-width: 220px;

    position: relative;
}

.tooltip__text {
    visibility: hidden;
    width: 250px;
    word-break: break-word;
    background-color: #2F2F2F;
    color: #fff;
    text-align: center;
    z-index: 9999;
    font-size: var(--font-small);
    border-radius: 8px;
    padding: 8px 12px;
    overflow: hidden;


    position: fixed;

    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;

    opacity: 0;
    height: auto;
    display: block;

}



.tooltip:hover .tooltip__text {
  visibility: visible;
  opacity: 1;
}



/*----------------- Media queries ------------------*/
@media (max-width: 600px){
    #transactionTable th, #transactionTable td {
        padding: 8px;
        font-size: var(--font-small);
    }
    #createTransBtn {
        width: 100%;
    }
    #filter {
        border: solid 1px var(--primary-color);
        background-color: transparent;
        border-radius: 8px;
        width: 100%;
        text-align: center;
        padding: 12px 15px;
    }

    h1.protected__title {
        font-size: var(--font-large);
    }

    .filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters > div {
        display: block;
    }

    .filters__row {
        flex-direction: column;
        width: 100%;
        row-gap: 10px;
    }

    .filters__item {
        width: 100%;
        min-width: 0;
    }

    input {
        width: 100%;
    }

    .transaction-controls {
        flex-direction: column;
        row-gap: 10px;
        align-items: flex-start;
    }
}
