@font-face {
    font-family: 'RNHouseSansW01Regular';
    src: url('../fonts/RNHouseSansW01Regular.woff2');
}
@font-face {
    font-family: 'RNHouseSansW01Bold';
    src: url('../fonts/RNHouseSansW01Bold.woff2');
}

:root {
    --natwest-color-main:    #5A287D;
    --natwest-color-bright:  #5E10B1;
    --natwest-color-dark:    #3C1053;
    --hover-color:           #F2EAF9;
    --hover-color-dark:      #D9CCE4;
    --hover-color-darkest:   #CDBED9;
    --background-color:      #F2F2F8;
    --background-color-dark: #d5d5d5;
    --text-color-title:      #333333;
    --text-color-main:       #646068;
    --line-color:            #CCCFD0;

    --valid-color-fail:      rgba(205, 23, 23, 1);
    --valid-color-fail-a:    rgba(205, 23, 23, 0);
    --valid-color-check:     rgba(221, 127, 16, 1);
    --valid-color-check-a:   rgba(221, 127, 16, 0);
    --valid-color-pass:      rgba(27, 137, 35, 1);
    --valid-color-pass-a:    rgba(27, 137, 35, 0);

    --header-height:         30px;
    --mainData-height:       26px;
    --extraData-height:      90px;

    --payee-load-delay:      10;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--background-color);
}

.pageContainer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pageTitle {
    font-family: 'RNHouseSansW01Bold';
    font-size: 32px;
    color: var(--text-color-title);
    margin: 10px 0 10px 0;
}


/* TODO: Remove these styles and any associated demo elements in index.html for production */
.demoOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 120px;
    background-color: white;
    border: 1px solid var(--line-color);
    box-shadow: rgba(0, 0, 0, 0.08) 0 2px 2px;
    z-index: 999;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    font-family: 'RNHouseSansW01Regular';
    font-size: 13px;
}
.demoOverlay button {
    width: 90%;
    cursor: pointer;
}
/* TODO: REMOVE TO HERE ONLY */

/* ************************************************************************** */
/* MAIN CONTAINER: All Drop Events and Payee Item interaction happens in here */
/* ************************************************************************** */

.processingContainer {
    width: 840px;
    height: 100%;
    background: var(--background-color-dark);;
    position: relative;
    border: 1px solid var(--line-color);
    border-radius: 4px;
    min-height: 200px;
    margin: 0 0 5px 0;
}
.shadow {
    position: absolute;
    left: 0;
    width: 100%;
    height: 30px;
    pointer-events: none;
}
.shadow.bottom {
    bottom: 0;
    background: linear-gradient(to bottom, rgba(137,255,241,0) 0%, rgba(0,0,0,0.15) 100%);
}
.shadow.top {
    top: 0;
    background: linear-gradient(to top, rgba(137,255,241,0) 0%, rgba(0,0,0,0.15) 100%);
}

/* ************************************************************************** */
/* DROP AREA: Handles dropping of an input file containing Payee information  */
/* ************************************************************************** */

.dropArea {
    width: 100%;
    font-family: 'RNHouseSansW01Regular';
    color: var(--text-color-main);
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.2s ease-out, border 0.2s ease-out;
    cursor: pointer;

    /* By default this element is hidden */
    height: 0;
    pointer-events: none;
    visibility: hidden;
}
.dropArea.show {
    height: 100%;
    pointer-events: auto;
    visibility: visible;
}

.dropAreaCenter {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border: 3px dashed var(--text-color-main);
    border-radius: 4px;
}
.dropAreaCenter.highlight {
    border-color: var(--natwest-color-main);
    color: var(--natwest-color-main);
}
.largeText {
    font-size: 32px;
    text-align: center;
}
.smallText {
    font-size: 20px;
    text-align: center;
    padding: 30px 0 0 0;
}

/* ************************************************************************** */
/* PAYEE CONTAINER: Once Payee items are loaded they are listed in here       */
/* ************************************************************************** */

.payeeContainer {
    width: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    position: relative;

    /* By default this elements is hidden */
    height: 0;
    pointer-events: none;
    visibility: hidden;
}
.payeeContainer.show {
    height: 100%;
    pointer-events: auto;
    visibility: visible;
}

/* ************************************************************************** */
/* PAYEE ITEMS: Contain per-payee account details and validation status/notes */
/* ************************************************************************** */

.payeeItem {
    width: 750px;
    font-family: 'RNHouseSansW01Regular';
    font-size: 16px;
    background: white;

    border-radius: 13px;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.08) 0 2px 2px;
    cursor: default;

    transition: min-height 0.2s ease-out, max-height 0.2s ease-out, margin 0.2s ease-out, opacity 0.2s ease-out;

    /* These elements are hidden by default */
    opacity: 0;
    min-height: 0;
    max-height: 0;
    margin: 0 30px;
    pointer-events: none;
    border: none;
}
.payeeItem.show {
    opacity: 1;
    min-height: calc((var(--header-height)*2) + (var(--mainData-height)*2));
    max-height: fit-content;
    margin: 30px 0 0 0;
    pointer-events: auto;
    border: 1px solid var(--line-color);
}
.payeeItem:last-child {
    margin: 30px 0;
}
.payeeItem.expanded {
    min-height: calc((var(--header-height)*2) + (var(--mainData-height)*2) + var(--extraData-height));
}

.section1 {
    width: 100%;
    display: grid;
    grid-template-columns: 180px auto;
    text-align: center;
}
.section2 {
    width: 100%;
    display: grid;
    grid-template-columns: auto 90px 160px 160px;
    text-align: center;
}

.header {
    z-index: 0;
    position: relative;
    height: var(--header-height);
    line-height: var(--header-height);
    background: var(--natwest-color-main);
    transition: background 0.2s ease-in;
    color: white;
    border-bottom: 1px solid var(--line-color);
    border-right: 1px solid var(--line-color);
}

.checkFail {
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    background: linear-gradient(90deg, var(--valid-color-fail-a), var(--valid-color-fail));
    transition: opacity 0.2s ease-in;
    /* By default these elements are hidden */
    opacity: 0;
}
.checkFail.show {
    opacity: 1;
}
.checkPass {
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    background: linear-gradient(90deg, var(--valid-color-pass-a), var(--valid-color-pass));
    transition: opacity 0.2s ease-in;
    /* By default these elements are hidden */
    opacity: 0;
}
.checkPass.show {
    opacity: 1;
}

.header.running {
    background: var(--natwest-color-bright);
}
.header.pass {
    background: var(--valid-color-pass);
}
.header.fail {
    background: var(--valid-color-fail);
}
.header.check {
    background: var(--valid-color-check);
}

.mainData {
    height: var(--mainData-height);
    line-height: var(--mainData-height);
    background: white;
    color: var(--text-color-main);
    border-bottom: 1px solid var(--line-color);
    border-right: 1px solid var(--line-color);
}
.bottomRow {
    border-bottom:0;
}
.endCol {
    border-right: 0;
}

.statusSection {
    display: grid;
    grid-template-columns: var(--mainData-height) auto;
    cursor: pointer;

    transition: background-color 0.1s ease-in, color 0.1s ease-in;
    /* Prevent text highlighting in this grid as it is used like a button */
    -webkit-user-select: none;
    user-select: none;
}
.statusSection:hover {
    background: var(--hover-color);
    color: var(--text-color-title);
}
.statusSection.expanded {
    background: var(--hover-color-dark);
    color: var(--text-color-title);
}
.statusSection.expanded:hover {
    background: var(--hover-color-darkest);
    color: var(--text-color-title);
}

.expandCircle {
    transition: transform 0.2s ease-in-out;
    transform: rotate(0deg);
}
.expandCircle.expanded {
    transform: rotate(90deg);
}

.section3 {
    width: 100%;
    text-align: center;
    transition: height 0.2s ease-out;
    overflow: hidden;
    height: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;

    background: var(--hover-color);
    color: var(--text-color-title);
    border-top: 1px solid var(--line-color);
}
.section3.expanded {
    height: var(--extraData-height);
}

.details {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 0 10px;
}

.checkSection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    padding-top: 0;
    /* This section is hidden by default */
    height: 0;
    border-top: none;
}
.checkSection.show {
    height: 30px;
    border-top: 1px solid var(--line-color);
}

.checkSection input[type="radio"] {
    transform: translateY(-2px); /* Ensure the radio buttons sit inline with labels */
    accent-color: var(--natwest-color-bright);
    cursor: pointer
}
.checkSection label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* ******************************************************************************** */
/* MAIN CONTROLS: Allows running/exporting and data filtering, shows overall status */
/* ******************************************************************************** */

.validationControls {
    position: relative;
    width: 832px;
    display: grid;
    grid-template-columns: 280px auto 190px;
    border: 1px solid var(--line-color);
    border-radius: 4px;
    padding: 4px;
    margin: 0 0 10px 0;
    background: white;
    box-shadow: rgba(0, 0, 0, 0.08) 0 2px 2px;
}

.notLoadedOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    font-family: 'RNHouseSansW01Bold';
    font-size: 60px;
    line-height: 130px;
    text-align: center;
    color: lightgray;
    -webkit-user-select: none;
    user-select: none;
    border-radius: 4px;
    transition: opacity 0.2s linear;

    /* The overlay is hidden by default */
    opacity: 0;
    pointer-events: none;
}
.notLoadedOverlay.show {
    opacity: 0.4;
    pointer-events: auto;
}

.checkBoxes {
    grid-column: 1;
    display: grid;
    grid-template-columns: auto auto auto;
}
.fileStatus {
    grid-column: 2;
    display: flex;
    flex-direction: column ;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--line-color);
    position: relative;
}
.buttons {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.validationControls p {
    font-family: 'RNHouseSansW01Bold';
    font-size: 16px;
    color: var(--text-color-title);
    margin: 0;
    -webkit-user-select: none;
    user-select: none;
}
p.mainText {
    font-family: 'RNHouseSansW01Regular';
    color: var(--text-color-main);
}
.validationControls .volume {
    font-family: 'RNHouseSansW01Bold';
    font-size: 16px;
    color: var(--text-color-main);
    text-align: center;
}

.validationControls input[type='checkbox'] {
    height: 16px;
    width: 16px;
    appearance: none;
    background-color: white;
    border: 1px solid var(--text-color-main);
    cursor: pointer;
    margin: 0 13px;

}
.validationControls input[type='checkbox']:hover {
    border: 1px solid var(--text-color-title);
}
.validationControls input[type='checkbox']:checked {
    background: var(--natwest-color-main);
}
.validationControls input[type='checkbox']:after {
    content: '✔';
    font-size: 16px;
    line-height: 16px;
    color: white;
}
.validationControls label {
    font-family: 'RNHouseSansW01Regular';
    font-size: 16px;
    color: var(--text-color-main);
    margin: 2px 0;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.validationControls label[for]:has(+ input[type="checkbox"]:hover),
.validationControls label:hover {
    color: var(--text-color-title);
}

.validationControls button {
    font-family: 'RNHouseSansW01Regular';
    font-size: 18px;
    color: white;

    height: 54px;
    border-radius: 100px;
    border: 4px solid white;
    background: var(--natwest-color-bright);
    cursor: pointer;
}
.validationControls button.disabled {
    pointer-events: none;
    background: var(--line-color);
}

.validationControls button:hover {
    background: var(--natwest-color-dark);
}
.validationControls button:focus {
    border: 2px solid var(--natwest-color-bright);
    box-shadow: inset 0 0 0 2px white;
}
.validationControls button:focus:hover {
    border: 2px solid var(--natwest-color-dark);
}

.progress-container {
    width: 90%;
    height: 10px;
    background: none;
    border: 1px solid var(--line-color);
    border-radius: 5px;
    overflow: hidden;
    position: absolute;
    bottom: 0;
}
.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--natwest-color-dark), var(--natwest-color-bright));
    background-size: 200% 100%;
    animation: progressPulse 4s infinite linear;
    transition: width 0.2s ease;
}
.progress-bar.ended {
    animation: none;
    background: var(--natwest-color-bright);
}
@keyframes progressPulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}