// breakpoint
$xs: 0;
$sm: 576px;
$md: 768px;
$lg: 1024px;
$xl: 1399px;


@import 'light';
@import 'button';
@import 'table';
@import 'form';
@import 'message';
@import 'dashboard';
@import 'login';
@import 'navbar';

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: $bg;
}

a:link, a:visited {
    color: $text;
}
a.section:link, a.section:visited {
    color: $text;
}

input[type=text],
input[type=search],
input[type=tel],
input[type=url],
input[type=email],
input[type=password],
input[type=datetime],
input[type=date],
input[type=time],
select,
textarea {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    transition: all 0.30s ease-in-out;
    height: initial;
    &:focus {
        outline: none;
        box-shadow: 0 0 5px rgba($primary, 0.6);
        border-color: rgba($primary, 0.6) !important;
    }
}

input[type=checkbox] {
    $size: 16px;
    display: none !important;
    & + label {
        display: inline-flex;
        line-height: $size;
    }
    & + label:before{
        display: inline-block;
        vertical-align: middle;
        content: '';
        width: $size;
        height: $size;
        min-width: $size;
        min-height: $size;
        border-radius: 50%;
        border: 1px solid lightgrey;
        margin-right: .5rem;
    }
    &:checked + label:before {
        color: white;
        background-color: $primary;
        background-image: url('./check.svg');
        background-size: 80% 80%;
        background-position: center;
        background-repeat: no-repeat;
        border-color: $primary;
    }
}

/** when is popup **/
.popup {
    #container {
        display: initial;
        min-width: initial;
    }
    #content {
        margin-top: 0;
    }
}

#content {
    position: relative;
    margin-top: 3.5rem;
    padding: 0;
    #inner {
        & > p {
            // logout
            margin: 0;
            padding: .5rem 1rem;
            background-color: white;
            &:first-child {
                padding-top: 1rem;
                border-radius: 0.25rem 0.25rem 0 0;
            }
            &:last-child {
                padding-bottom: 1rem;
                border-radius: 0 0 0.25rem 0.25rem;
            }
        }
    }

    #content-main {
        float: initial;
        flex: 1;
        padding: 1rem;
        box-sizing: border-box;
        background-color: $box-bg;
        border-radius: $radius;
    }
}

/*********/

.delete-confirmation #inner {
    margin: -2rem 1rem 1rem;
    width: initial;
    padding: 1.5rem;
    box-sizing: border-box;
    background-color: white;
    border-radius: 0.25rem;
}
.delete-confirmation #inner p {
    color: var(--danger);
}

/* FORM BUTTONS */
/** django **/
.module {
    background-color: transparent;
    margin-bottom: 1rem;
}

// 副标题
.module caption, 
.inline-group h2 {
    background: $caption-bg;
}

// 最近动作头部
#content-related .module h2 {
    color: $text;
}

.xfull {
    width: 100% !important;
}

.toplinks {
    border: none !important;
}

/** juss **/

#container {
    display: flex;
}
#inner {
    margin-top: -3.5rem;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

// 页面主标题
#content h1 {
    //background-color: $primary;
    margin: 1rem 0 .5rem;
    font-size: 1.25rem;
    color: white;
}

// 页面头部, 包含标题和导航
#content-header {
    background-color: $primary;
    color: white;
    padding: 2rem 2rem 4.5rem;
}

// 面包蟹导航
div.breadcrumbs {
    white-space: nowrap;
    overflow: hidden;
    background-color: transparent;
    padding: 0;
    a {
        display: inline-block;
        color: rgba(255,255,255,0.75);
        margin-right: .5rem;
        &:hover {
            color: rgba(255,255,255,0.9);
        }
    }
}


/** common **/
#left_toggle {
    display: flex;
    align-items: center;
}


// 页面右上角按钮
.object-tools {
    position: absolute;
    top: 7rem;
    right: 2rem;
    text-align: right;
    &::webkit-scrollbar {
        display: none;
    }
    li {
        height: initial;
    }

    a {
        @include button-small;
        background-color: rgba(255,255,255,0.12);
        &:link, &:visited, &:hover {
            background-color: rgba(255,255,255,0.2);
        }
    }

}

#search-form {
    $height: 2.5rem;
    margin-left: 1rem;
    background: #f3f3f9;
    border-radius: $height;
    height: $height;
    line-height: $height;
    display: flex;
    align-items: center;
    padding: .5rem 1rem;
    input {
        border: none;
        background-color: transparent;
        margin-left: .25rem;
        width: 260px;
        &:focus {
            box-shadow: none;
            outline-width: 0;
        }
    }
}

.avatar {
    border-radius: 50%;
}
#user-tools2 .avatar {
    width: 45px;
    height: 45px;
    margin-left: .5rem;
    border: 3px solid rgba(black, 0.12);
}

#changelist .actions select {
    //height: initial;
}
#changelist .actions .button {
    @include button-base;
    font-size: 90%;
    height: initial;
}

form .aligned input + p.help, form .aligned textarea + p.help, form .aligned select + p.help, form .aligned input + div.help, form .aligned textarea + div.help, form .aligned select + div.help {
    padding-left: 0;
    margin-top: .25rem;
}

form .aligned ul {
    padding-left: 0;
}

.errornote {
    background: $danger;
    color: white;
    border: none;
    border-radius: .25rem;
    padding: 1rem .75rem;
}

.addlink, .changelink, .inlinechangelink {
    padding: 0;
    padding-left: 18px;
    background-position: top left;
}

.field-tree_actions {
    padding: 2px !important;
}


/** admin docs **/
.colSM {
    margin-left: 0;
    #inner {
        margin-top: -5.5rem;
        h1 {
            margin-left: 1rem;
            margin-bottom: 1rem;
        }
    }
    #content-related {
        display: none;
        float: initial;
        margin: 0;
    }
    h2 {
        background: $secondary;
        color: rgba(black, 0.8);
        font-size: 1rem;
        font-weight: bold;
    }
    #content-main {
        background-color: initial !important;
    }
    .module {
        background: white;
    }
}
//.colM {
//    #inner {
//        margin-top: -5.5rem;
//        h1 {
//            margin-bottom: 1rem;
//        }
//    }
//    #content-main {
//        background: initial !important;
//    }
//    .module {
//        background: white;
//    }
//}
