/* Общие стили, Reset CSS */

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

a {
    text-decoration: none;
}

button {
    border: none;
    cursor: pointer;
    background-color: transparent;
}

select, input {
    border: none;
    outline: none;
    box-shadow: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

section:focus, 
section:focus-visible, input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

select::-ms-expand {
    display: none;
}

input::-ms-expand {
    display: none;
}

input::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

input::-moz-calendar-picker-indicator {
    display: none;
    -moz-appearance: none;
}

fieldset {
    border: none;
}

body {
    height: 100vh;
    width: 100vw;
    display: grid;    

    grid-template-rows: 76px auto;
    grid-template-columns: 250px auto;
    grid-template-areas:
        "aside header"
        "aside main";
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

/* HEADER */

.header {
    grid-area: header;
    display: flex;
    padding: 17px 40px;
    justify-content: space-between;
    border-left: var(--border);
    border-bottom: var(--border);
}

.header__panel {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header__buttons {
    display: flex;
    gap: 12px;
}

.header__buttons .button--add {
    gap: 8px;
    justify-content: center;
}

.header__vidgets {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header__notifications {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

.user-vidget {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-vidget__user-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100%;
    width: 36px;
    height: 36px;
}

.user-vidget__user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-vidget__user-name {
    font: var(--semiblod-title-3);
    color: var(--dark-text);
    white-space: nowrap;
}

.user-vidget__user-role {
    font: var(--regular-text);
    color: var(--text-grey);
}

.user-vidget__drop-button {
    display: flex;
    width: 16px;
    height: 16px;
    cursor: pointer;
    transition: 0.3s ease-in-out;

    & path {
        stroke: var(--grey-icons);
    }
}

.user-vidget__drop-button--dropped {
    transform: rotate(180deg);
}

.mobile-header {
    display: none;
}

.burger-icon {
    display: none;
}

.burger-icon__label {
    display: flex;
    width: 100%;
    height: 100%;
    background-image: url(/local/templates/artamonSingInUp/assets/icons/ic-menu.svg);
    background-size: 22px;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.45s ease-in-out;
}

.burger-icon:checked + .burger-icon__label {
    transform: rotate(180deg);
    background-image: url(/local/templates/artamonSingInUp/assets/icons/ic-close/ic-close-24-white.svg);
}

/* SIDEBAR */

.sidebar {
    display: flex;
    flex-direction: column;
    grid-area: aside;
    height: 100vh;
    overflow-y: scroll;
    scrollbar-width: none;
    background-color: var(--grey-bg);
    & .user-vidget {
        display: none;
    }
}

.sidebar__logo-link {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    padding-left: 41px;
    min-height: 76px;
    background-color: var(--grey-bg);
    border-bottom: var(--border);
}

.sidebar__logo {
    width: 107px;
    height: auto;
}

.sidebar__section {
    display: flex;
    flex-direction: column;
    padding: 24px;
    cursor: pointer;
}

.sidebar__section[open] {
    gap: 16px;
}

.sidebar__section--autohight {
    flex: 1;
}

.sidebar__section-title {
    margin-left: 16px;
    font: var(--regular-subtitle);
    color: var(--text-gray-menu);
    text-transform: uppercase;
    list-style: none;
}

.sidebar__links-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border-left: var(--border);
    padding: 22px 40px;
    scrollbar-width: none;
}

@media (max-width: 768px) {
    body {
        grid-template-areas:
            "mobile-header"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: 64px 1fr;
    }
      
    .header {
        display: none;
    }

    .sidebar__logo-link {
        padding-left: 0;
        min-height: 100%;
        height: 100%;
        background-color: transparent;
        border-bottom: none;
        margin-right: auto;
        & img {
            width: 96px;
            height: auto;
        }
    }
  
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: end;
        gap: 12px;
        height: 64px;
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 0 15px;
        background-color: var(--background);
        border-bottom: var(--border);

        & .button {
            border-radius: 17px;
            width: 50px;
            height: 43px;
            justify-content: center;
            padding: 0;
        }
    }

    .sidebar {
        height: calc(100vh - 64px);
        width: 100vw;
        background-color: var(--background);
        grid-area: main;
        z-index: 90;
        transform: translateY(-120%);
        transition: transform 0.6s ease-in-out;

        & .sidebar__logo-link {
            display: none;
        };

        & .user-vidget {
            display: flex;
            justify-content: start;
            padding: 19px 15px;
            border-bottom: var(--border);
        }
        
        & .user-vidget__drop-button {
            margin-left: auto;
        }
        
        & .sidebar__section {
            padding: 15px;
        }
    }

    .mobile-header.shown-menu {
        .header__notifications,
        [data-action='btn-create-application'] {
            display: none;
        }
        
    }

    .mobile-header.shown-menu +  .sidebar {
        transform: translateY(0);
    }
  
    .main {
        overflow-y: auto;
        height: calc(100vh - 64px);
        padding: 15px;
    }
}