@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --background: #f2f3f7;
    --background-opacity: rgba(242, 243, 247, 0.25);
    --block-color: #ffffff;
    --text-color: #202427;

    --success-color: #51DCBE;
    --warning-color: #FFA200;
    --error-color: #FF3E6C;
    --accent-color: #45B0E5;

    --blue-gradient: linear-gradient(90deg, rgba(69, 176, 229, 1) 0%, rgba(84, 133, 229, 1) 100%);
    --success-gradient: linear-gradient(90deg, rgba(81, 220, 190, 1) 0%, rgba(69, 197, 128, 1) 100%);
    --warning-gradient: linear-gradient(90deg, rgba(255, 162, 0, 1) 0%, rgba(255, 196, 64, 1) 100%);
    --error-gradient: linear-gradient(90deg, rgba(255, 62, 108, 1) 0%, rgba(238, 77, 77, 1) 100%);

    --shadow: 9px 9px 16px 0px rgba(166, 171, 189, 0.4), -9px -9px 16px 0px rgba(250, 251, 255, 1);
    --shadow-inset: 0 1.5px 1.5px .3px rgba(166, 171, 189, 0.4) inset, 0 -1.5px 1.5px .3px rgba(166, 171, 189, 0.4) inset;
}

[data-theme="dark"] {
    --background: #2b2c30;
    --background-opacity: rgba(43, 44, 48, 0.25);
    --block-color: #202427;

    --text-color: #ffffff;

    --shadow: 9px 9px 16px 0px rgb(32, 32, 32, 0.4), -9px -9px 16px 0px rgb(53, 53, 53);
    --shadow-inset: 0 1.5px 1.5px .3px rgb(32, 32, 32, 0.4) inset, 0 -1.5px 1.5px .3px rgb(32, 32, 32, 0.4) inset;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: "Montserrat", serif;
    color: var(--text-color);
    scrollbar-width: none;
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 0;
}


a {
    text-decoration: none;
}

li {
    list-style: none;
}

/*  Кнопка  */
.btn {
    background: var(--block-color);
    border: none;
    border-radius: 50px;
    width: max-content;
    padding: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
    position: relative;
    font-family: inherit;

    &.deactivate {
        pointer-events: none;
        cursor: default;
        opacity: .5;
    }
}

.btn:hover {
    transform: scale(1.1);
    background: var(--block-color);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: scale(0.95);
}

/*  Чекбокс  */
.checkbox {
    width: max-content;
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: .2rem;
    cursor: pointer;

    & input[type=checkbox] {
        appearance: none;
        -webkit-appearance: none;
        width: 3rem;
        height: 1.3rem;
        background: var(--block-color);
        border-radius: 3.125rem;
        transition: all .2s ease-in-out;
        -webkit-box-shadow: var(--shadow-inset);
        -moz-box-shadow: var(--shadow-inset);
        box-shadow: var(--shadow-inset);
        position: relative;


        &:checked {
            background: var(--accent-color);
        }

        &:hover {
            cursor: pointer;
        }

        &:disabled {
            cursor: not-allowed;
            opacity: 50%;
        }
    }

    & input[type=checkbox]:before {
        content: "";
        width: 1.1rem;
        aspect-ratio: 1;
        margin: .1rem .15rem;
        border-radius: 2.925em;
        background: var(--background);
        position: absolute;
        display: flex;
        justify-content: center;
        align-items: center;
        left: 0;
        transition: all .4s ease-in-out;
    }

    & input[type=checkbox]:checked:before {
        background: var(--block-color);
        left: calc(3rem - 1.1rem - .3rem);
    }

    & input[type=checkbox]:after {
        content: "⨉";
        position: absolute;
        width: 1.1rem;
        text-align: center;
        color: var(--accent-color);
        z-index: 2;
        left: .1rem;
        top: .09rem;
        transition: all .4s ease-in-out;
    }

    & input[type=checkbox]:checked:after {
        content: "✓";
        color: var(--text-color);
        left: calc(3rem - 1.25rem);
    }

    &[data-pos=vertical] {
        flex-direction: row;
    }

    &[data-pos=vertical_revers] {
        flex-direction: row-reverse;
    }

    &[data-pos=horizontal] {
        flex-direction: column;
    }

    &[data-pos=horizontal_revers] {
        flex-direction: column-reverse;
    }
}


body {
    display: grid;
    grid-template-columns: clamp(13.75rem, 12.75rem + 5vw, 18.75rem) auto;
    grid-template-rows: 3.75em auto;
    background: var(--background);
    width: min(1920px, 100%);
    height: 100%;
    padding: .75rem;
    position: relative;
    margin: 0 auto;

    & header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 3.75em;
        position: sticky;
        top: 0;
        z-index: 9;
        background: var(--background-opacity);
        backdrop-filter: blur(15px);
        grid-area: 1 / 2 / 2 / 3;
        padding: 0 calc(clamp(1rem, -0.05rem + 5.25vw, 6.25rem) - 1.5rem);
        margin: 0 1.5rem;

        h2 {
            font-size: clamp(1rem, 0.8rem + 1vw, 2rem);
        }

        ul {
            display: flex;
            gap: clamp(0.2rem, 0.04rem + 0.8vw, 1rem);
            font-size: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);
        }

        .theme-toggle {
            background: var(--background);
            border: none;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.5s ease;
            position: relative;
            overflow: hidden;
        }

        .theme-toggle:hover {
            transform: scale(1.1);
            background: var(--block-color);
            box-shadow: var(--shadow);
        }

        .theme-toggle:active {
            transform: scale(0.95);
        }

        .theme-toggle__icon {
            font-size: 1.5rem;
            color: var(--text-color);
            transition: transform 0.5s ease, color 0.5s ease;
        }


        .theme-toggle[data-theme="dark"] .theme-toggle__icon {
            transform: rotate(360deg);
        }


        .theme-toggle::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 300%;
            height: 300%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
            transform: translate(-50%, -50%) scale(0);
            transition: transform 0.5s ease;
            pointer-events: none;
        }

        .theme-toggle:active::before {
            transform: translate(-50%, -50%) scale(1);
            opacity: 0;
        }
    }

    & .nav {
        background: var(--block-color);
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: column;
        padding: 1em;
        box-shadow: var(--shadow);
        border-radius: .75em;
        position: sticky;
        top: .75rem;
        height: calc(100svh - 1.5rem);
        grid-area: 1 / 1 / 3 / 2;

        h2 {
            a {

                background: var(--blue-gradient);
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
            }

            width: 100%;
            text-align: center;
            margin-bottom: 2em;
        }

        ul {
            width: 100%;
            padding: 1em .5em;
            display: flex;
            gap: .25em;
            flex-direction: column;
            font-size: clamp(0.75rem, 0.65rem + 0.5vw, 1.25rem);

            a {
                padding: .5em .5em;
                border-radius: .25em;
                cursor: pointer;
                display: block;

                & i {
                    width: 2rem;
                    text-align: center;
                }
            }

            a:hover, .active {
                background: var(--background);
            }
        }

        .ad_block {
            margin-top: auto;
            width: 100%;
            height: 60%;
            border-radius: .25em;
            border: dashed var(--warning-color);
        }

        p {
            margin-top: .5em;
            font-size: clamp(0.625rem, 0.575rem + 0.25vw, 0.875rem);
            color: var(--background);
        }
    }

    & .nav_mobile {
        display: none;
    }

    & .content {
        padding: 0 clamp(0.55rem, -0.59rem + 5.7vw, 6.25rem);
        min-height: calc(100svh - 60px - 68px - .25rem);
    }
}

table {
    width: 100%;
    border: none;
    margin-bottom: 1rem;
    overflow-y: scroll;

    thead th {
        font-weight: bold;
        text-align: left;
        border: none;
        padding: clamp(0.313rem, 0.25rem + 0.31vw, 0.625rem) clamp(0.438rem, 0.338rem + 0.5vw, 0.938rem);
        background: var(--accent-color);
        font-size: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);
        cursor: default;
    }

    thead tr th:first-child {
        border-radius: 8px 0 0 8px;
    }

    thead tr th:last-child {
        border-radius: 0 8px 8px 0;
    }

    tbody td {
        text-align: left;
        border: none;
        padding: clamp(0.313rem, 0.25rem + 0.31vw, 0.625rem) clamp(0.438rem, 0.338rem + 0.5vw, 0.938rem);
        font-size: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);
        vertical-align: top;
        width: max-content;

        &.info, &.completed {
            color: var(--success-color);
        }

        &.warning, &.working {
            color: var(--warning-color);
        }

        &.error, &.canceled {
            color: var(--error-color);
        }

        a {
            color: var(--success-color);

            &:hover {
                text-decoration: underline;
            }
        }
    }

    tbody tr:nth-child(even) {
        background: var(--background);
    }

    tbody tr td:first-child {
        border-radius: 8px 0 0 8px;
    }

    tbody tr td:last-child {
        border-radius: 0 8px 8px 0;
    }
}

.container {
    grid-area: 2 / 2 / 3 / 3;

    .title {
        margin-bottom: 1em;
        font-size: clamp(0.875rem, 0.75rem + 0.63vw, 1.5rem);
    }

    a.block:hover {
        transform: scale(1.02) !important;
        z-index: 2;
    }

    .block {
        background: var(--block-color);
        box-shadow: var(--shadow);
        border-radius: 1em;
        padding: clamp(0.75rem, 0.6rem + 0.75vw, 1.5rem);
        transition: transform .2s ease-in-out;
        width: 100%;

        h3 {
            font-size: clamp(0.875rem, 0.75rem + 0.63vw, 1.5rem);
            font-weight: normal;
        }

        &.disabled {
            opacity: .5;
        }
    }

    .stats {
        display: grid;
        grid-template-columns: repeat(3, 32%);
        grid-template-rows: repeat(2, 250px);
        grid-gap: 1em;
        margin-bottom: 1em;;


        .number_block {
            position: relative;

            h3 {
                display: flex;
                justify-content: space-between;
                align-items: center;
            }

            p {
                position: absolute;
                bottom: 1.5rem;
                right: 1.5rem;
                font-size: clamp(1.5rem, 1.275rem + 1.13vw, 2.625rem);
                font-weight: bold;
            }
        }

        .graf_block {
            display: flex;
            flex-direction: column;
            justify-content: space-around;

            h3 {
                display: flex;
                justify-content: space-between;
                align-items: center;
            }

            p {
                font-size: clamp(1.5rem, 1.275rem + 1.13vw, 2.625rem);
                font-weight: bold;

                &.plus {
                    color: var(--success-color);
                }

                &.minus {
                    color: var(--error-color);
                }
            }
        }

        :nth-child(1) {
            grid-area: 1 / 1 / 2 / 2;
        }

        :nth-child(2) {
            grid-area: 1 / 2 / 2 / 3;
        }

        :nth-child(3) {
            grid-area: 2 / 1 / 3 / 3;
        }

        :nth-child(4) {
            grid-area: 1 / 3 / 3 / 4;
        }
    }
}

/*Group Pages*/
.group_page {
    .group_block {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 1rem;

    }

    .title {
        padding-top: 4rem;
        margin-top: -2rem;
        overflow: hidden;
    }

    table {
        margin-top: 1rem;
    }

    .schedules {
        display: flex;
        width: 100%;
        min-width: 0;
        gap: 2rem;

        & table {
            & thead {
                & tr:first-child {
                    & th {
                        border-radius: .5rem .5rem 0 0;
                        text-align: center;
                    }
                }

                & tr:last-child {
                    & th:first-child {
                        border-radius: 0 0 0 .5rem;
                        text-align: center;
                    }

                    & th:last-child {
                        border-radius: 0 0 .5rem 0;
                        text-align: left;

                        & span {
                            float: right;
                        }

                    }
                }
            }

            & tbody {
                & tr {
                    & td:first-child {
                        width: 2rem;
                        vertical-align: middle;
                        text-align: center;
                    }

                    & td {
                        & span {
                            float: right;
                        }
                    }
                }
            }
        }
    }
}

.log_table {
    td {
        span.working {
            color: var(--warning-color);
        }

        span.completed {
            color: var(--success-color);
        }

        span.canceled {
            color: var(--error-color);
        }
    }
}

.pagination {
    margin-top: 1rem;
    display: flex;
    width: 100%;
    justify-content: center;
    align-content: center;
    gap: 1rem;

    .btn {
        background: var(--background);
    }
}

/*User Page*/
.users_page, .logs_page {
    .block {
        margin-top: 1rem;
    }
}

/*User Profile Page*/
.user_profile_page {
    display: grid;
    grid-template-columns: 225px auto;
    grid-template-rows: 200px 50px 25px auto;
    margin-top: 1rem;
    position: relative;

    .banner {
        width: 100%;
        height: 200px;
        grid-area: 1 / 1 / 2 / 3;
        border-radius: 1rem;
        box-shadow: var(--shadow);
    }

    .avatar {
        grid-area: 2 / 1 / 4 / 2;
        margin-left: 50px;
        width: clamp(6.25rem, 5.313rem + 4.69vw, 10.938rem);
        aspect-ratio: 1;
        border-radius: 50%;
        position: absolute;
        bottom: -2rem;
        border: .5rem solid var(--background);
        background: var(--background);

        &.premium {
            border: clamp(0.1rem, 0.02rem + 0.4vw, 0.5rem) solid var(--accent-color);
        }
    }

    .name {
        grid-area: 2 / 2 / 3 / 3;
        margin-left: 50px;
        align-content: center;

        & i {
            float: right;
            margin-right: 1rem;
            font-weight: lighter;
            font-size: clamp(0.75rem, 0.65rem + 0.5vw, 1.25rem);
        }
    }

    .username {
        grid-area: 3 / 2 / 4 / 3;
        margin-left: 60px;
        align-content: center;
    }

    .user_info {
        width: 100%;
        display: block;
        grid-area: 4 / 1 / 5 / 3;
        margin-top: 2.5rem;
        min-width: 0;

        & .title:not(:first-child) {
            margin-top: 1.5rem;
        }

        & .ideas_wrapper {
            width: 100%;
            overflow: hidden;
            min-width: 0;

            & .ideas {
                display: flex;
                overflow-x: auto;
                gap: 1rem;
                flex-wrap: nowrap;

                & .idea {
                    min-width: 0;
                    overflow: hidden;
                    display: block;
                    position: relative;

                    & span {
                        width: 100%;
                        margin: 0;
                        text-wrap: balance;
                    }

                    & i {
                        display: flex;
                        gap: 1rem;
                        position: absolute;
                        right: .5rem;
                        bottom: .5rem;
                        font-size: clamp(0.5rem, 0.425rem + 0.38vw, 0.875rem);

                        & p {
                            &.working {
                                color: var(--warning-color);
                            }

                            &.completed {
                                color: var(--success-color);
                            }

                            &.canceled {
                                color: var(--error-color);
                            }
                        }

                        & p:last-child {
                            color: var(--text-color);
                        }
                    }
                }
            }
        }

        & .idea {
            flex: 0 0 clamp(18.75em, 15.625em + 15.63vw, 34.375em);
            flex-shrink: 0;
            box-shadow: none;
        }

        & .ideas {
            font-size: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);

            & span {
                display: block;
                width: max-content;
                margin: 0 auto;
            }
        }
    }
}

.mailing_page {
    margin-top: 1rem;

    label {
        textarea {
            width: 100%;
            resize: none;
            padding: .5rem;
            border-radius: 1rem;
            background: var(--background);
            font-family: inherit;
            border: none;
            outline: none;
            transition: all .2s ease-in-out;

            &:active, &:focus, &:hover {
                box-shadow: var(--shadow);
            }
        }
    }

    .btn {
        margin-top: 1rem;
        margin-left: auto;
    }
}

.idea_page {
    .idea_block {
        display: flex;
        flex-direction: column;
        gap: 1rem;

        .head {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 1rem;

            img {
                width: 50px;
                aspect-ratio: 1;
                border-radius: 50%;
            }

            p:first-child {
                font-size: 1.5rem;
            }

            p:last-child {
                &.working {
                    color: var(--warning-color);
                }

                &.completed {
                    color: var(--success-color);
                }

                &.canceled {
                    color: var(--error-color);
                }
            }

            .btn {
                margin-left: auto;
            }
        }

        .message {
            background: var(--background);
            padding: 1rem;
            border-radius: .25rem;
            position: relative;

            p {
                position: absolute;
                right: .25rem;
                bottom: .25rem;
                font-size: .75rem;
                color: darkgray;
                cursor: default;
                width: max-content;

                &[data-title]:hover:after {
                    opacity: 1;
                    transition: all 0.1s ease 0.5s;
                    visibility: visible;
                }

                &[data-title]:after {
                    content: attr(data-title);
                    background: var(--background);
                    border-radius: .25rem;
                    color: darkgray;
                    font-size: .75rem;
                    position: absolute;
                    top: 125%;
                    padding: 3px;
                    opacity: 0;
                    visibility: hidden;
                    left: 50%;
                    transform: translateX(-50%);
                    width: max-content;
                }
            }
        }

        .buttons {
            display: flex;
            justify-content: space-between;
            gap: .25rem;

            a {
                /*border: 1px solid red;*/
                width: 100%;
                text-align: center;
                padding: .35rem;
                border-radius: .5rem;
                transition: all .2s ease-in-out;

                &:hover {
                    transform: scale(1.01);
                }

                &:active {
                    transform: scale(0.99);
                }

                &.working {
                    background: var(--warning-gradient);
                }

                &.completed {
                    background: var(--success-gradient);
                }

                &.canceled {
                    background: var(--error-gradient);
                }
            }
        }
    }
}

.screenshot_page {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
    gap: 1rem;
    flex-direction: column;

    .idea_block {
        width: 500px;

        a:not(:hover) {
            filter: blur(7px);
        }
    }
}

.settings_page {
    font-size: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);

    & .settings_btn {
        display: flex;
        gap: 1rem;
        margin: .5rem 0;
    }

    & button[type=submit] {
        font-size: 1em;
    }
}

@media screen and (max-width: 1024px) {
    .block {
        overflow-x: scroll;
    }

    table {
        width: calc(100vw - clamp(0.55rem, -0.59rem + 5.7vw, 6.25rem) * 2);
    }

    body {
        grid-template-columns: auto;
        grid-template-rows: 3.75em auto;
        padding: 0;

        header {
            margin: 0;
            padding: 0 clamp(1rem, -0.05rem + 5.25vw, 6.25rem);
        }

        .nav {
            display: none;
        }

        .nav_mobile {
            display: block;
            position: sticky;
            bottom: 0;
            padding: clamp(0.2rem, 0.14rem + 0.3vw, 0.5rem);
            background: var(--background-opacity);
            border-radius: clamp(0.5rem, 0.4rem + 0.5vw, 1rem) clamp(0.5rem, 0.4rem + 0.5vw, 1rem) 0 0;
            backdrop-filter: blur(15px);
            margin-top: .25rem;
            z-index: 9;

            ul {
                display: flex;
                justify-content: space-around;
                align-items: flex-end;

                a {
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    padding: clamp(0.563rem, 0.475rem + 0.44vw, 1rem);
                    aspect-ratio: 1/1;
                    width: clamp(2.375rem, 2.243rem + 0.66vw, 3.038rem);
                    border-radius: 50%;

                    & i {
                        font-size: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
                    }

                    &.active {
                        background: var(--accent-color);
                    }
                }
            }
        }

        header {
            grid-area: 1 / 1 / 2 / 2;
        }

        table {
            display: block;
            overflow-x: scroll;
        }
    }

    .group_page {
        & .schedules {
            flex-direction: column;
            gap: 0;
        }
    }
}

@media screen and (max-width: 768px) {
    .container {
        .stats {
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(3, 250px);

            :nth-child(1) {
                grid-area: 1 / 1 / 2 / 2;
            }

            :nth-child(2) {
                grid-area: 1 / 2 / 2 / 3;
            }

            :nth-child(3) {
                grid-area: 3 / 1 / 4 / 3;
            }

            :nth-child(4) {
                grid-area: 2 / 1 / 3 / 3;
            }
        }
    }
}

@media screen and (max-width: 486px) {

    /*body {*/
    /*    .container {*/
    /*        .user_table, .log_table {*/
    /*            width: calc(100vw - clamp(0.55rem, -0.59rem + 5.7vw, 6.25rem) * 2);*/
    /*        }*/
    /*    }*/
    /*}*/
    .content {
        width: 100vw;
    }

    .group_page {
        .group_block {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-gap: 1rem;
        }
    }
}