/* Import all components */
@import 'themes/default/globals/site.variables';
@import 'themes/pxt/globals/site.variables';

/* Reference import */
@import (reference) "semantic.less";

.ui.button.editortools-btn.editortools-github-btn {
    margin-left: 0.25rem;
}

/* Mobile only */
@media only screen and (max-width: @largestMobileScreen) {
    .ui.button.editortools-btn.editortools-github-btn {
        margin-left: 0;
    }
}

#githubEditor {
    background-color: var(--pxt-target-background2);
    color: var(--pxt-target-foreground2);
    overflow-x: hidden;
    overflow-y: auto;
    #githubArea {
        height: 90%;
        padding: 1rem;

        .ui.link {
            cursor: pointer;
        }

        .ui.message span.ui.link {
            margin-left: 0.25rem;
            text-decoration: underline;
        }

        .inline-help {
            margin-left: 2rem;
        }

        .ui.divider {
            margin-bottom: 5px;
        }
        .ui.section {
            margin-top: 1rem;
        }
        .ui.segment.diff {
            padding: 0;
        }

        .ui.segments {
            margin: 1rem 0;
        }

        .diffheader>span {
            font-weight: bold;
            font-size: 1.2em;
        }

        h2.header {
            font-size: 1.5rem;
        }

        .diffheader .ui.button {
            float: right;
            margin-top: -0.5em;
        }

        .ui.segment.diff svg {
            margin: 1rem;
            max-width: calc(100% - 2rem);
        }

        .ui.segments.filediff {
            background: var(--pxt-neutral-background1);
            color: var(--pxt-neutral-foreground1);
        }

        .legend > span:not(:first-child) {
            margin-left: 1.5rem;
        }

        .legend span.icon {
            width: 0.8rem;
            height: 0.8rem;
            display: inline-block;
            border-radius: 2px;
            margin-right: 0.25rem;
        }

        .legend span.added.icon {
            background: linear-gradient(45deg, orange , yellow, green, cyan, blue, violet);
        }

        .legend span.deleted.icon {
            background-color: #d0d04e;
            background-image: linear-gradient(45deg, #bbbbbb 25%, transparent 25%, transparent 75%, #bbbbbb 75%, #bbbbbb),
            linear-gradient(-45deg, #bbbbbb 25%, transparent 25%, transparent 75%, #bbbbbb 75%, #bbbbbb);
            background-size: 4px 4px;
        }

        .legend span.notchanged.icon {
            background: #d0d0d0;
        }

        .repo-branch {
            opacity: 0.5;
            cursor: pointer;
        }

        .join {
            text-align: center;
        }

        .create-pr {
            float: right;
        }

        .ui.segment {
            background-color: var(--pxt-target-background1);
            color: var(--pxt-target-foreground1);
        }
    }
}

.history-zone {
    .commit-day {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .commit-day:first-child {
        padding-top: 0;
    }

    .commit-day:last-child {
        padding-bottom: 0;
    }

    .commit-day-header {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .commit-day-label {
        font-size: 1.28571429em;
        font-weight: 700;
        margin-right: 0.5rem;
        margin-top: 0.2rem;
    }

    .commit-time {
        margin: 0.5rem 0;
        font-size: 1rem;
        line-height: 1rem;
        color: var(--pxt-neutral-alpha80);
    }

    .commit-view {
        border-top: 1px solid var(--pxt-target-stencil1);
        padding-top: 1rem;
        padding-bottom: 1rem;
        position: relative;

        .restore-button {
            position: absolute;
            right: 0;
            top: 1.5rem;
            z-index: 1;
        }
    }

    .commit-view:first-child {
        border-top: none;
    }

    .commit-view:last-child {
        padding-bottom: 0;
    }
}

// inverted style
.inverted-theme {
    #githubEditor {
        color: var(--pxt-target-background2);
        .ui.transparent.segment {
            border: 1px solid var(--pxt-header-background);
        }
        .ui.basic.button > .ui.text,
        .ui.header {
            color: var(--pxt-target-background2) !important;
        }
        .ui.items>.link.item {
            .meta, .description {
                color: var(--pxt-target-background2) !important;
            }
        }
        .diffheader {
            background: var(--pxt-header-background) !important;
        }
        table.diffview {
            .change code {
                color: var(--pxt-target-background2) !important;
            }

            .diff-added {
                background: var(--pxt-colors-green-background) !important;

                .ch-added {
                    background: var(--pxt-colors-green-hover) !important;
                }
            }

            .diff-removed {
                background: var(--pxt-colors-red-background) !important;

                .ch-removed {
                    background: var(--pxt-colors-red-hover) !important;
                }
            }

            .diff-unchanged {
                background: var(--pxt-neutral-background1) !important;
            }

            .line-a,
            .line-b {
                color: var(--pxt-neutral-background1) !important;
            }

            .diff-marker {
                background: var(--pxt-neutral-background3) !important;
                color: var(--pxt-neutral-foreground1) !important;
            }
        }
    }
}
