/* Reset styles
   ========================================================================= */
/* make the Symfony Web Toolbar look nice by neutralizing the aliasing applied
  globally by the AdminLTE template styles */
.sf-toolbarreset {
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: unset;
}

// Needed because we always add 'fa fa-' to the given icon name, so these
// styles allow to override that with icon names such as 'symfony fab'
i.fa, i.fas {
    font-family: 'Font Awesome 5 Free' !important;
}
i.fab {
    font-family: 'Font Awesome 5 Brands' !important;
}
i.far, i.fal {
    font-family: 'Font Awesome 5 Pro' !important;
}
i.fad {
    font-family: 'Font Awesome 5 Duotone' !important;
}

/* Layout
   ========================================================================= */
.main-header { grid-area: header; }
.main-sidebar { grid-area: sidebar; }
.content-wrapper { grid-area: content-wrapper; }
.content { grid-area: content; }
#sidebar-resizer-handler { grid-area: sidebar-resizer-handler; }
#content-resizer-handler { grid-area: content-resizer-handler; }
#flash-messages { grid-area: flash-messages; }

.wrapper {
    display: grid;
    grid-row-gap: 20px;
    grid-template-areas:
        "header"
        "content-wrapper"
    ;
    margin: 20px 15px;

    @media(min-width: 992px) {
        grid-template-columns: var(--sidebar-width) auto;
        grid-column-gap: 15px;
        grid-template-areas:
            "header   header"
            "sidebar  content-wrapper"
        ;
        margin-left: auto;
        margin-right: auto;
        width: calc(100% - 2 * 20px);
    }
}

body:not(.easyadmin-content-width-full) .wrapper {
    max-width: var(--body-max-width);
}
body.easyadmin-sidebar-width-compact .wrapper {
    @media(min-width: 992px) {
        grid-template-columns: 24px auto;
    }
}

.main-header {
    display: flex;
    justify-content: space-between;
    @media(min-width: 992px) {
        padding-right: 10px; // same as the width of #content-resizer-handler
    }
}
.main-header .navbar {
    display: flex;
    padding: 0;
}

.main-header #header-logo {
    font-size: 21px;
    font-weight: 600;
    line-height: 1;
    margin: 0;
}
.main-header #header-logo a {
    color: var(--text-color);
}
.main-header #header-logo img,
.main-header #header-logo svg {
    max-width: 100%;
}

#navigation-toggler {
    background: transparent;
    border: 0;
    color: var(--text-color-dark);
    cursor: pointer;
    filter: opacity(50%);
    font-size: 17px;
    margin: 0 5px 0 -5px;
    padding: 0;
    width: 24px;

    @media(min-width: 992px) {
        display: none;
    }
}

.main-sidebar {
    background: var(--body-bg);
    height: 100vh;
    left: calc(0px - 2 * 20px - var(--sidebar-width));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 15px 20px;
    position: absolute;
    top: 0;
    transition: left 0.3s;
    z-index: $zindex-modal-backdrop + 1;
    width: calc(2 * 20px + var(--sidebar-width));

    @media(min-width: 992px) {
        height: unset;
        padding: 0;
        position: static;
        width: var(--sidebar-width);
        z-index: $zindex-modal-backdrop - 1;
    }
}
body.easyadmin-mobile-sidebar-visible .main-sidebar {
    left: 0;
}

// Content bar at the top of the page (e.g. user menu)
.navbar-custom-menu .user {
    align-items: center;
    color: var(--text-color-light);
    cursor: pointer;
    display: flex;
}
.navbar-custom-menu .user-avatar {
    border-radius: 50%;
    box-shadow: 0 2px 5px 0 hsla(231, 23%, 30%, .1), 0 1px 1px 0 hsla(0, 0, 0, .07);
    font-size: 21px;
    max-height: 21px;
    max-width: 21px;
}
.navbar-custom-menu .user-name {
    margin-left: 6px;
}

.navbar-custom-menu .user.user-is-impersonated {
    color: var(--color-danger);
}

.user-details .user-details-name {
    font-size: var(--font-size-base);
    font-weight: 500;
    margin-bottom: 0;
}
.user-menu-wrapper .popover-body {
    padding: 0;
}
.user-menu-wrapper .popover-content-section {
    padding: 12px;
}
.user-menu-wrapper .popover-content-section + .popover-content-section {
    border-top: var(--border-width) var(--border-style) var(--border-color);
    padding-top: 12px;
}
.user-menu .user-action {
    display: block;
    font-size: var(--font-size-sm);
}
.user-menu .user-action + .user-action {
    margin-top: var(--font-size-sm);
}

.content-wrapper {
    display: grid;
    grid-auto-rows: max-content;
    grid-column-gap: 0;
    grid-row-gap: 0;
    grid-template-areas:
            "flash-messages           flash-messages  flash-messages"
            "sidebar-resizer-handler  content         content-resizer-handler"
    ;
    grid-template-columns: 0 auto 0;

    @media(min-width: 992px) {
        grid-template-columns: 10px auto 10px;
    }
}

.content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.resizer-handler {
    background: rgba(0, 0, 0, 0.1) center no-repeat url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" viewBox="0 0 320 512"><path fill="rgba(0, 0, 0, 0.7)" d="M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z"></path></svg>');
    cursor: col-resize;
    display: none;
    opacity: 0.15;
    transition: opacity 0.7s;

    &:hover {
        opacity: 1;
    }

    @media(min-width: 992px) {
        display: block;
    }
}
.resizer-handler-left {
    border-bottom-left-radius: var(--border-radius);
    border-top-left-radius: var(--border-radius);
}
.resizer-handler-right {
    border-bottom-right-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.content-header {
    border-bottom: var(--border-width) var(--border-style) var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 15px 17px 15px 20px;
}

// reduce the padding in 'list' pages to compensate for the height of '.global-actions'
.list .content-header {
    padding-top: 12px;
    padding-bottom: 12px;
}

.content-header-title {
    align-self: center;
    flex: 1;
}
// when contents define help, change vertical align to 'flex-start' because it looks better than 'center'
.content-header.has-content-help .content-header-title {
    align-self: flex-end;
}
.content-header-title .title {
    font-size: var(--font-size-lg);
    line-height: 24px;
    margin: 0;
}

.content-header .global-actions {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-left: 10px;
}

.global-actions .btn {
    margin-left: 15px;
}

.batch-actions form {
    display: flex;
}
.batch-actions .btn {
    margin-left: 15px;
}

.form-action-search .form-group {
    margin: 0;
    padding: 0;
}

.form-action-search input[type="search"].form-control {
    background-color: var(--white);
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="%23aaa" d="M1216 832q0-185-131.5-316.5t-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5 316.5-131.5 131.5-316.5zm512 832q0 52-38 90t-90 38q-54 0-90-38l-343-342q-179 124-399 124-143 0-273.5-55.5t-225-150-150-225-55.5-273.5 55.5-273.5 150-225 225-150 273.5-55.5 273.5 55.5 225 150 150 225 55.5 273.5q0 220-124 399l343 343q37 37 37 90z"/></svg>');
    background-repeat: no-repeat;
    background-size: 13px 13px;
    background-position: 10px 8px;
    padding-left: 32px;
    width: 300px;
}

.content-header-help {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: 12px;
}

.content-footer {
    background: var(--white);
    border-top: var(--border-width) var(--border-style) var(--border-color);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    padding: 15px 20px;
}

.content-body form {
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.content-body table {
    margin-bottom: 0;
}

form .content-footer {
    margin: 20px -20px -18px;
}

.list-pagination {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.pager ul {
    margin-bottom: 0;
}
.pager .page-item:first-child {
    transform: translateX(1px);
}
.pager .page-item {
    position: relative;
    z-index: 1;
}
.pager .page-item:hover {
    z-index: 2;
}
.pager .page-item.disabled {
    cursor: not-allowed;
    z-index: 0;
}
.pager .page-item i {
    vertical-align: middle;
}

/* Modal for delete action */
.modal-body h4 {
    font-size: var(--font-size-lg);
}

.modal-footer {
    background: var(--white);
}

// Boolean labels (not switches/toggles)
.boolean .label {
    display: inline-block;
    min-width: 33px;
}

body.show .form-horizontal {
    background: var(--form-bg);
}

body.show .form-horizontal .control-label {
    padding-top: 0;
}

body.show .form-control {
    border: var(--border-width) var(--border-style) var(--border-color);
    box-shadow: none;
    height: auto;
    min-height: 30px;
    padding: 4px 7px 5px;
}

body.show .field-integer .form-widget,
body.show .field-float .form-widget,
body.show .field-boolean .form-widget {
    max-width: 100px;
}

body.show .field-date .form-widget,
body.show .field-time .form-widget,
body.show .field-datetime .form-widget {
    max-width: 250px;
}

body.show .field-string .form-widget {
    max-width: 450px;
}

body.show .field-text .form-widget,
body.show .field-association .form-widget {
    max-width: 550px;
}

body.show .field-simple_array ul,
body.show .field-association ul {
    margin: 5px;
    padding-left: 15px;
}

body.show .field-text .form-widget {
    max-height: 250px;
    overflow-y: auto;
}

body.show .field-text .form-widget .form-control {
    min-height: 60px;
}

body.show .field-avatar .image-avatar {
    border-radius: 50%;
    border: 0;
    box-shadow: none;
}

// Flash messages
#flash-messages {
    @media(min-width: 992px) {
        // needed to compensate the content resizer handlers
        margin-left: 10px;
        margin-right: 10px;
    }
}
.alert {
    box-shadow: var(--box-shadow-lg);
    margin-bottom: 15px;
    padding-right: 48px;
    position: relative;
}
.alert .alert-close {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    line-height:1;
    opacity: 0.5;
    padding: 0 3px;
    position: absolute;
    right: 13px;
    top: 9px;
}
