@font-face {
    font-family: Open Sans; /* Гарнитура шрифта */
    src: url(/fonts/OpenSans-VariableFont.ttf); /*Путь к файлу со шрифтом */
}

* {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Open Sans", sans-serif;
}

main {
    flex: 1 1 auto;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
}

.options {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #434552;
}

.ck-body-wrapper {
    z-index: 9999;
}

.options .logo {
    margin: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: auto;
}

.options .logo img {
    width: 100%;
    height: 100%;
}

.options__list {
    width: 100%;
}

.options__option {
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
}

.options__option:hover,
.options__option.active:hover {
    background-color: rgba(150, 150, 150, 0.5);
}

.options__option.active {
    background-color: rgba(150, 150, 150, 0.3);
}

.windows {
    margin-left: var(--options-width);
    width: 100%;
}

.windows .window {
    display: none;
    padding: 15px;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.windows .window.active {
    display: block;
}

section[data-window="links"] {
    position: relative;
}

section[data-window="links"] .main-cats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 10px;
    row-gap: 10px;
}

section[data-window="links"] .links__list .main-cat {
    overflow: hidden;
    border-radius: 5px;
    border: 2px solid black;
}

section[data-window="links"] .links__list .main-cat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px;
    color: white;
    background-color: #555555;
}

section[data-window="links"] .edit__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    background: none;
    color: #aaaaaa;
    cursor: pointer;
}

section[data-window="links"] .links__list .sub-cats a {
    padding: 2px;
    width: 100%;
    color: black;
}

section[data-window="links"] .links__list ul.links {
    position: relative;
}

section[data-window="links"] .links__list ul.links:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.5rem;
    right: calc(100% - 15px);
    width: 8px;
    border-left: 1px solid black;
    border-bottom: 1px solid black;
}

section[data-window="links"] .links__list ul.links .link {
    position: relative;
}

section[data-window="links"] .links__list ul.links .link:before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: 8px;
    height: 1px;
    background-color: black;
}

section[data-window="links"] .links__list ul.links .link:last-child:before {
    content: none;
}

section[data-window="links"] ul {
    list-style: none;
}

section[data-window="links"] ul li {
    margin-left: 15px;
}

section[data-window="links"] .context-menu {
    position: absolute;
    transform: translateY(20%);
    background-color: #333333;
    border-radius: 5px;

    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease-out,
                opacity 0.3s ease-out,
                visibility 0.3s ease-out;
}

section[data-window="links"] .context-menu.active {
    transform: translateY(0);

    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease-out,
                opacity 0.3s ease-out,
                visibility 0.3s ease-out;
}

.links-menu .main-cat {
    border-radius: 5px;
    overflow: hidden;
}

.links-menu .main-cat .header {
    padding: 5px;
    background-color: #555555;
    color: white;
}

.links-menu .main-cat .sub-cats,
.links-menu .main-cat .links {
    margin-left: 15px;
}

.links-menu .main-cat .header__link {
    display: flex;
    align-items: center;
}

.links-menu .main-cat .right {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.links-menu .main-cat .open__btn,
.links-menu .main-cat .edit__btn,
.links-menu .main-cat .delete__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    width: 14px;
    height: 14px;
    font-size: 14px;
    color: black;
    border: none;
    cursor: pointer;
}

.links-menu .main-cat .delete__btn:hover {
    color: red;
}

.links-menu .main-cat .header .open__btn,
.links-menu .main-cat .header .edit__btn {
    color: #aaaaaa;
}

.links-menu .main-cat .add-page {
    border-left: 1px solid black;
}

/* Редактор */

section[data-window="editor"] .top,
section[data-window="editor"] .editor,
section[data-window="editor"] .ck-editor {
    margin-bottom: 15px;
}

section[data-window="editor"] .top {
    display: flex;
    flex-direction: column;
}

section[data-window="editor"] .top label {
    margin-bottom: 5px;
    width: 360px;
}

section[data-window="editor"] .top label:last-child {
    margin-bottom: 0;
}

section[data-window="editor"] .top select {
    width: 100%;
    box-sizing: border-box;
}

/* Новости */

.news-editor input[type="text"]:active,
.news-editor input[type="text"]:focus,
.links-menu input[type="text"]:active,
.links-menu input[type="text"]:focus {
    box-shadow: 0 0 5px rgba(113, 158, 206, 0.6);
}

.news-editor .add-cover {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.news-editor .add-cover__thumbnail-container {
    flex: 0 0 auto;
    margin-right: 5px;
    width: 160px;
    height: 100px;
    overflow: hidden;
    object-fit: cover;
}

.news-editor .add-cover__thumbnail-container img {
    width: 100%;
    height: auto;
}

.news-editor__bottom {
    display: flex;
}

.news-editor__bottom .delete-btn {
    margin-left: 5px;
}

body .tox .tox-dialog-wrap {
    top: 50%;
    left: calc(50% + calc(var(--options-width) / 2));
    right: initial;
    bottom: initial;
    transform: translate(-50%, -50%);
    width: 96%;
    max-width: 750px;
    height: 70%;
}

body .tox .tox-statusbar__branding {
    display: none;
}

article.news {
    position: relative;
    margin: 15px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #aaaaaa;
}

article.news .edit__btn {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 18px;
    outline: none;
    box-shadow: 0 0 4px 4px rgba(100, 100, 100, 0.2);
    background-color: #fefefe;
    cursor: pointer;
    font-size: 14px;
}

.news__container {
    display: flex;
    align-items: center;
}

.news__cover {
    flex: 0 0 auto;
    margin-right: 5px;
    width: 160px;
    height: 100px;
    overflow: hidden;
    object-fit: cover;
}

.news__cover img {
    width: 100%;
    height: auto;
}

.news__header {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -moz-box;
    -moz-box-orient: vertical;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    font-size: 0.95rem;
}

.news__body {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -moz-box;
    -moz-box-orient: vertical;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    box-orient: vertical;
}

.news__body img {
    display: none;
}


/* Користувачі */

.window[data-window="users"] .users__table {
    margin-top: 10px;
}

.users__table table {
    margin-top: 10px;
    width: 100%;
    border-collapse: collapse;
    border: 2px solid black;
}

.users__table th,
.users__table td {
    padding: 0.2rem 0.5rem;
    border: 1px solid black;
}

.table-tools {
    width: 40px;
}

.table-tools .edit-user,
.table-tools .delete__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    float: right;
}

.table-tools .delete__btn:hover {
    color: red;
}

.table-tools .edit-user:hover {
    background-color: rgba(100, 100, 100, 0.2);
}

.window[data-window="users"] .login-input {
    width: 30%;
}

.window[data-window="users"] .email-input {
    width: 60%;
}

.add-video {
    margin-bottom: 10px;
}

.add-video__container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.add-video__url {
    width: 65%;
}

.add-video__id {
    width: 30%;
}

.videos {
    display: grid;
    row-gap: 10px;
    column-gap: 10px;
}

.video-preview {
    position: relative;
    color: white;
}

.video-preview .tools {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    display: flex;
    background-color: rgba(50, 50, 50, 0.5);
}

.video-preview .open__btn,
.video-preview .delete__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3px;
    width: 16px;
    height: 16px;
    font-size: 14px;
    color: white;
    background: none;
    border: none;
    outline: none;
    text-decoration: none;
    cursor: pointer;
}

.video-preview .delete__btn:hover {
    color: red;
}

.video-preview img {
    width: 100%;
}

.video-preview .title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.2rem 0.5rem;
    width: 100%;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.8);

    /*Обрезка текста в одну строку*/
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -moz-box;
    -moz-box-orient: vertical;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    box-orient: vertical;
}

@media (min-width: 931px) {
    .videos {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (min-width: 801px) and (max-width: 930px) {
    .videos {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 551px) and (max-width: 800px) {
    .videos {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 550px) {
    .videos {
        grid-template-columns: 1fr;
    }
}

/* Окна */

.modal-window {
    position: fixed;
    top: 50%;
    left: calc(50% + calc(var(--options-width) / 2));
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    width: calc(96% - var(--options-width));
    max-width: 750px;
    min-height: 400px;
    max-height: 80%;
    background-color: #fafafa;
    border-radius: 5px;
    border: 2px solid #fafafa;
    box-shadow: 0 0 5px 5px rgba(100, 100, 100, 0.5);

    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.modal-window.active {
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease-out;
}

.modal-window .close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 17px;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
}

.modal-window .close-btn:hover {
    background-color: rgba(150, 150, 150, 0.2);
}

.modal-window__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
}

.modal-window__body {
    padding: 10px;
    overflow-y: scroll;
}

.modal-window__section {
    margin-bottom: 10px;
}

/* Другое */

.button--trans-blue {
    padding: 5px;
    background: none;
    color: #00a7da;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.button--trans-blue:hover {
    background-color: rgba(150, 150, 150, 0.2);
}

.button--blue-white {
    padding: 4px 6px;
    background-color: #00a7da;
    border-radius: 5px;
    border: 1px solid #00a7da;
    outline: none;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease-out;
}

.button--blue-white:hover {
    background: none;
    color: #00a7da;
    transition: all 0.3s ease-out;
}

.select--trans-black {
    padding: 4px 6px;
    background: none;
    border: 1px solid black;
    border-radius: 5px;
}

input[type="text"],
input[type="email"] {
    padding: 5px 4px;
    border-radius: 6px;
    border: 1px solid #111111;
    outline: none;
    background-color: #ffffff;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
}

.progress-bar {
    position: relative;
    padding: 1px;
    width: 100%;
    height: 20px;
    background-color: #eeeeee;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar__aggregate {
    height: 100%;
    border-radius: 4px;
    background-color: #1db51d;
}

.progress-bar__text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #515151;
    font-size: 14px;
}

.text-status {
    padding: 5px;
    width: 100%;
    height: 120px;
    overflow-y: scroll;
    border-radius: 5px;
    border: 1px solid black;
    font-size: 14px;
    box-sizing: border-box;
}

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

.flex-v {
    display: flex;
    flex-direction: column;
}

.flex-max {
    flex: 1 1 auto;
}

select {
    padding: 3px 6px;
    background-color: #fafafa;
    border: 1px solid black;
    border-radius: 6px;
    font-size: 15px;
}

.add-useful__container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
}

.add-useful__container .left {
    margin-right: 10px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    max-width: 650px;
}

.add-useful__container .left label {
    margin: 0 0 10px;
}

.add-useful__file canvas {
    border: 1px dashed black;
    border-radius: 3px;
}

.useful-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-column-gap: 15px;
    grid-row-gap: 15px;
}

.useful-card {
    padding: 7px 5px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(50, 50, 50, 0.7);
}

.useful-card__cover {
    display: block;
    width: 100%;
    height: auto;
    box-sizing: border-box;
}

.useful-card__name {
    margin: 5px 5px 0;
}

.useful-card__buttons {
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: end;
}

.useful-card__buttons .open__btn,
.useful-card__buttons .delete__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    background: none;
    border: none;
    outline: none;
    font-size: 15px;
    color: black;
    cursor: pointer;
    transition: color 0.3s ease-out;
}

.useful-card__buttons .delete__btn:hover {
    color: red;
}
