@import "vars";

#tagproblem-table, #tag-table {
    td, th {
        &.problem-name {
            text-align: left;
        }

        &.problem-code, &.judge {
            white-space: nowrap;
        }

        &.problem-code {
            width: 20%;
        }

        &.problem-name {
            width: 65%;
        }

        &.judge {
            width: 15%;
        }
    }

    tr {
        transition: background-color linear 0.2s;

        &:hover {
            background: rgba($color_primary100, 0.05);
        }
    }
}

#tagproblem-table {
    .row-tag-list {
        font-size: 0.75em;
        padding-top: 1px;
        text-align: right;

        &, a {
            color: grey !important;
        }
    }
}

#problem-table {
    td, th {
        // Text columns are left-aligned
        &.problem-code, &.problem-name, &.category, &.types {
            text-align: left;
            padding: 0 1rem;
        }

        // Numeric columns are center-aligned
        &.solved, &.points, &.ac-rate, &.editorial, &.users {
            padding: 0 10px;
            white-space: nowrap;
        }

        &.problem-code {
            word-break: break-all;
        }
    }

    th a {
        color: inherit;
    }

    tr {
        transition: background-color linear 0.2s;

        &:hover {
            background: rgba($color_primary100, 0.05);
        }
    }
}

#filter-form {
    vertical-align: top;
    margin-bottom: 0.5em;
    margin-top: 0.75em;

    a {
        margin-right: 5px;
        display: inline-block;
        padding: 3px 10px;
        vertical-align: middle;
    }

    input {
        vertical-align: middle;
        margin-bottom: 0.5em;
    }

    label {
        vertical-align: middle;
    }

    .filter-form-group {
        margin-top: 5px;
    }
}

#content-right {
    &.problems {
        max-width: unset;
        padding-top: 0;
    }
}

#content-left {
    &.problems {
        flex: 3;
    }
}

#search {
    width: 100%;
    height: 2.3em;
}

label[for="category"], label[for="type"] {
    padding-bottom: 0.25em;
    display: block;
}

#category {
    margin-top: 0.5em;
    width: 100%;
}

#types {
    width: 100%;
}

// span.type-tag {
//     white-space: nowrap;
// }

ul.problem-list {
    list-style: none;
    padding-left: 1em;
    padding-right: 0.5em;

    li {
        margin-bottom: 0.5em;
    }
}

.pi-name {
    font-weight: bold;
}

.pi-name:after {
    content: " ";
}

.authors-value, .judges-value {
    padding-left: 1.5em;
    overflow-wrap: break-word;
}

.lang-name:after {
    content: ": ";
}

.lang-limit {
    margin-left: 1.5em;
}

.solved-problem-color {
    color: #44AD41;
}

.unsolved-problem-color {
    color: #DE2121;
}

.attempted-problem-color {
    color: orange;
}

.has-editorial-color {
    color: #44AD41;
}

.no-editorial-color {
    color: #DE2121;
}

.submissions-left {
    color: $color_primary100;
    font-weight: 600;
    text-align: center;
    margin-top: 0.5em;
}

.no-submissions-left {
    color: red;
}

.organization-tags {
    padding-left: 0.75em;
    vertical-align: middle;
}

.organization-tag {
    box-shadow: inset 0 -0.1em 0 rgba($color_primary100, 0.12);
    padding: 0.15em 0.3em;
    border-radius: 0.15em;
    font-weight: 600;
    margin-right: 0.45em;
    position: relative;
    background-color: $color_primary25;
    transform: translateY(+35%);
    display: inline-block;
}

.organization-tag a {
    color: $color_primary100;
}

.pdf-icon {
    position: relative;
    display: inline-block;
    font-size: 1.5em;

    .pdf-icon-logo {
        color: #d40e13;
    }

    .pdf-icon-bar {
        height: 0.2em;
        display: block;
        position: absolute;
        top: 0.3em;
        background: #d40e13;
        width: 0.6em;
        margin-left: -0.15em;
    }
}

.license {
    float: left;
    font-size: 0.85em;

    a {
        color: $color_primary50;
        text-decoration: none;
    }
}

.clarify {
    float: right;
}

#problem_submit {
    width: 100%;
    box-sizing: border-box;

    .hidden {
        display: none;
    }

    .button {
        display: inline-block !important;
        padding: 6px 12px;
    }

    .submit-bar {
        float: right;
    }

    #submit-wrapper {
        margin-top: 0.7em;

        #editor, #language {
            margin-top: 4px;
        }

        #id_language {
            width: 100%;
        }
    }

    #file_drag {
        border: 2px dashed #999;
        border-radius : 7px;
        color: #999;
        cursor: pointer;
        display: block;
        padding: 1.5em;
        text-align: center;
        transition: background 0.3s, color 0.3s;

        &:hover, &.hover {
            background: #ddd;
            border-style: solid;
            box-shadow: inset 0 3px 4px #999;
        }
    }

    .helptext {
        font-size: 13px;
        color: #999;
        border-width: 0 0 1px 0;

        &::before {
            font-family: FontAwesome;
            font-style: normal;
            font-weight: normal;
            line-height: 1;
            content: "\f05a";
            padding-right: 5px;
            font-size: 14px;
        }
    }

    .errorlist {
        background: rgba(255, 0, 0, 0.3);
        border: 3px dashed red;
        border-right: none;
        border-left: solid red;
        padding: 0 1em 0.1em 2em;
        margin: 0.3em 0 0.5em 0;
    }

    .errornote {
        border: 3px dashed #ffc000;
        border-left: solid #ffc000;
        padding: 0.7em 2em;
        margin: 0 0 8px;
        font-size: 13px !important;
        font-weight: 400;
    }

    .required th::after {
        content: "*";
        color: red;
    }
}

#language-select2 {
    &.select2-dropdown--above {
        display: flex;
        flex-direction: column-reverse;
    }

    .select2-results__message {
        white-space: nowrap
    }

    .select2-results__option {
        color: $color_problem_submit_select2 !important;
        background: $color_primary0 !important;
    }

    .select2-results__option--highlighted {
        text-decoration: underline;
    }

    .select2-results__option[aria-selected=true] {
        font-weight: bold;
        color: $color_primary100 !important;
    }

    .select2-results__option {
        padding: 4px 0px;
    }

    .select2-results__options {
        overflow-y: visible !important;
    }

    .select2-results__option {
        break-inside: avoid-column;
    }

    .select2-results {
        -webkit-columns: 10 7em;
        -moz-columns: 10 7em;
        columns: 10 7em;
        padding-left: 1.5em;
        padding-top: 0.5em;
    }

    #result-version-info {
        border-bottom: 1px solid $color_primary50;
        margin: 0px 1em;
        color: $color_problem_submit_select2;
        font-weight: 600;
        padding: 0.2em 0;
        text-align: right;
    }
}

@media (max-width: 550px) {
    #problem-table tr .users {
        display: none;
    }
}

@media (max-width: 450px) {
    #problem-table tr .ac-rate {
        display: none;
    }
}

@media (max-width: 350px) {
    #problem-table tr .category {
        display: none;
    }
}

#category, #types {
    visibility: hidden;
}

#filter-form .form-label {
    margin-top: 0.5em;
    font-style: italic;
}

#point-slider {
    margin: 30px 15px 10px;
    height: 10px;

    .noUi-handle {
        height: 20px;
        width: 16px;
        left: -8px;
    }

    .noUi-handle:before, .noUi-handle:after {
        top: 3px;
        height: 12px;
    }

    .noUi-handle:before {
        left: 5px;
    }

    .noUi-handle:after {
        left: 8px;
    }

    .noUi-tooltip {
        height: 17px;
        line-height: 13px;
        padding: 0 3px;
        font-size: 13px;
    }
}
