@import "variables";

/* MAIN */
html, body, main {
    height: 100%;
}

body {
    background: #efefef;
}

th {
    font-weight: 300;
}

/* REGISTRATION */
.registration {
    width:100%;
    height: 100%;
    display: flex;
    flex-direction:row;
    background-size: cover !important;

    .sidebar {
        align-items: center;
        align-self: flex-start;
        background: white;
        display: flex;
        flex-direction: column;
        height: 100%;
        justify-content: center;
        min-width: 400px;
        max-width: 400px;
        opacity: 0.85;
        text-align: center;

        h4 {
            font-weight: 300;
        }

        form {
            width: 90%;
        }
    }

    .logo {
        align-self: center;
        width: 100%;
        text-align: center;
        color: white;

        .logo__icon {
            font-size: 20rem;
        }
    }

    .action button {
        width: calc(100% - 3rem);
        margin-top: 1.5rem;
    }
}

@media only screen and (max-width : 600px) {
    .registration {
        .logo {
            display: none;
        }
        
        .sidebar {
            width: 100%;
        }
    }
}

/* LAYOUT */
@media only screen and (min-width : 993px) {
    html {
        overflow-y: scroll;
    }

    main, footer {
        margin-left: 300px;
    }

    nav {
        padding-left: 40px;
    }
}

.content {
    display: flex;
    max-width: 100%;
    padding-bottom: 50px;

    >.row {
        width: 100%;
    }
}

.left-panel {
    flex-basis: 80%;
    margin-left: 0.375rem;

    &.wide {
        flex-basis: 100%;
        margin-right: 0.375rem;
    }

    > .card {
        margin-bottom: 0.375rem;
    }

}

.right-panel {
    flex-basis: 20%;
    min-width: 250px;
    margin-left: 0.375rem;
    margin-right: 0.375rem;

    > .card {
        margin-bottom: 0.5rem;
    }
}

@media only screen and (max-width : 993px) {
    .left-panel {
        flex-basis: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
   
    .left-panel > .card {
        margin-top: 1px;
    }

    .right-panel {
        display: none;
    }
}

/* ALERTS */
.toast {
    justify-content: flex-start; // fix: allow links inside toast messages
}

.toast a {
    color: white;

    &.alert-success {
        background-color: #43a047;
    }

    &.alert-info {
        background-color: #0277bd;
    }

    &.alert-warning {
        background-color: #ef6c00;
        color: #fff;
    }

    &.alert-error {
        background-color: #bf360c;
    }
}

/* DEFAULT ICONS */
.admin-appicon:before {
    content: "\e8b9";
}

.admin-modelicon:before {
    content: "\e8b9";
}

/* SIDEBAR */
.side-nav.fixed {
    // managed by perfect-scrollbar
    overflow-y: hidden;

    .userView {
        min-height: 175px;
    }

    li {
        min-height: 48px;
    }

    // fix for chrome scrolling bug
    > li.last {
        padding-bottom: 58px;
    }

    .collapsible-body {
        padding: 0;

        // 2d level
        li a {
            padding-left: 70px;
        }
    }
}

/* TOPBAR */
nav.topbar {
    box-shadow: none;
    height: 54px;
    line-height: 54px;

    .brand-logo {
        font-weight: 100;
        font-size: 2.5rem;
        top: 5px;
    }

    i,
    a.button-collapse,
    a.button-collapse i {
        height: 54px;
        line-height: 54px;
    }
    .brand-logo {
        font-weight: 100;
        font-size: 2.5rem;
        top: 5px;
    }    
}

.popup nav.topbar {
    height: 64px;
}

/* BREADCRUMBS */
nav.breadcrumbs {
    height: 48px;
    line-height: 48px;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 0px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);

    a:first-child {
        padding-left: 0px;
    }

    a {
        font-size: 1rem;
        color: rgba(255,255,255,0.7)
    }

    a.active {
        color: white;
    }

    a:not(:first-child):before {
        content: '\E5CC';
        color: rgba(255,255,255,0.7);
        vertical-align: top;
        display: inline-block;
        font-family: 'Material Icons';
        font-weight: normal;
        font-style: normal;
        font-size: 20px;
        margin: 0 5px 0 4px;
        -webkit-font-smoothing: antialiased;
    }
}

@media only screen and (max-width : 992px) {
    nav.breadcrumbs {
        text-align: center;
    }
}

@media only screen and (max-width : 600px) {
    nav.breadcrumbs {
        white-space: nowrap;

        .nav-wrapper {
            width: 100%;
            overflow-x: hidden;
            padding: 0 20px 0 10px;
            text-overflow: ellipsis;
        }
    }
}

/* APP INDEX PAGE */
.app-list {
    padding: 5px;
    -webkit-column-gap: 0;
    -moz-column-gap: 0;
    column-gap: 0;
    -webkit-column-count: 3;
    -moz-column-count: 3;
    column-count: 3;

    .app {
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
        padding: 5px;

        .card {
            margin: 0px;

            .app-item {
                padding-left: 0px !important;

                i {
                    font-size: 48px;
                }

                a {
                    background: #f5f5f5;
                    color: $primary-color-light;
                    display: block;
                    border-radius: 4px;
                    padding: 30px 0px;
                    text-align: center;
                    position: relative;
                    height: 130px;
                    margin-top: 10px;
                    margin-bottom: 10px;
                    margin-right: 0px;

                    h6 {
                        overflow: hidden;
                        text-overflow: ellipsis;
                        word-wrap: break-word;
                        padding: 5px;
                    }
                }
            }
        }
    }
}

@media (max-width: 1401px) {
    .app-list {
        -webkit-column-count: 2;
        -moz-column-count: 2;
        column-count: 2;
        padding: 0px;
    }
}

@media (max-width: 600px) {
    .app-list {
        -webkit-column-count: 1;
        -moz-column-count: 1;
        column-count: 1;
        padding: 0px;
    }
}

/* CHANGE LIST PAGE */
.actions-card {
    .card-title {
        font-size: 18px;
        text-transform: uppercase;
        margin-bottom: -10px;
    }

    .card-content {
        padding: 20px;
        padding-top: 5px;
    }

    .row {
        margin-bottom: 0px;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    span.action-counter,
    span.all,
    span.question,
    span.clear {
        font-size: 12px;
    }

    .card-action {
        padding: 10px;
    }
}


.filters-card {
    overflow:initial;

    .card-title {
        font-size: 18px;
        text-transform: uppercase;
    }

    .card-content {
        padding: 20px;
        padding-top: 5px;
    }

    .row {
        margin-bottom: 0px;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    a {
        margin-right: 0;
    }


    #changelist-search-button {
        z-index:1000;
        position:absolute;
        right:15px;
        top:15px;

        i.material-icons {
            font-size: 18px;
        }
    }
}

/* DATATABLE */
.fixedHeader th {
    background: white;
}

.fixedHeader-floating {
    th:first-child,
    td:first-child {
        padding-left:24px;
    }

    .action-checkbox label {
        display: none;
    }
}

.fixedHeader-floating thead th a,
.results table thead a {
    color: black;
    font-weight: 200;
    text-transform: none;
}

.results table {
    th, td {
        vertical-align: top;
    }

    &.collapsed {
        td, th {
            vertical-align: top;
        }
    }

    thead th {
        white-space: nowrap;
    }

    tbody a {
        color: #039be5;
        text-transform: none;
    }

    &.dataTable tr.child ul li {
        white-space: normal;
    }

    tr {
        th:first-child,
        td:first-child {
            padding-left:24px;
        }

        th:last-child,
        td:last-child {
            padding-right:24px;
        }

        .action-checkbox {
            width: 50px;
        }
    }
}

.fixedHeader-floating thead i.material-icons,
.results thead i.material-icons {
    line-height: 15px;
    margin-left:-15px;
    font-size: 15px;
    position: relative;
    top: 3px;
}

@media only screen and (max-width : 992px) {
    .fixedHeader-floating thead i.material-icons,
    .results thead i.material-icons {
        display: none;
    }
}


@media only screen and (max-height : 400px) {
    .fixedHeader {
        display:none;
    }
}


/* ACTION BUTTON */
@media only screen and (max-height : 400px) {
    .fixed-action-btn {
        display:none;
    }
}

/*  CHANGE FORM */
.change-form {
    a {
        color: #039be5;
        text-transform: none;
    }

    .form-title {
        font-size: 1.5rem;
        font-weight: 200;
        margin-bottom: 10px;
        margin-top: 0px;
    }

    .errornote {
        color: #F44336;
    }

    .section {
        padding-top: 0px;
        padding-bottom: 0px;

        h5 {
            font-size: 1.2rem;
            border-bottom: 2px solid #555;
            padding-bottom: 0.5rem;
        }
    }

    .checkbox-field {
        padding-top: 15px;
        padding-bottom: 15px;

    }

    .formset-field {
        h5 {
            font-size: 1.2rem;
            border-bottom: 2px solid #555;
            padding-bottom: 0.5rem;
        }
        td {
            padding: 5px;
        }
    }

    .related-widget-wrapper {
        label.related-widget-label {
            font-size: 15px;
            color: black;
            font-weight: 200;
        }

        .related-widget-wrapper-link {
            opacity: 0.3;
        }

        .related-widget-wrapper-link:link {
            opacity: 1;
        }
    }

    .multiselect {
        .selector-chooser {
            text-align: center;
            li {
                margin-bottom: 5px;
            }
        }

        .selector-add,
        .selector-remove {
            background-color: $primary-color-light;
        }

        @media only screen and (min-width : 601px) {
            margin-bottom:40px;

            hr {
                color: #eee;
                background-color: #eee;
                height: 1px;
                border:none;
            }

            .selector-available {
                width: calc(50% - 30px);
                width: -moz-calc(50% - 30px)
            }

            .selector-available input,
            .selector-chosen input {
                margin-bottom: 0px;
            }

            .selector-available select {
                height: 120px;
            }

            .selector-chooser {
                width: 60px;
                padding-top: 40px;
            }

            .selector-chosen {
                width: calc(50% - 30px);
                width: -moz-calc(50% - 30px);

                select {
                    height: 120px;
                }
            }
        }

        @media only screen and (max-width : 600px) {
            .selector-available select {
                height: 120px;
            }
            .selector-chooser li {
                display: inline;
            }

            .selector-chooser .selector-add i,
            .selector-chooser .selector-remove i {
                transform: rotate(90deg);
                position: relative;
                top: 10px;
                left: 7px;
            }
        }
    }

    // Admin raw id select field
    .vForeignKeyRawIdAdminField+label,
    .vManyToManyRawIdAdminField+label {
        width: calc(100% - 110px);
    }

    //   Admin date field
    .input-group {
        display: table;
    }
    
    .input-group>div, .input-group input, .suffix {
        display: table-cell;
    }

    .suffix {
        padding-left: 10px;
        width:1%;
    }

    // readonly passoword
    .readonly-password-field {
        margin-top: 10px;
        margin-bottom: 10px;
        color: rgba(0, 0, 0, 0.3);

        div {
            margin-top: 10px;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.3);
        }
    }
}
