
@tailwind base;
@tailwind components;
@tailwind utilities;

@import '../ui-components/stylesheets/ff-colors.scss';
@import '../ui-components/stylesheets/ff-utility.scss';

$sidenav_width: 250px;
$transition_time: .15s;

/*
    Layout - Box
        used in login/setup/signup screens
*/

$nav_height: 60px;

.ff-layout--box {
    font-family: 'Heebo', system-ui, sans-serif;
    background-color: $ff-white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: inherit;
    background-image: url("./images/ff-bg-flow.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position-y: 0%;
    color: $ff-grey-700;
    .ff-error-inline {
        font-size: 0.875rem;;
        display: block;
        margin-top: 0.25rem;
        color: $ff-red-200;
    }

    &.ff--center-box {
        flex-direction: column;
        min-height: fit-content;
        overflow: auto;

        .ff-layout--box--wrapper {
            display: flex;
            width: 100%;
            max-height: fit-content;
            height: fit-content;

            .ff-layout--box--left,
            .ff-layout--box--right {
                width: 100%;
            }
        }
    }
}

.ff-layout--box--wrapper {
    width: calc(100% - 48px);
    height: 60%;
    display: grid;
}
.ff-layout--box--left {
    .ff-logo {
        max-width: 150px;
        margin-bottom: 16px;
    }
}
.ff-layout--box--right {
    .ff-logo {
        max-width: 200px;
        margin: auto;
        margin-bottom: 48px;
    }
}

.ff-layout--box--left,
.ff-layout--box--right {
    height: 100%;
    justify-content: center;
    align-items: center;
}

.ff-layout--box--left {
    h1 {
        max-width: 420px;
    }
    h3 {
        font-size: 1.25rem;
    }
    p {
        font-weight: 300;
        line-height: 1.5rem;
    }
}

.ff-layout--box--content {
    width: 100%;
}

.ff-layout--box--right .ff-layout--box--content {
    min-height: 400px;
    padding: 64px 24px;
    @apply rounded-xl;
    color: $ff-grey-700;
    h2 {
        margin-top: -12px;
        margin-bottom: 24px;
    }
    h5 {
        font-weight: bold;
        margin-bottom: 0.75rem;
    }
    label {
        display: block;
        color: $ff-grey-700;
        margin-bottom: 4px;
    }
    .ff-radio-btn label {
        font-weight: normal;
    }
    p {
        margin-bottom: 1rem;
    }
    a {
        color: $ff-blue-600;
    }
    .ff-input:not(.ff-input--error) {
        border-color: $ff-grey-300;
    }
    .ff-input {
        border-width: 2px;
        &:focus-within {
            border-color: $ff-indigo-600;
        }
    }
    .ff-radio-btn {
        .checkbox {
          border: 1px solid $ff-grey-400;
        }
    }

    .ff-error-inline {
        margin-bottom: 12px;
    }

    .ff-actions {
        margin-top: 18px;
    }
    .ff-btn {
        text-transform: uppercase;
        width: 100%;
        margin-bottom: 6px;
    }
    .ff-btn.ff-btn--primary {
        background-color: $ff-indigo-600;
        color: white;
        &:hover {
            background-color: $ff-indigo-700;
        }
        &:disabled {
            background-color: $ff-grey-300;
            color: $ff-grey-400;
        }
    }
    .ff-btn.ff-btn--tertiary {
        color: $ff-indigo-500;
        font-weight: normal;
        border: 1px solid transparent;
        &:hover {
            background-color: transparent;
            border-color: $ff-indigo-600;
        }
    }
}

/*
    Layout - Platform / Plain
        used in all other pages
*/

.ff-layout--platform,
.ff-layout--plain {
    min-height: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ff-layout--platform--wrapper{
    padding-top: $nav_height;
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: row;

    .ff-view {
        display: flex;
        flex-direction: column;
        position: relative;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        height: 100%;
        transition: ease-in-out margin-left .3s;
    }
    main {
        background-color: $ff-grey-50;
    }
    .ff-page-header {
        background-color: $ff-white;
        border-color: $ff-color--border;
    }
}

.ff-layout--plain--wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;

    main {
        background-color: $ff-grey-50;
        flex: 1;
    }
}

.ff-notifications {
    position: absolute;
    right: 12px;
    top: $nav_height + 12px;
    z-index: 130;
    min-width: 350px;
}

.ff-notification-toast {
    min-height: $nav_height;
    margin-bottom: $ff-unit-md;
}

.notifications-list-move,
.notifications-list-enter-active,
.notifications-list-leave-active {
    transition: all 0.3s ease;
}

.notifications-list-enter-from,
.notifications-list-leave-to {
    opacity: 0;
    transform: translateX(200px);
}

.notifications-list-leave-active {
    position: absolute;
}

.ff-team-selection {
    position: relative;
    display: flex;
    justify-content: space-between;
    min-width: $sidenav_width;
    .ff-dropdown-options {
        position: absolute;
        min-width: $sidenav_width;
        display: block;
        z-index: 10;
        border-bottom: 0;
        max-height: initial;
        &.active {
            display: block;
        }
        .ff-dropdown-option {
            padding: 0;
            border-bottom: none;
        }
    }
}
.ff-team-selection-name {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    label {
        font-size: 0.7rem;
        line-height: 0.7rem;
        color: $ff-grey-500;
        margin-left: 0;
    }
    h5 {
        color: $ff-grey-800;
        white-space: nowrap;
    }
}
.ff-team-selection > div {
    flex-grow: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    &:hover {
        label, h5 {
            color: $ff-teal-200;
        }
    }
}
.ff-banner {
    background-color: $ff-grey-800;
    color: $ff-grey-300;
    padding: 8px;
    text-align: center;
    border-bottom: 2px solid $ff-red-500;

    &.ff-banner-info {
        background-color: $ff-blue-100;
        color: $ff-grey-700;
        text-align: left;
        border-bottom: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 16px;
        padding-right: 16px;
    }

    &.ff-banner-warning {
        background-color: $ff-red-700;
        color: $ff-grey-50;
        text-align: left;
        border-bottom: 2px solid $ff-red-800;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 16px;
        padding-right: 16px;
    }
}
.ff-header {
    z-index: 110;
    background-color: $ff-white;
    height: $nav_height;
    border-bottom: 1px solid $ff-color--border;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    width: 100%;
    img.ff-logo {
        padding-top: 18px;
        padding-bottom: 18px;
        height: $nav_height;
        &:hover {
            cursor: pointer;
        }
    }
    .ff-header--mobile-toggle {
        padding: 16px;
        svg {
            fill: $ff-grey-800;
            min-width: 24px;
        }
        &.active {
            cursor: pointer;
            background-color: $ff-grey-700;
        }
    }
    .ff-header--mobile-usertoggle {
        padding: 16px;
        img {
            padding: 0;
            min-width: 24px;
        }
        &.active {
            cursor: pointer;
            background-color: $ff-grey-100;
        }
    }
    .ff-navigation {
        position: absolute;
        display: flex;
        flex-direction: column;
        top: 100%;
        //margin-top: 2px;
        img {
            padding: 0;
            margin-right: 9px;
        }
        .ff-user {
            display: flex;
            align-items: center;
            margin-left: -2px;
            position: relative;
            transition: ease-in-out .1s;
            object-fit: contain;
            will-change: transform;
            .ff-notification-pill {
                font-size: 0.65rem;
                padding: 0px 6px;
                background-color: $ff-red-600;
                border: 1px solid $ff-grey-800;
                position: absolute;
                bottom: -9px;
                line-height: 0.85rem;
                right: 0;
            }
            &:hover {
                transform: scale(1.25) translateZ(0); /* Using slight adjustments to whole values */
                backface-visibility: hidden;
                perspective: 1000px;
                stroke-width: 1.5px;
                shape-rendering: geometricPrecision;
                text-rendering: geometricPrecision;
            }
        }
    }
    .ff-border-left {
        border-width: 0 0 0 1px;
        border-color: $ff-grey-500;
    }
    .ff-navigation-right {
        height: 100%;
        ul {
            background: $ff-white;
            border: 1px solid $ff-color--border;

            .ff-nav-item {
                transition: ease-in-out .3s;
                &:hover {
                    background: $ff-grey-100;
                    label, svg {
                        color: $ff-indigo-700;
                        fill: $ff-indigo-700;
                    }
                }
            }
        }
    }
    .ff-desktop-navigation-right {
        & > * {
            position: relative;
            &:after {
                position: absolute;
                content: '';
                width: 1px;
                height: 15px;
                background: $ff-color--border;
                top: 40%;
            }
        }
    }
    .ff-mobile-navigation-right {
        img,
        button {
            cursor: pointer;
        }
    }
    .ff-dropdown {
        color: white;
        min-width: $sidenav_width;
        position: relative;
        top: 0;
        margin-top: 0;
        .ff-dropdown-selected {
            background: none;
            padding: 16px 16px 16px 24px;
            display: flex;
            flex: 1;
            justify-content: space-between;
            align-items: center;
            border: none;
            border-radius: 0;
        }
        .ff-dropdown-options {
            width: 100%;
            border-color: $ff-color--border;
            border-right: 0;

            .ff-dropdown-option {
                &:hover {
                    label, svg {
                        color: $ff-indigo-700;
                        fill: $ff-indigo-700;
                    }
                }
            }
        }
    }
    .ff-user-options {
        width: auto;
        min-width: $nav_height;

        &.ff-navigation {
            left: auto;
        }
        .ff-dropdown-options {
            width: $sidenav_width;
        }
    }
}

.ff-user-options {
    .ff-dropdown-options {
        max-height: initial;
        .ff-dropdown-option {
            border-bottom: none;

            &.danger {
                label, svg {
                    color: $ff-red-700;
                    fill: $ff-red-700;
                }
            }
        }
    }
}


.ff-navigation,
.ff-team-selection ul {
    .ff-nav-item {
        &:hover {
            cursor: pointer;
        }
    }
}

.ff-navigation .ff-nav-item {
    border-bottom: 1px solid $ff-grey-600;
    padding: 16px 16px 16px 24px;
    display: grid;
    grid-template-columns: 20px 1fr;
    svg {
        fill: $ff-grey-500;
        width: 20px;
    }
    svg.hollow {
        fill: none;
        stroke: $ff-white;
    }
    label {
        margin-left: 12px;
        color: $ff-grey-800;
        white-space: nowrap;
        pointer-events: none;
    }
}

.ff-team-selection ul .ff-nav-item {
    border-bottom: 1px solid $ff-grey-600;
    padding: 16px 16px 16px 22px;
    display: grid;
    align-items: center;
    grid-template-columns: 24px 1fr;
    height: $nav_height;
    svg {
        fill: $ff-white;
        width: 20px;
    }
    label {
        margin-left: 12px;
        color: $ff-white;
        white-space: nowrap;
        pointer-events: none;
    }
}

.ff-navigation {
    position: fixed;
    left: -$sidenav_width;
    z-index: 10;
    transition: 0.3s left, 0.3s right;
    -webkit-transition: 0.3s left, 0.3s right;
    width: $sidenav_width;
    // handle router-link active styling for primary options
    .ff-side-navigation--primary {
        width: 100%;
        transition: $transition_time width;
        -webkit-transition: $transition_time width;
        .router-link-active {
            li {
                label {
                    color: $ff-teal-300;
                }
                svg {
                    fill: $ff-teal-300;
                    &.hollow {
                        fill: none;
                        stroke: $ff-teal-300;
                    }
                }
            }
        }
    }
    // nested menu options, including router-link highlighting
    .ff-side-navigation--nested {
        width: 0;
        overflow: hidden;
        .ff-nested-title {
            color: $ff-teal-300;
            font-weight: bold;
            font-size: 1.1rem;
            padding: 12px 16px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ff-nav-item {
            padding: 12px 16px;
        }
        .router-link-active {
            li {
                background-color: $ff-grey-600;
            }
            label {
                color: $ff-teal-300;
            }
            svg {
                fill: $ff-teal-300;
                &.hollow {
                    fill: none;
                    stroke: $ff-teal-300;
                }
            }
        }
    }
    // navigation-right = the admin/user settings
    &.ff-navigation-right {
        left: initial;
        right: -$sidenav_width;
        .ff-nav-item {
            &.danger {
                label, svg {
                    color: $ff-red-700;
                    fill: $ff-red-700;
                }
            }
            &.create {
                background: $ff-grey-100;
                border-bottom: none;
            }
        }

        &.without-divider {
            .ff-nav-item:last-child {
                border-top: unset;
            }
        }
    }
    &.open {
        left: 0;
    }
    &.closed {
        left: -$sidenav_width;
    }
    &.ff-navigation-right.open {
        left: initial;
        right: 0;
    }
    .ff-navigation-divider {
        background-color: $ff-grey-900;
        color: white;
        padding: 6px 12px;
        height: 32px;
        display: block;
        font-size: 0.85rem;
        border-bottom: 1px solid $ff-grey-600;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    .ff-dropdown-options .ff-dropdown-option {
        padding: 0;
    }
    .ff-nav-item {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid $ff-color--border;
    }
    .disabled {
        pointer-events: none;
        opacity: 0.5;
    }
    .ff-notification-pill {
        padding: 2px 12px;
        background-color: $ff-red-600;
        border: 1px solid $ff-red-700;
    }
    .ff-side-navigation--options-back {
        li {
            border-top: 1px solid $ff-grey-600;
        }
    }
}

/* MOBILE LAYOUT */
@media screen and (min-width: $ff-screen-lg) {
    /* Box */
    .ff-layout--box--wrapper {
        width: 85%;
    }
    .ff-navigation {
        left: 0;
        position: relative;
    }
    .ff-header {
        .ff-header--mobile-toggle {
            display: none;
        }
        .ff-header--mobile-usertoggle,
        .ff-header--mobile-notificationstoggle {
            display: none;
        }
        img.ff-logo {
            padding: 18px;
        }
    }
}

#ff-app {
    #left-drawer {
        min-width: $sidenav_width;
        position: relative;
        transition: ease-in-out left .3s;
        height: 100%;
        z-index: 100;
        left: 0;
        background: $ff-color--context-menu;
        border-right: 1px solid $ff-color--border;
        overflow: auto;

        .ff-main-navigation {
            .ff-menu-groups {
                padding-top: 10px;

                .ff-menu-group {
                    padding: 5px;

                    .ff-group-title {
                        margin: 10px 0 15px;
                        padding: 0 10px;
                        text-transform: uppercase;
                        color: $ff-color--disabled;
                        font-size: 11px;
                    }

                    .ff-menu-entries {

                        .ff-menu-entry {
                            margin: 0 10px 5px 10px;

                            &:last-of-type {
                                margin-bottom: 0;
                            }

                            .ff-nav-item {
                                padding: 5px 10px;
                                border-radius: 5px;
                                .ff-tooltip-container {
                                    max-height: 20px;
                                }

                                & > div {
                                    gap: 5px;
                                }

                                &:hover {
                                    background: $ff-color--highlight--light;
                                }
                            }

                            .router-link-active {
                                .ff-nav-item {
                                    background: $ff-color--action;
                                    color: white;
                                }
                            }

                            .disabled {
                                .ff-nav-item {
                                    color: $ff-color--disabled;
                                    cursor: not-allowed;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    &.hidden-left-drawer {
        #left-drawer {
            left: -$sidenav_width;

            &.active {
                left: -$sidenav_width;
            }
        }
        .ff-view {
            margin-left:  -$sidenav_width;
        }
    }
}


/* CSS Media Query for Mobile */
@media screen and (max-width: 1023px) {
    #ff-app {
        #left-drawer {
            left: -$sidenav_width;
            transition: ease-in-out .3s;
            will-change: box-shadow;

            &.active {
                box-shadow: 6px 0 12px rgba(0, 0, 0, 0.2);
                left: 0;
            }
        }

        .ff-view {
            margin-left:  -$sidenav_width;
        }
    }
}
