@import 'bottomBar';
@import 'button';
@import 'cursorSizes';
@import 'fabric-icons-inline';
@import 'imageCanvas';
@import 'sideBar';
@import 'timeline';
@import 'topBar';
@import 'dropdown';
@import 'tilePalette';
@import 'toggle';
@import 'pivot';
@import 'alert';

:root {
    // TODO : Integrate with theme
    --editor-bg-color: #1e1e1e;

    --sidebar-bg-color: #252526;
    --sidebar-header-bg-color: #3c3c3c;
    --sidebar-header-text-color: #cccccc;

    --editing-tools-bg-color: #333333;
    --sidebar-icon-inactive-color: #adadad;
    --sidebar-icon-active-color: #ffffff;
    --sidebar-label-color: #adadad;
    --input-text-color: #5d5d5d;

    --filter-panel-bg-color: #333333;
    --filter-panel-text-color: #ffffff;
    --filter-panel-label-color: #adadad;

    --navigator-viewport-color: #ff0000;
    --wall-color: #e95153;

    --map-button-bg-color: #3c3c3c;
    --map-button-icon-color: #cccccc;

    --eyedropper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cstyle type='text/css'%3E.icon-canvas-transparent%7Bopacity:0;fill:%23F6F6F6;%7D .icon-vs-out%7Bfill:%23F6F6F6;%7D .icon-vs-bg%7Bfill:%23424242;%7D%3C/style%3E%3Cpath class='icon-canvas-transparent' d='M16 15.978h-16v-16h16v16z' id='canvas'/%3E%3Cpath class='icon-vs-out' d='M15.241 4.652l-1.481 1.481.835.835-3.085 3.085-.762-.762-5.168 5.17-3.596 1.539-1.959-1.959 1.349-3.742 5.19-5.191-.645-.646 3.085-3.085.835.835 1.481-1.481c.431-.431 1-.678 1.616-.731h.461c.661.054 1.298.331 1.77.802 1.082 1.084 1.114 2.81.074 3.85z' id='outline'/%3E%3Cpath class='icon-vs-bg' d='M9.467 7.932l.612.613-5.071 5.072-2.795 1.198-1.032-1.032 1.057-2.936 5.072-5.072.585.585v.003l-4.356 4.356 1.569 1.569 4.355-4.356h.004zm4.995-6.422c-.667-.664-1.777-.729-2.435-.072l-2.188 2.189-.836-.835-.174.174-1.497 1.497 4.177 4.177 1.671-1.671-.835-.835 2.189-2.189c.658-.658.592-1.768-.072-2.435z' id='iconBg'/%3E%3C/svg%3E") 2 16, copy;
  }

.image-editor-outer {
    width: 100%;
    height: 100%;
    position: relative;
}

.image-editor-outer .image-editor-outer {
    position: absolute;
    top: 0;
}

.image-editor {
    // position: absolute;
    width: 100%;
    height: 100%;
    // top: 200px;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    background-color: var(--editor-bg-color);
}

.image-editor .image-editor {
    position: absolute;
}

.image-editor-content {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    flex-shrink: 1;
    height: 100%;
}

.image-editor-label {
    color: var(--sidebar-label-color);
    font-family: "Roboto Mono", monospace;
}

.image-editor-wrapper {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;

    border-radius: 5px;
    overflow: hidden;
}

.image-editor-region {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-editor-header {
    height: 3rem;
    background-color: #4B7BEC;
    border: 2px solid #4067b3;
    border-bottom: none;
    display: flex;
    flex-shrink: 0;
}

.image-editor-header-left,
.image-editor-header-right {
    flex: 1;
}

.image-editor-header-center {
    flex: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.image-editor-header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    & > div {
        margin-right: 0.5rem;
    }
}

.image-editor-gallery-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    flex: 6;
}

.image-editor-close-button {
    color: @white;
    font-size: 1.5rem;
    line-height: 1.5rem;
    cursor: pointer;
}

.gallery-editor-show-tiles {
    position: absolute;
    height: 2.3rem;
    top: 0.3rem;
    right: 1rem;

    border: 2px solid #4067b3;
    border-radius: 8px;
    color: #4B7BEC;
    background-color: #ffffff;
    font-family: @pageFont;
    padding-left: 1rem;
    padding-right: 1rem;
    line-height: 2.25rem;
}

.image-editor-wrapper:not(.music-asset-editor) {
    ::-webkit-scrollbar {
        width: @customScrollbarWidth;
    }

    ::-webkit-scrollbar-track {
        background: #3c3c3c;
    }

    ::-webkit-scrollbar-thumb {
        background: #adadad;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #979797;
    }
}

.gallery-filter-button {
    width: 7em;
    height: 2.25rem;
    cursor: pointer;
    display: flex;
    padding: 0 1em;
    border-radius: 5px;
    background-color: white;
    color: #4b7bec;
    align-items: center;
    user-select: none;
}

.image-editor-gallery-window {
    display: flex;
    flex-grow: 1;
}

.filter-panel-gutter {
    flex: 2;
    max-width: 22rem;
    background-color: var(--editor-bg-color);
}

.filter-panel-container {
    background-color: var(--filter-panel-bg-color);
    flex: 1;
    user-select: none;
    margin-left: 20px;
    padding: .5rem;
    height: 100%;
    overflow: auto;
}

.filter-panel {
    color: var(--filter-panel-text-color);
    margin: .5rem;
    margin-top: 0rem;
    padding: .4rem;
    padding-top: 1rem;
}

.filter-title {
    text-align: center;
    font-weight: bolder;
    font-size: 1.8rem;
    margin-top: .5rem;
    margin-bottom: 2rem;
}

.filter-subheading-row {
    color: var(--filter-panel-label-color);
    display: flex;
    justify-content: space-between;
    margin-bottom: .5rem;
    font-size: 1.1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-subheading-button {
    cursor: pointer;
}

.filter-tag-list {
    font-size: 1.2rem;
}

.filter-tag {
    display: flex;
    cursor: pointer;
}

.filter-tag-box {
    margin-right: .5rem;
}

.filter-tag-name {
    text-transform: capitalize;
}

.image-editor-gallery {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;

    margin-top: -100%;
    transition: margin 0.3s, visibility 0.3s;

    background-color: var(--editor-bg-color);
    overflow-y: scroll;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    align-content: flex-start;

    visibility: hidden;

    .asset-editor-card {
        margin: 0.2rem 0 0 0.2rem;
    }

    .asset-editor-card-icon.warning {
        display: none;
    }
}

.image-editor-gallery.visible {
    margin-top: 0;
    visibility: visible;
}

.image-editor-gallery .sprite-gallery-button {
    margin: 1px;
    border-radius: 0px;
    width: ~"calc(20% - 2px)";
    max-width: 120px;
}

.common-button.image-editor-confirm {
    display: flex;
    align-items: center;
    padding: 0 2rem;
    background-color: var(--pxt-colors-green-background);
    color: var(--pxt-colors-green-foreground);
    cursor: pointer;
    user-select: none;
    margin: 0;
    border-radius: 0;
}

.common-button.image-editor-confirm:hover {
    background-color: var(--pxt-colors-green-hover);
    color: var(--pxt-colors-green-foreground);
}

.common-button.image-editor-confirm:active {
    background-color: var(--pxt-colors-green-hover);
    color: var(--pxt-colors-green-foreground);
}

.image-editor.editing-tile {
    .image-editor-content, .image-editor-topbar, .image-editor-bottombar {
        display: none;
    }
}

:root {
    --editor-height: 31rem;
}


// Mobile Only
@media only screen and (max-width: @largestMobileScreen) {
    .gallery-editor-toggle {
        width: 10rem;
        margin-left: .25rem!important;
        flex-shrink: 1;
    }

    .gallery-editor-toggle.no-gallery {
        width: 6.5rem;
    }

    .gallery-editor-toggle.right {
        .gallery-editor-toggle-handle {
            transform: translateX(6.5rem);
        }
    }

    .gallery-editor-toggle.center {
        .gallery-editor-toggle-handle {
            transform: translateX(3.25rem);
        }
    }

    .gallery-editor-toggle.no-gallery.right {
        .gallery-editor-toggle-handle {
            transform: translateX(3.25rem);
        }
    }
}

// filter panel
// Tablet + Mobile
@media only screen and (max-width: @largestTabletScreen) {
    .filter-panel-container {
        margin: 0 0 0 0.5rem;
        padding: 0 0.5rem;
    }
    .filter-panel {
        margin: 0;
        padding: 0;
    }
    .image-editor-gallery-content {
        flex: 4;
    }

    .filter-title {
        margin-bottom: 0.5rem;
    }

    .filter-tag {
        padding-top: .5rem;
        padding-bottom: .5rem;
    }
}


// Mobile Only
@media only screen and (max-width: @largestMobileScreen) {
    .image-editor-gallery-content {
        flex: 3;
    }

    .gallery-editor-toggle {
        margin-left: .25rem;
        flex-shrink: 1;
    }

    .gallery-editor-toggle-label > span {
        display: none;
    }

    .gallery-filter-button {
        .gallery-filter-button-label {
            display: none;
        }
        display: flex;
        flex-shrink: 1;
        width: 2em;
        right: .9em;
        justify-content: center;
        padding: 0;
    }


    .filter-title {
        font-size: 1.5rem;
    }
}
