@import url('https://fonts.googleapis.com/css2?family=Encode+Sans+SC:wght@100..900&family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

@font-face {
    font-family: "Sofia Pro Light";
    src: url("fonts/Sofia Pro Light.ttf") format("opentype");
    font-weight: 200;
}

@font-face {
    font-family: "Sofia Pro Regular";
    src: url("fonts/Sofia Pro Regular.ttf") format("opentype");
    font-weight: 400;
}

@font-face {
    font-family: "Sofia Pro Medium";
    src: url("fonts/Sofia Pro Medium.ttf") format("opentype");
    font-weight: 500;
}

@font-face {
    font-family: "Sofia Pro Bold";
    src: url("fonts/Sofia Pro Bold.ttf") format("opentype");
    font-weight: 800;
}

:root {
    /*FONTS*/
    --kanit: 'Kanit', Arial, sans-serif;
    --encode: "Encode Sans SC", 'Kanit', Arial, sans-serif;
    --sofia: 'Sofia Pro Regular', Arial, sans-serif;
    --logo-font: var(--encode);
    --body-font: var(--sofia);
    --btn-font: var(--kanit);
    /*SHADOWS*/
    --shadow-light: 0px 2px 4px 0px rgba(0,0,0,0.25);
    --shadow-medium: 0px 2px 5px 0px rgba(0,0,0,0.35);
    --shadow-inset: inset 0px 4px 4px 0px rgba(0,0,0,0.25);
    --shadow-inset-light: inset 0px 4px 4px 0px rgba(0,0,0,0.15);
    /*COLOURS*/
    --clr-tealStrong: #11998e;
    /*  --clr-tealStrong: #12847B;*/
    --clr-tealDark: #11998e;
    --clr-teal: #68AFA8;
    --clr-teal30: #CADEDC;
    --clr-tealMedium: #88CCC6;
    --clr-tealLight: #c4e6e3;
    --clr-pinkDark: #e60060;
    --clr-purpleDark: #5d26c1;
    --clr-purple: #AE93E0;
    --clr-purpleMedium: #865CD1;
    --clr-purpleLight: #d6c9ef;
    --clr-red: #FF6B6F;
    --clr-redMedium: #FF9D9F;
    --clr-redLight: #FFCECF;
    --clr-subtitle: #7E7E7E;
    --grey-icon: #7E7E7E;
    --nav-bg: #F3F3F3;
    --clr-border: #CFCFCF;
    /* New branding colours set up */
    --clr-primary: var(--clr-purpleDark);
    --clr-primary-light: var(--clr-purpleLight);
    --clr-secondary: var(--clr-tealStrong);
    --clr-secondary-light: var(--clr-tealLight);
    /* borders */
    --border-radius: 10px;
}

/*************************************/
/*              Selectors            */
/*************************************/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
}

p {
    margin: 0;
    margin-top: 0;
    margin-bottom: 0;
}

a {
    color: unset;
    text-decoration: unset;
}

    a:hover {
        color: unset;
        text-decoration: unset;
    }

ul li {
    list-style-type: none;
}


h1, h2, h3, h4, h5 {
    font-family: var(--btn-font);
    font-weight: 400;
    margin-bottom: 1rem;
}

h1 {
    font-size: 32px;
}

    h1:focus-visible {
        outline: 0px;
    }

i {
    user-select: none;
}

    i.fa-trash {
        transition: color 0.2s ease;
    }

        i.fa-trash:hover {
            color: var(--clr-red);
        }

h2 {
    font-size: 28px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 21px;
}

h5 {
    font-size: 18px;
}

.user-select-none {
    user-select: none;
}

.user-select-text {
    user-select: text !important;
}

/*************************/
/*        Tables         */
/*************************/
table {
    width: 100%;
    border: 1px solid var(--clr-border);
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

thead {
    background-color: #f1f1f1;
}

th {
    padding: 5px 8px;
    border: 1px solid var(--clr-border);
}

td {
    padding: 3px 20px 3px 5px;
    border-right: 1px solid;
    border-bottom: 1px solid;
    border-color: var(--clr-border);
    white-space: nowrap;
}

tr td:first-of-type {
    border-left: 1px solid var(--clr-border);
}

tbody tr:hover {
    background-color: rgba(0,0,0,0.05)
}

.table-wrapper {
    max-width: 1100px;
}

.div-table-wrapper {
    box-shadow: var(--shadow-inset);
    overflow-x: auto;
    width: min(calc(98vw - 4rem), 1120px);
    padding-bottom: 1rem;
}

    .div-table-wrapper.no-data {
        box-shadow: none;
    }

.preview-grid-wrapper {
    width: min(calc(93vw - 5rem), 1070px);
    overflow-x: auto;
    display: grid;
}

@media (min-width:576px) {
    .preview-grid-wrapper {
        width: min(calc(93vw - 6rem), 1070px);
    }

    .div-table-wrapper {
        width: min(calc(97vw - 4rem), 1120px);
    }
}

@media (min-width:768px) {
    .preview-grid-wrapper {
        width: min(calc(93vw - 8rem), 1070px);
    }

    .div-table-wrapper {
        width: min(calc(94vw - 4rem), 1120px);
    }
}

.campaign-tab {
    height: 100%;
    padding: 0.8rem;
}

@media(min-width: 768px) {
    .campaign-tab {
        padding: 2rem;
    }
}

/*************************/
/*        Buttons        */
/*************************/

button {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--btn-font);
    border: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 5px 10px;
    user-select: none;
}

    button:active {
        transform: translateY(1px);
    }

.btn-sm {
    font-size: 13px;
    height: min-content;
    padding: 2px 6px;
    margin-bottom: 5px;
    text-transform: unset;
    font-weight: unset;
    height: min-content;
}

button.no-btn {
    border: none;
    border-radius: 0px;
    font-family: inherit;
    padding: 0;
    box-shadow: none;
    font-size: 1rem;
    margin-block: 0;
    text-transform: initial;
    letter-spacing: initial;
    background-color: unset;
    font-weight: unset;
}

button.primary, .btn-primary {
    border-radius: 5px;
    border: 1px solid #FFF;
    background: linear-gradient(186deg, #B0DDD9 2.27%, #12847B 95.35%);
    box-shadow: -1px -5px 4px 0px rgba(255, 255, 255, 0.25) inset, var(--shadow-light);
    color: white;
}


    button.primary:hover, .btn-primary:hover {
        border-color: var(--clr-secondary);
        box-shadow: -1px -5px 4px 0px rgba(255, 255, 255, 0.25) inset, 0px 0px 8px 0px rgba(0, 0, 0, 0.25);
    }

button.secondary, .btn-secondary {
    border-radius: 5px;
    border: 1px solid #E9E9E9;
    background: linear-gradient(186deg, #FFF 2.27%, #E7E7E7 95.35%);
    box-shadow: -1px -5px 4px 0px rgba(255, 255, 255, 0.25) inset, var(--shadow-light);
    color: var(--clr-secondary) !important;
}

    button.secondary:hover, .btn-secondary:hover {
        /*box-shadow: 0px 0px 8px 0px #12847B;*/
        border-color: var(--clr-secondary);
    }

button.grey, .btn-grey {
    border-radius: 5px;
    border: 1px solid #E6E6E6;
    background: linear-gradient(186deg, #FFF 2.27%, #E7E7E7 95.35%);
    box-shadow: -1px -5px 4px 0px rgba(255, 255, 255, 0.25) inset;
    color: #686868;
}

    button.grey:hover, .btn-grey:hover {
        color: black;
        border-color: black;
    }

button.cancel, .btn-cancel {
    border-radius: 5px;
    border: 1px solid #E6E6E6;
    background: linear-gradient(186deg, #FFF 2.27%, #E7E7E7 95.35%);
    box-shadow: -1px -5px 4px 0px rgba(255, 255, 255, 0.25) inset;
    color: #686868;
}

    button.cancel:hover, .btn-cancel:hover {
        color: var(--clr-red);
        border-color: var(--clr-red);
    }

button.disabled, .btn-cancel {
    border-radius: 5px;
    border: 1px solid #E6E6E6;
    background: linear-gradient(186deg, #FFF 2.27%, #E7E7E7 95.35%);
    box-shadow: -1px -5px 4px 0px rgba(255, 255, 255, 0.25) inset;
    color: var(--clr-border);
    transition: unset;
}

    button.disabled:hover, .btn-disabled:hover {
        cursor: default;
    }

input, textarea {
    border: 1px solid var(--clr-border);
    padding: 3px 8px;
    border-radius: 5px;
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25) inset;
}

    input.no-border {
        border: none;
        box-shadow: none;
    }

    input[type="file"] {
        box-shadow: var(--shadow-inset-light), var(--shadow-light);
        border-radius: var(--border-radius);
        padding: 0;
        border: 1px solid var(--clr-white);
        cursor: pointer;
    }

    input::file-selector-button {
        height: 2rem;
        padding-inline: 1rem;
        border-radius: 5px 0px 0px 5px;
        border: none;
        cursor: pointer;
        background-color: #F0F0F0;
    }

        input::file-selector-button:hover {
            background-color: #FFF1F1;
            box-shadow: none;
        }

select {
    user-select: none;
    appearance: none;
    border-radius: 5px;
    border: 1px solid var(--clr-border);
    padding: 3px 2rem 3px 8px;
    background-image: url('../images/select-icon.png');
    background-repeat: no-repeat;
    background-position: calc(100% - 3px);
    background-size: 14px;
}

*:focus-visible {
    outline-color: #C5C5C5;
}
/*************************************/
/*           Utility classes         */
/*************************************/

.bred {
    border: 1px solid red !important;
}

.max-content {
    width: max-content;
}

.white-space-nowrap {
    white-space: nowrap;
}

.cursor-pointer:hover {
    cursor: pointer;
}

.cursor-text:hover {
    cursor: text;
}

.overflow-ellipsis {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-body {
    font-size: 1rem;
    padding: 1.25rem;
}

.toast .btn-close {
    box-shadow: none;
    margin-right: 1.25rem !important;
}
/*************************************/
/*                Modals             */
/*************************************/

.Modal_wrapper {
    position: fixed;
    background-color: rgba(0,0,0,0.35);
    inset: 0 0 0 0;
    z-index: 10;
}

    .Modal_wrapper hr {
        margin: 0;
    }

.Modal_dialog {
    position: absolute;
    z-index: 11;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    background-color: white;
    font-family: var(--body-font);
    color: black;
    width: min(500px, 90vw);
    box-shadow: var(--shadow-medium);
    max-height: 80vh;
    overflow-y: auto;
}

.Modal_body, .Modal_footer {
    padding: 1rem;
}

.Modal_header {
    user-select: none;
    padding: 1rem;
    font-size: 1.4rem;
}

    .Modal_header i {
        color: rgba(0,0,0,0.4);
    }

.Modal_body {
    font-size: 1.1rem;
}

.Modal_footer {
    user-select: none;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
/*************************************/
/*              Dashboard            */
/*************************************/

.section-title {
    grid-template-columns: 1fr;
    font-family: var(--btn-font);
    border-bottom: 1px solid var(--clr-secondary);
    padding-bottom: 6px;
    align-items: center;
    gap: 10px;
}

.section-title-search {
    grid-template-columns: 1fr max-content;
}

.section-title .fa-caret-down, .section-title .fa-caret-right {
    font-size: 1.2rem;
    color: var(--clr-secondary);
    transition: transform 0.5s ease;
}

.section-title .fa-magnifying-glass {
    font-size: 1.3rem;
}

.section-title-search input[type="search"] {
    border: none;
    border-radius: 5px;
    background-color: var(--clr-lightGreyBg);
    font-family: var(--body-font);
}

    .section-title-search input[type="search"]:focus {
        outline-offset: 2px;
        outline: 1px solid var(--clr-secondary)
    }


.form-tiles-grid {
    margin-top: 1.25rem;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/*************************************/
/*              Controls             */
/*************************************/
.controls-wrapper {
    display: grid;
    grid-template-columns: max-content 1fr;
}

.controls-form-pane-wrapper {
    width: 100%;
    display: flex;
    gap: 1rem;
    border-radius: 0px 5px 0px 0px;
    border: 1px solid #CFCFCF;
    border-bottom: none;
    background: #F1F1F1;
    padding: 1rem;
    position: relative;
}

.controls-form-display-subtitle-btn {
    font-size: 0.9rem !important;
    color: var(--grey-icon);
    padding-bottom: 1rem !important;
}

.controls-type {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--clr-primary);
    color: white;
    padding: 0.5rem;
    border-radius: 0px 5px 0px 5px;
    box-shadow: var(--shadow-light);
    border-bottom: 1px solid white;
    border-left: 1px solid white;
    height: 33px;
}

    .controls-type img {
        height: 100%;
        width: auto;
    }

.controls-image {
    height: 140px;
    width: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

    .controls-image img {
        height: auto;
        width: 100%;
        object-fit: contain;
    }

.controls-form-options-bar {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 5px 10px;
    background-color: white;
    border: 1px solid #CFCFCF;
    border-radius: 0px 0px 5px 5px;
}

    .controls-form-options-bar .fa-plus-circle {
        color: var(--clr-secondary);
    }

    .controls-form-options-bar .fa-trash:hover {
        color: var(--clr-red);
    }

.controls-input {
    margin-bottom: 0.8rem;
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25) inset;
    border: none;
    border-radius: 5px;
    padding: 3px 8px;
}

.item-option .icon {
    color: var(--clr-subtitle);
    padding: 5px 6px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0);
    transition: border 0.3s ease;
}

    .item-option .icon:hover {
        border: 1px solid rgba(0,0,0,0.3);
    }

    .item-option .icon:active {
        border: 1px solid var(--clr-primary);
        color: var(--clr-primary);
    }

.item-option-img {
    height: 140px;
    width: 300px;
    overflow: hidden;
}

    .item-option-img img {
        width: 100%;
        height: auto;
    }

.branching-position-question-dropdown {
    width: 70%;
    max-width: 500px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}


.branching-position, .branching-type {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.5rem;
}

/*Respond*/
.respond-page-form-wrapper li, preview-form-wrapper li {
    user-select: none;
}

    .respond-page-form-wrapper li::marker, preview-form-wrapper li::marker {
        font-family: var(--body-font);
        font-size: 1.1rem;
        width: 2rem;
    }

.respond-question-wrapper, .preview-form-question-wrapper {
    margin-bottom: 1rem;
}

.respond-item-question, .preview-form-item-question {
    font-size: 1.1rem;
    font-family: var(--body-font);
}

.respond-item-subtitle, .preview-form-item-subtitle {
    font-size: 1rem;
    color: var(--grey-icon);
}


/*************************************/
/*              Dashboard            */
/*************************************/
/*Dashboard tiles*/

.form-tile {
    position: relative;
    border-radius: 5px;
    border: 1px solid #FFF;
    box-shadow: 0px 4px 15px 0px rgba(0, 0, 0, 0.25);
    height: 230px;
    background-size: cover;
}

.tile-information-pane {
    position: absolute;
    left: 0;
    width: 60%;
    box-shadow: 2px 0px 0px 0px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.67);
    backdrop-filter: blur(4px);
    height: 100%;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    display: grid;
}

.form-tile-options {
    padding: 10px;
    border-top: 1px solid #FFF;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52) 2.38%, rgba(255, 255, 255, 0.53) 100%);
    box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.11);
    width: 100%;
    display: flex;
    gap: 5px;
    justify-content: space-between;
}

    .form-tile-options i {
        font-size: 1.2rem;
    }

.form-tile-title {
    font-family: var(--btn-font);
    font-size: 1.3rem;
    font-weight: 400;
}

.form-tile-info {
    padding: 5px 8px;
}

.form-tile-createdby {
    padding: 8px;
    color: dimgray;
    font-family: var(--body-font);
}

/*************************************/
/*              Campaign             */
/*************************************/
.aggregates-control-question-wrapper {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: 0.8rem;
    margin-bottom: 0.8rem;
    gap: 2rem;
}

.aggregates-control-question-details {
    color: grey;
    transition: color 0.3s ease;
}

    .aggregates-control-question-details:hover {
        color: var(--clr-primary);
    }

.aggregates-control-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aggregates-control-question {
    font-family: var(--body-font);
}

.aggregates-answer-response-count-wrapper {
    user-select: none;
    background-color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    box-shadow: var(--shadow-light);
    height: max-content;
    width: 100%;
}

@media(min-width: 768px) {
    .aggregates-answer-response-count-wrapper {
        width: max-content;
        align-self: start;
    }
}

.aggregates-answer-response-count {
    font-size: 2.2rem;
    line-height: 2.2rem;
}

.aggregates-answer-response-responses {
    margin-top: 5px;
}

.chart-wrapper {
    max-width: 50vw;
    overflow-x: auto;
    margin-inline: auto;
}

@media(min-width:700px) {
    .chart-wrapper {
        max-width: 70vw;
    }
}

.aggregates-responses {
    width: 100%;
}

/***************************************/
/* Preview components - responsiveness */
/***************************************/

.question-verification-wrapper {
    flex-direction: column;
}

.data-verification-question-preview {
    width: 100%;
}

.flex-column .data-verification-question-preview {
    width: 100%;
}

.not-data-verification-question-preview {
    width: 100%;
}

@media(min-width:768px) {

    .question-verification-wrapper {
        flex-direction: row;
    }

    .data-verification-question-preview {
        width: 50%;
    }

    .flex-column .data-verification-question-preview {
        width: 100%;
    }
}
