:root {
    --gunmetal: #002b38;
    --midnight-green: #00525b;
    --moonstone: #50a3ae;
    --mintgreen: #c2efeb;
    --baby-powder: #fcfff7;
    --sunglow: #ffc73b;
    --ganboge: #f0a202;

    --background-document: #fedf8c;

    --course-background-color-dark: var(--midnight-green);
    --course-text-color-dark: var(--mintgreen);

    --course-background-color-light: var(--gunmetal);
    --course-text-color-light: var(--baby-powder);

    --lesson-background-color-dark: var(--mintgreen);
    --lesson-text-color-dark: var(--midnight-green);

    --lesson-background-color-light: var(--moonstone);
    --lesson-text-color-light: var(--baby-powder);
}

/********** GENERAL **********/
body {
    font-family: "Roboto", sans-serif;
    font-style: normal;
    color: var(--gunmetal);
    margin: 0;
    padding: 0;
    background-color: #EEEEEE;
}

h1 {
    text-align: center;
    /*color: #333;*/
    margin-top: 20px;
}

.select-container {
    position: relative;

    select {
        width: 100%;
        height: 27px;
        font-size: 0.8em;
        padding: 5px 25px 5px 15px;
        border: 1px solid darkgray;
        border-radius: 0px;
        background-color: white;
        appearance: none;
    }

    &::after {
        content: "\25BC";
        font-size: 14px;
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
        pointer-events: none;
        color: var(--moonstone);
    }
}

.upload-indicator {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    margin: auto;

    &.show {
        display: flex;
    }

    .progress-bar-container {
        width: 100%;
        height: 15px;
        background-color: #ccc;
        border-radius: 10px;
        margin-bottom: 10px;
        position: relative;

        .progress-bar {
            position: absolute;
            border-radius: 10px;
            background-color: green;
            height: 100%;
            width: 0%;
            transition: width 0.1s ease-in-out;

            &.infinite-loading {
                width: 0;
                animation: infiniteLoad 1.5s linear infinite;
                transition: none;
            }
        }
    }
}

input[type="text"],
input[type="password"] {
    border: 1px solid darkgray;
    box-shadow: none;
    padding: 5px 15px;
}

input[type="checkbox"] {
    appearance: none;
    width: 25px;
    height: 25px;
    border: 1px solid;
    background-color: #fff;
    border: 1px solid #717171;
    cursor: pointer;
    display: inline-block;
    overflow: hidden;
    position: relative;
    border-radius: 0;
    outline: none;

    &:checked {
        background-color: var(--moonstone);

        &::after {
            content: "";
            position: absolute;
            left: 5px;
            top: -5px;
            width: 11px;
            height: 23px;
            border: solid white;
            border-width: 0 3px 3px 0;
            transform: rotate(40deg);
        }
    }
}

.table-container {
    .tabulator {
        border-radius: 10px 10px 0 0;
        overflow: hidden;

        .tabulator-col,
        .tabulator-col-content,
        .tabulator-col-title {
            cursor: default;
        }

        .tabulator-col-sorter {
            cursor: pointer;
        }

        .tabulator-col:last-child {
            border-right: 0;
        }

        .tabulator-cell {
            cursor: default;

            &.clickable-cell,
            &.tabulator-row-handle {
                cursor: pointer;
            }

            .table-cell-container {
                display: flex;
                align-items: center;
                justify-content: space-between;
                width: 100%;
                padding: 0 10px 0 5px;

                .table-error-message {
                    color: red;
                    font-size: 0.8em;
                    vertical-align: middle;
                }
            }

            .table-actions {
                display: flex;
                flex-direction: row;
                gap: 10px;

                .table-action {
                    cursor: pointer;
                    color: var(--moonstone);

                    i {
                        font-size: 30px;
                        height: 30px;
                        width: 30px;

                        &.fa-pen-to-square {
                            font-size: 24px;
                        }
                    }
                }
            }

            &:last-child {
                border-right: 0;
            }
        }
    }
}

/********** HEADER **********/

.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 20px auto;
    min-height: 85px;
    width: 640px;

    h1 {
        text-align: center;
        word-wrap: break-word;
        margin: 0;
        max-width: 400px;
    }

    h2 {
        color: #333;
        text-align: center;
        word-wrap: break-word;
        margin: 0;
        padding-top: 15px;
        max-width: 400px;
    }

    .button-container {
        display: flex;
        flex-direction: column;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .button-container {
        button {
            margin-bottom: 10px;
            width: 120px;
            height: 37px;

            &:last-child {
                margin-bottom: 0;
            }
        }
    }

    .single-button {
        position: absolute;
        right: 0;
        height: 37px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/********** PAGE TITLE **********/

.page-title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;

    .page-title-left,
    .page-title-right {
        display: flex;
        width: 200px;
        margin: 10px;
    }

    .page-title-left {
        order: 1;
        justify-content: left;
    }

    .page-title-right {
        order: 3;
        justify-content: right;
    }

    h2 {
        flex-grow: 1;
        text-align: center;
        order: 2;
    }


    .page-title-button {
        height: auto !important;
    }
}

/********** SINGLE CARD PAGE **********/

.single-card-page-container {
    margin: 40px 60px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;

    .single-card-page-title {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gunmetal);
        color: var(--sunglow);
        height: 50px;
        font-size: 1.5em;
        text-align: center;
    }

    .single-card-page-content {
        margin: 0 40px;
        padding: 25px 0;

        &.separator {
            border-top: 1px solid darkgray;
        }

        .top-container {
            display: flex;
            height: 40px;
            gap: 10px;
            margin-bottom: 20px;

            .category-select-container,
            .search-field-container {
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 10px;
                margin: 0;
            }

            .left-content {
                display: flex;
                gap: 20px;
            }

            .right-content {
                display: flex;
                gap: 20px;
                margin: auto 0 auto auto;
            }

            .red-message {
                display: inline-flex;
                align-items: center;
                width: 100%;
                justify-content: center;
                font-weight: bold;
                color: red
            }
        }

        .columns-container {
            display: flex;
            min-height: 450px;
            gap: 40px;

            &.to-size {
                min-height: initial;
            }

            .column {
                flex: 1;

                &.fit-space {
                    flex: 2;
                }
            }
        }

        .bottom-container {
            display: flex;
            flex-direction: row;
            align-items: center;
            height: 45px;
            margin-top: 20px;

            .left-content {
                display: flex;
                flex-direction: row;
                gap: 20px;
                margin: auto 0;
                flex: 1;
            }

            .right-content {
                display: flex;
                flex-direction: row;
                flex: 2;
                gap: 20px;
                justify-content: end;
                margin: auto 0;
            }
        }
    }
}

/********** LIST **********/

/*.element-list,
.parent-list-item,
.account-info,
.organization-info {
    max-width: 600px;
    margin: 20px auto;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;

    .section-header,
    .parent-list-item-header {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        border-bottom: 1px solid #eee;
        min-height: 100px;

        h3 {
            text-align: center;
            word-wrap: break-word;
            margin: 0;
            max-width: 300px;
        }

        .left-button {
            position: absolute;
            left: 0;
            width: 120px;
            height: 37px;
        }

        .button-container {
            display: flex;
            flex-direction: column;
            position: absolute;
            right: 0;

            button {
                margin: 5px 0;
                width: 120px;
                height: 37px;
            }
        }
    }

    .list-item,
    .sortable-list-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        margin: 5px 0;
        background-color: rgb(245, 245, 245);
        border-radius: 5px;

        .item-name,
        .item-name-link {
            width: 400px;
        }

        .item-name,
        .item-name-link a {
            color: #333;
            text-decoration: none;
        }

        .item-name-link a:hover,
        .item-name-link .course-name:hover {
            text-decoration: underline;
            cursor: pointer;
        }
    }

    .sortable-list-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        margin: 5px 0;
        background-color: rgb(245, 245, 245);
        border-radius: 5px;
    }

    .card-list-sortable-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 2fr));
        gap: 10px;
        padding: 10px;

        .sortable-list-card {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            height: 260px;
            padding: 10px;
            margin: 0;
            background-color: #fff;
            border-radius: 8px;
            border: 1px solid #ccc;

            &.flash-card {
                height: 235px;
            }

            .card-separator {
                width: 100%;
                border-bottom: 1px solid #eee;
                margin: 10px 0;
            }

            .card-actions {
                display: flex;
                flex-direction: column;
                gap: 10px;
                align-items: center;

                .checkbox-group {
                    display: flex;
                    flex-direction: column;
                    gap: 5px;
                    align-items: flex-start;
                    width: 100%;
                }

                .button-group {
                    display: flex;
                    justify-content: space-between;
                    gap: 10px;
                    width: 100%;

                    button {
                        width: 120px;
                        height: 37px;
                    }
                }
            }
        }
    }
}

.element-list-sortable-container {
    margin: 10px 0;
    min-height: 20px;

    .sortable-list-item,
    .parent-list-item-header {
        cursor: grab;

        &:active {
            cursor: grabbing;
        }
    }
}

.element-placeholder,
.course-placeholder {
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    max-width: 640px;
}

.procedure-placeholder {
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    margin-bottom: 10px;
}

.section-placeholder,
.system-placeholder {
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    max-width: 640px;
    margin: 20px auto;
}

.card-placeholder {
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
}*/

/********** BUTTONS **********/
button,
.button {
    display: inline-block;
    color: var(--gunmetal);
    text-align: center;
    vertical-align: middle;
    line-height: 22px;
    text-decoration: none;
    box-shadow: 0 2px 8px 2px rgba(0, 0, 0, 0.1);
    font-size: 1em;
    border: none;
    border-radius: 3px;
    padding: 10px 20px;
    cursor: pointer;

    &.green-button {
        background-color: #5cb85c;

        &:hover {
            background-color: #4cae4c;
        }
    }

    &.red-button {
        background-color: #d9534f;

        &:hover {
            background-color: #c9302c;
        }
    }

    &.blue-button {
        background-color: #007bff;

        &:hover {
            background-color: #0056b3;
        }

    }

    &.moonstone-button {
        color: white;
        background-color: var(--moonstone);
    }

    &.ganboge-button {
        color: white;
        background-color: var(--ganboge);
    }

    &.disabled {
        color: white;
        background-color: rgb(192, 192, 192);
    }
}

/********** MODAL **********/
.modal {
    display: none;
    position: fixed;
    align-content: center;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);

    &.show {
        display: block;
    }

    .modal-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 300px;
        position: relative;
        background-color: #fefefe;
        margin: 15% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
        border-radius: 5px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);

        .modal-close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            transform: translate(-50%, -50%);
            position: absolute;
            top: 15px;
            right: 0;

            &:hover,
            &:focus {
                color: #000;
                text-decoration: none;
                cursor: pointer;
            }
        }

        .modal-top-text {
            font-size: 1.2em;
            margin-bottom: 15px;
            text-align: center;
        }

        .modal-inner-content {
            display: flex;
            width: 100%;

            input {
                font-size: 1em;
                padding: 5px;
                width: 100%;
            }
        }

        .modal-bottom-button-container {
            margin-top: 15px;
        }
    }
}

/********** FORM **********/

form {
    .cover-container {
        display: flex;
        flex-direction: column;

        .image-preview {
            display: none;
            position: relative;
            width: 100%;
            max-width: 400px;
            overflow: visible;
            margin: 0 auto 0 auto;
            aspect-ratio: 3 / 2;

            &.show {
                display: inline-block;
            }

            img {
                display: block;
                width: 100%;
                height: 100%;
            }

            .remove-image-button {
                position: absolute;
                top: 10px;
                right: 10px;
                font-size: 25px;
                color: white;
                background-color: rgba(0, 0, 0, 1);
                width: 26px;
                height: 26px;
                text-align: center;
                line-height: 23px;
                border-radius: 50%;
                cursor: pointer;
                font-weight: bold;

            }
        }

        .default-cover-container {
            display: none;
            width: 100%;
            max-width: 400px;
            overflow: visible;
            margin: 0 auto 0 auto;
            aspect-ratio: 3 / 2;

            .default-cover-name {
                width: 100%;
                margin: 20px;
                font-size: 2.5rem;
                font-weight: bold;
                overflow: hidden;
            }

            &.show {
                display: flex;
            }

            &.lesson,
            &.document {
                background-color: var(--lesson-background-color-light);
                color: var(--lesson-text-color-light);
            }

            /*&.lesson,
            &.document {
                background-image: -webkit-linear-gradient(56.31deg, var(--lesson-background-color-dark) 50%, var(--lesson-background-color-light) 50%);
                color: var(--midnight-green);

                .default-cover-name {
                    background-image: linear-gradient(33.69deg, var(--lesson-text-color-dark) 50%, var(--lesson-text-color-light) 50%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                }
            }*/

            &.course {
                background-image: -webkit-linear-gradient(56.31deg, var(--course-background-color-dark) 50%, var(--course-background-color-light) 50%);
                color: var(--midnight-green);

                .default-cover-name {
                    background-image: linear-gradient(33.69deg, var(--course-text-color-dark) 50%, var(--course-text-color-light) 50%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                }
            }
        }

        .browse-button {
            width: 100%;
            max-width: 400px;
            margin: 10px auto;
        }
    }

    .info-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 400px;

        &.move-down {
            margin-top: 115px;
        }

        label {
            font-weight: bold;
        }

        .italicize {
            font-style: italic;
        }

        .separator {
            height: 18px;
        }

        .module-name-container,
        .aircraft-name-container,
        .course-name-container {
            width: 100%;

            .aircraft-name,
            .module-name,
            .course-name {
                display: none;
                align-items: center;
                height: 40px;

                &.show {
                    display: flex;
                }

                span {
                    font-size: 1.5em;
                    font-weight: bold;
                }

                i {
                    cursor: pointer;
                    margin-left: 20px;
                    color: var(--moonstone);
                    font-size: 25px;
                }
            }

            .text-input-container {
                height: 40px;
                display: none;

                &.show {
                    display: block;
                }
            }
        }

        .module-file {
            margin-top: 10px;

            .text-input-container {
                .text-input {
                    text-align: center;
                }
            }

            .browse-button {
                width: 100%;
                max-width: 400px;
                margin: 0px auto;
            }
        }

        .text-input-container {
            position: relative;

            .text-input {
                display: block;
                box-sizing: border-box;
                width: 100%;
                border: 1px solid darkgray;
                margin-bottom: 10px;
                padding: 10px 25px 10px 10px;
                font-size: 16px;
                color: var(--gunmetal);
                text-overflow: ellipsis;
            }

            .remove-text {
                display: none;
                position: absolute;
                right: 0px;
                bottom: 0px;
                color: #aaa;
                float: right;
                font-size: 28px;
                font-weight: bold;
                transform: translate(-50%, -20%);
                margin: auto;

                &.show {
                    display: block;
                }

                &:hover {
                    color: #000;
                    text-decoration: none;
                    cursor: pointer;
                }
            }
        }

        .select-container {
            &.move-down {
                margin-top: 22px;
            }

            select {
                height: 42px;
            }
        }
    }

    .double-container {
        display: flex;
        flex-direction: row;
        gap: 10px;

        .table-button-container {
            display: flex;
            flex-direction: column;
            justify-content: end;
            gap: 10px;
            margin-top: 50px;
            margin-left: auto;
        }
    }

    .input-item-container {
        display: flex;
        flex-direction: column;
        gap: 25px;
        margin-top: 32px;

        .input-item {
            display: flex;
            flex-direction: column;

            label {
                font-weight: bold;
                margin-bottom: 5px;

                .note {
                    margin-left: 5px;
                    font-weight: normal;
                    font-style: italic;
                    font-size: 0.8em;

                    &.red {
                        color: red;
                    }
                }
            }

            input[type="text"] {
                font-size: 0.8em;
            }
        }
    }
}

/********** REPORTS **********/

.report-content {
    margin-bottom: 20px;

    .report-content-user-full-name {
        font-size: 1.4em;
        font-weight: bold;
        margin-bottom: 20px;
    }

    .report-content-title {
        color: var(--gunmetal);
        font-weight: bold;
        margin-bottom: 10px;
    }

    &.overall-reports {
        .overall-reports-content {
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            background-color: #E6E6E6;
            border-radius: 5px;
            padding: 15px 0;

            .overall-reports-item {
                display: flex;
                flex-direction: column;

                .overall-reports-label {
                    margin-bottom: 10px;
                }

                .overall-reports-value {
                    margin: auto;
                    font-size: 1.3em;
                }
            }
        }
    }
}

/********** ICONS **********/

i {
    &.ulixes-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        width: 24px;
        height: 24px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;

        &.icon-add {
            background-image: url('/images/ADD300dpi.png');
            transform: translateY(2%);
        }

        &.icon-user-list {
            background-image: url('/images/USERS LIST300dpi.png');
            transform: translateY(3%);
        }

        &.icon-lesson-list {
            background-image: url('/images/LESSON LIST300dpi.png');
            transform: translateY(5%);
        }

        &.icon-course-list {
            background-image: url('/images/COURSES LIST300dpi.png');
            transform: translateY(5%);
        }

        &.icon-certifications {
            background-image: url('/images/CERTIFICATE300dpi.png');
            transform: translateY(5%);
        }

        &.icon-document-list {
            background-image: url('/images/DOCUMENTS LIST300dpi.png');
            transform: translateY(2%);
        }

        &.icon-edit {
            background-image: url('/images/EDIT300dpi.png');
            transform: translateY(-10%);
        }

        &.icon-reports {
            background-image: url('/images/REPORTS300dpi.png');
            transform: translateY(-10%);
        }

        &.icon-delete {
            background-image: url('/images/REMOVE300dpi.png');
            transform: translateY(-5%);
        }

        &.icon-account {
            background-image: url('/images/ACCOUNT300dpi.png');

            &.active {
                background-image: url('/images/ACCOUNT SELECTED300dpi.png');
            }
        }

        &.icon-logout {
            background-image: url('/images/LOGOUT300dpi.png');
        }

        &.icon-assign {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1.5px solid var(--moonstone);
            border-radius: 50%;
            font-size: 15px;
            width: 15px;
            height: 14px;
            font-style: normal;
            color: var(--moonstone);
            background-color: white;
            cursor: pointer;
            padding-top: 1px;
            transform: translateY(1px);
        }
    }
}

/*.form-container {
    max-width: 600px;
    margin: 20px auto;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

form {
    margin: 20px;


    label {
        display: block;
        margin: 10px 0 5px;
    }

    .image-preview {
        display: none;

        &.show {
            display: flex;
        }
    }

    textarea {
        box-sizing: border-box;
        resize: vertical;
        padding: 10px 5px;
        margin-bottom: 10px;
        border-style: inset;
        border-color: gray;
        resize: none;
    }

    .checkbox-group {
        margin: 10px 0;

        label {
            display: block;
            margin-bottom: 5px;
        }
    }

    input[type="text"],
    input[type="password"],
    input[type="file"],
    textarea,
    button {
        display: block;
        box-sizing: border-box;
        width: 100%;
        margin-bottom: 10px;
        padding: 10px 0;
        font-size: 16px;
    }

    select {
        display: block;
        box-sizing: border-box;
        width: 100%;
        margin-bottom: 10px;
    }

    .module-file-name-container {
        position: relative;

        .module-file {
            color: gray;
            text-overflow: ellipsis;
        }

        .remove-file {
            display: none;
            position: absolute;
            right: 0px;
            bottom: 0px;
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            transform: translate(-50%, -10%);
            margin: auto;

            &.show {
                display: block;
            }

            &:hover {
                color: #000;
                text-decoration: none;
                cursor: pointer;
            }
        }
    }

    .upload-indicator {
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
        width: 100%;
        margin: 15px auto;

        &.show {
            display: flex;
        }

        .progress-bar-container {
            width: 100%;
            height: 15px;
            background-color: #ccc;
            border-radius: 10px;
            margin-bottom: 10px;
            position: relative;

            .progress-bar {
                position: absolute;
                border-radius: 10px;
                background-color: green;
                height: 100%;
                width: 0%;
                transition: width 0.1s ease-in-out;

                &.infinite-loading {
                    width: 0;
                    animation: infiniteLoad 1.5s linear infinite;
                    transition: none;
                }
            }
        }
    }
}*/

/********** USER INFO **********/
/*.user-info-container,
.organization-info-container {
    display: grid;
    gap: 15px;
    padding: 0 20px;

    h3 {
        margin: 0 0 10px;
        font-size: 1.2rem;
        color: #333;
    }

    .info-item {
        p {
            margin: 0;
            font-size: 1rem;
            color: #666;
        }
    }

    .checkbox-item {
        display: flex;
        align-items: center;
        gap: 10px;

        h3 {
            margin: 0;
        }

        input[type="checkbox"] {
            margin-block-start: 1em;
            margin-block-end: 1em;
        }

        input[type="text"] {
            width: 200px;
            height: 25px;
            font-size: 1rem;
        }

        .deactivate-at-date {
            display: none;
        }
    }

    .input-item {
        input[type="text"] {
            width: 400px;
            height: 25px;
            font-size: 1rem;
        }

        .select-container {
            width: 400px;
        }
    }

    .save-account-button-container {
        .save-account-button {
            height: 40px;
            width: 125px;
        }
    }
}*/


@keyframes infiniteLoad {
    0% {
        left: 0%;
        right: 100%;
        width: 0%;
    }

    15% {
        left: 0%;
        right: 85%;
        width: 15%;
    }

    85% {
        right: 0%;
        left: 85%;
        width: 15%;
    }

    100% {
        left: 100%;
        right: 0%;
        width: 0%;
    }
}