html {
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    font-size: 20px;
    text-align: center;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

#searchForm {
    display: flex;
    max-width: 600px;
}

#searchInput {
    /* width: 100%; */
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.3s ease;
    margin-right: 5px;
}

#searchInput:focus {
    border-color: #007bff;
}

.searchButton,
.resetButton {
    padding: 12px 24px;
    font-size: 16px;
    border: 2px solid #007bff;
    background-color: #007bff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: fit-content;
    margin: 0 auto;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);

}

.disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.disabled:active {
    transform: none;
    box-shadow: none;
}

.disabled:hover {
    cursor: not-allowed;
    background-color: #ccc !important;
    border-color: #ccc !important;
    transform: none !important;
}

.searchButton:hover:not(.disabled),
.resetButton:hover:not(.disabled) {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
}

.searchButton:active:not(.disabled),
.resetButton:active:not(.disabled) {
    background-color: #004085;
    border-color: #004085;
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.searchButton:focus,
.resetButton:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.4);
}

#loading-spinner {
    /* position: absolute; */
    /* top: 0; */
    /* left: 0; */
    /* position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); */

    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cards {
    margin-top: 20px;
}

.cards li:last-child {
    margin-bottom: 20px;
}

.order {
    margin-top: 5px;
}

select {
    font-size: 20px;
}

ul {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
}

li:last-child .card {
    margin-bottom: 0;
}

#closeModal,
.closeModal {
    font-size: 40px;
    color: red;
    vertical-align: middle;
    user-select: none;
}

#closeModal:hover,
.closeModal:hover {
    cursor: pointer;
}

.card {
    margin: 0 auto;
    margin-bottom: 20px;
    background-color: beige;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: auto;
    width: 20vw;
    max-width: 20vw;
    min-width: 300px;
    padding: 10px;
    transition: box-shadow 0.5s ease-in-out;
}

.content {
    max-height: 380px;
    overflow-y: auto;
}

.card_footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card_footer button {
    user-select: none;
}

.message_count {
    padding: 0px;
}

.comments_section {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0 auto;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding-top: 10px;
    display: block;
    width: 90%;
    transition: all 0.5s ease-in-out;
    /* height: 100%; */
}

.comments_section li:last-child .card {
    margin-bottom: 10px;
}

.comments_actions {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

span {
    /* transition: all 0.1ms ease-in-out; */
}

.comments_section span {
    display: block;
}

.comment_input {
    display: inline-block;
    width: 90%;
    height: 50px;
    margin: 0 auto;
    margin-top: 10px;
}

.comments_list {
    list-style: none;
    margin-top: 10px;
}

.comments_list .card hr {
    margin: 0px;
}

.edited {
    font-size: 12px;
    /* width: fit-content; */
    text-align: right;
}

.comments_list .card {
    background-color: rgb(206, 200, 200);
    margin-left: 10px;
    margin-bottom: 10px;
}



#submit_comment {
    /* margin-bottom: 10px; */
    margin: 0 auto;
    margin-top: 0px;
    display: inline-block;
}

.content {
    padding-left: 10px;
    padding-right: 10px;
    text-align: justify;
}

.avatar {
    border-radius: 50%;
    border: 2px solid #ddd;
    width: 50px;
    height: 50px;
    margin: 0 auto;
    margin-bottom: 5px;
}

.avatar img {
    height: 100%;
    width: 100%;
    border-radius: 50%;
    user-select: none;
}

.profile {
    position: fixed;
    right: 30px;
    top: 10px;
    max-width: 120px;
    text-align: center;
}

#username {
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#logout {
    font-size: 20px;
    padding: 5px 10px;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

#logout:hover {
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
}

hr {
    margin: 20px 0;
    margin-top: 10px;
}

.info {
    flex: 1;
    width: fit-content;
    display: inline-block;
    text-align: left;
}

.comments_list .info {
    flex: 2;
}

.author,
.date {
    margin: 0;
    font-size: 16px;
    font-style: italic;
    color: gray;
}

.author {
    text-align: left;
}

.actions {
    flex: 1;
    width: fit-content;
}

.actions button {
    padding: 0px;
}

.delete_container,
.edit_container {
    width: fit-content;
    height: fit-content;
    display: inline-block;
}

button,
.icon,
img.icon,
input[type="button"] {
    background-color: transparent;
    -webkit-tap-highlight-color: transparent;
}

.card_header {
    display: flex;
    justify-content: space-between
}

.card_header_buttons {
    display: flex;
    gap: 20px;
    width: fit-content;
    user-select: none;
}

.divider {
    width: 10px;
    height: 100%;
    display: inline-block;
}

button.delete,
button.edit {
    padding: 0px;
}

.delete img,
.edit img {
    width: 20px;
    height: 20px;
    filter: invert(0%) sepia(100%) saturate(1000%) hue-rotate(0deg) brightness(100%) contrast(100%);
    transition: filter 0.3s ease;
}

.delete img:hover {
    filter: invert(26%) sepia(95%) saturate(7488%) hue-rotate(0deg) brightness(103%) contrast(103%);
}

.edit img:hover {
    filter: invert(26%) sepia(95%) saturate(7488%) hue-rotate(100deg) brightness(103%) contrast(103%);
}

table {
    table-layout: auto;
    border-collapse: collapse;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    text-align: left;
    vertical-align: middle;
}

td {
    padding: 8px;
}

tr {
    display: flex;
    justify-content: space-between;
}

button {
    margin: 0 auto;
    padding: 8px 16px;
    border: none;
    /* background-color: beige; */
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.icon:hover,
.icon:active,
.icon:focus {
    transform: scale(1.2);
    transition: transform 0.2s ease-in-out;
}

.icon {
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

button:focus {
    outline: none;
}

img.icon {
    display: block;
    width: 20px;
    height: 20px;
    user-select: none;
}

.score,
.comment_count {
    vertical-align: middle;
}

.positive {
    color: #4CAF50;
}

.negative {
    color: #8b1515;
}

button img.icon {
    transition: transform 0.2s ease, filter 0.2s ease;
}

button:active {
    transform: scale(0.95);

}

button[data-voted='true'] img {
    filter: invert(75%) hue-rotate(90deg) saturate(3);
}

.modal {
    font-size: 20px;
    /* display: none; */
    position: fixed;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    /* border: 1px solid #ffa71c; */
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

.modal.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

.modal.active .modal_content {
    transform: scale(1);
    opacity: 1;
}

body.no-select {
    user-select: none;
}

.modal_content {
    margin: 0 auto;
    max-width: 600px;
    width: 90%;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    user-select: none;
}

#openModal {
    margin-top: 20px;
    font-size: 20px;
    background: linear-gradient(135deg, #6C63FF, #48C9B0);
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    align-items: center;
}

#openModal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.openModal-button:active {
    transform: scale(0.97);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.openModal-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.4);
}

.form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 5px;
    border: 1px solid #ffa71c;
    background: #fff4a1;
    padding: 20px;
}

#editForm {
    width: fit-content;
    max-width: 30vw;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
}

#editForm textarea {
    width: 20vw;
    height: 10vh;
    max-height: 20vh;
    border: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 0px;
    padding: 10px;
}

textarea {
    box-sizing: border-box;
    font-size: 20px;
    width: 100%;
    padding: 10px;
    margin: 0 auto;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    height: 20vw;
    max-height: 20vw;
    resize: none;
}

label {
    display: block;
    margin-bottom: 10px;
}

input[type='submit'] {
    background-color: #6C63FF;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

input[type="submit"]:hover {
    background-color: #5a52e6;
}

#get_action {
    display: none;
}

.theme-toggle {
    background-color: transparent;
    padding: 0px;
    position: fixed;
    right: 20px;
    bottom: 20px;
}

.theme-toggle .icon {
    display: block;
    width: 30px;
    height: 30px;
    position: relative;
    transition: all 0.3s ease;

}

.dark-theme {
    background-color: #121212;
    color: #ffffff;
}

.dark-theme .card,
.dark-theme .card {
    background-color: #333;
    color: #fff;
}

.dark-theme .modal {
    background-color: rgba(51, 51, 51, 0.8);
    border: 1px solid #333;
}

.dark-theme .modal_content,
.dark-theme .modal_content textarea {
    background-color: rgb(51, 51, 51);
    color: white
}

.dark-theme .modal_content textarea::placeholder {
    color: white
}

.dark-theme .profile input {
    color: #fff;
}

.dark-theme .theme-toggle .icon, .dark-theme .avatar img {
    filter: invert(1);
}

.notification {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.error_comment {
    color: red;
}

.notification.show {
    color: white;
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY();
}

.notification.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.show {
    display: block;
}

.hide {
    display: none;
}

#count {
    display: block;
}

#warning {
    position: fixed;
    text-align: center;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    font-weight: bold;
    animation: blink 2s infinite;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90vw;
    /* Максимальная ширина элемента */
    overflow: hidden;
    /* Скрывает текст, который не помещается в элемент */
    padding: 10px 15px;
    /* Отступы для лучшего отображения */
    box-sizing: border-box;
    /* Включаем отступы и границы в размер элемента */
    background-color: rgba(0, 0, 0, 0.7);
    /* Фон для контраста текста */
    color: white;
    /* Цвет текста для лучшей видимости */
    border-radius: 5px;
    /* Закругленные углы для улучшения внешнего вида */
    display: flex;
    align-items: center;
    justify-content: center;

}

#warning span {
    display: inline-block;
    white-space: nowrap;
    /* Запрещает перенос текста на новую строку */
    animation: scroll-text 10s linear infinite;
    /* Запускаем анимацию */
}

.dark-theme #warning {
    background-color: rgba(231, 185, 185, 0.8);
}

@keyframes scroll-text {
    0% {
        transform: translateX(100%);
        /* Начинаем с текста полностью справа */
    }

    100% {
        transform: translateX(-100%);
        /* Перемещаем текст полностью влево */
    }
}

#register {
    font-size: 20px;
    margin-top: 20px;
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    background-color: #87dbf0;
    border-color: #87dbf0;
    color: white;
    border: 2px solid transparent;
    border-radius: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

#register:hover {
    background-color: #67a0aa;
    border-color: #67a0aa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#register:active {
    transform: scale(0.98);
}

.dark-theme #register {
    background-color: #1f3553;
    border-color: #1f3553;
}

.dark-theme #register:hover {
    background-color: #67a0aa;
    border-color: #67a0aa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

#pagination_container {
    top: 0;
    overflow-x: auto;
    /* Добавляем горизонтальную прокрутку */
    white-space: nowrap;
    margin: 0px;
    padding: 0px;
    text-align: center;
}

.pagination {
    display: inline-block;
    /* justify-content: center; */
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.pagination li {
    margin: 0 5px;
    display: inline-block;
}

.pagination a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #007bff;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover {
    background-color: #e2e6ea;
    color: #0056b3;
}

.pagination .active a {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    cursor: default;
    pointer-events: none;
}

.pagination .current {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}

.pagination .current:hover {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}

@media (max-width: 480px) {

    body,
    textarea,
    input[type="submit"],
    select,
    span {
        font-size: 16px;
    }

    .card {
        max-width: 95vw;
        min-width: 95vw;
    }

    .modal_content {
        /* max-width: 95vw;
        min-width: 95vw; */
        box-sizing: border-box;
        width: 90%;
        padding: 10px;
    }

    form {
        /* max-width: 95vw;
        min-width: 95vw; */
    }

    textarea {
        max-width: 95vw;
    }

    .profile {
        max-width: 95vw;
        right: 0px;
        top: 5px;
    }

    .avatar {
        width: 35px;
        height: 35px;
    }

    .avatar img {
        height: 33px;
        width: 33px;
    }

    #username {
        font-size: 14px;
    }

    .notification {
        top: 5px;
        left: 50%;
        transform: translateX(-50%);
        padding: 5px;
        font-size: 14px;
    }

    .cards,
    .comments_list {
        margin-top: 10px;
    }

    #openModal,
    #register {
        margin-top: 5px;
        width: 90vw;
    }

    .comments_section {
        max-width: 80vw;
        border-width: 1px;
        /* Уменьшить толщину рамки */
        padding: 5px;
        /* Уменьшить отступы */
    }

    .comment_input,
    #submit_comment {
        max-width: inherit;
        height: 40px;
        /* Уменьшить высоту */
        margin: 5px 0;
        /* Уменьшить отступы */
    }

    #logout {
        font-size: 14px;
    }

    .search-container {
        max-width: 80vw;
        margin: 0 auto;
    }

    #searchForm {
        flex-direction: column;
        align-items: stretch;
    }

    #searchInput,
    #searchButton {
        border-radius: 4px;
        margin: 0 auto;
        margin-top: 5px;
    }

    #searchInput {
        border-right: 1px solid #ccc;
        max-width: 85vw;
    }

    #searchButton {
        border-left: none;
        border-right: none;
    }

    #editForm textarea {
        width: 92%;
        height: 15vh;
        max-height: 15vh;
        padding: 10px;
    }

    #editForm {
        margin: 0 auto;
        width: 85vw;
        max-width: 85vw;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .theme-toggle {
        height: fit-content;
        position: fixed;
        right: 0px;
        top: 100px;
    }

    .theme-toggle .icon {
        width: 25px;
        height: 25px;
    }

    .card {
        max-width: 85vw;
        min-width: 85vw;
    }

    .modal_content {
        max-width: 90vw;
        min-width: 90vw;
        margin: 0;
    }

    .form {
        max-width: 90vw;
        min-width: 90vw;
    }

    textarea {
        max-width: 80vw;
    }

    .profile {
        max-width: 90vw;
        right: 0px;
        top: 5px;
    }

    .avatar {
        width: 40px;
        height: 40px;
    }

    .avatar img {
        height: 38px;
        width: 38px;
    }

    #username {
        font-size: 16px;
    }

    .notification {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 5px 10px;
        font-size: 16px;
    }

    .cards {
        margin-top: 20px;
    }

    #openModal,
    #register {
        margin-top: 10px;
        width: 80vw;
    }

    #openModal {
        width: 50vw;
    }

    .comments_section {
        max-width: 85vw;
        /* Использовать всю ширину экрана */
        padding: 10px;
        /* Увеличить отступы */
    }

    .comments_actions {
        max-width: 80vw;
        flex-direction: column;
        /* Переключение на колонку */
        align-items: stretch;
        /* Растянуть элементы */
    }

    .comment_input {
        max-width: 80vw;
        width: 100%;
        /* Занять всю ширину */
        margin: 10px 0;
        /* Отступы сверху и снизу */
    }

    #submit_comment {
        max-width: 80vw;
        width: 100%;
        /* Занять всю ширину */
        margin: 10px 0;
        /* Отступы сверху и снизу */
    }

    .comments_list {
        min-width: 85vw;
        max-width: 85vw;
    }

    .comments_list .card {
        padding: 0;
        margin-left: 0px;
        min-width: 85vw;
        max-width: 85vw;
    }

    #editForm textarea {
        width: 92%;
        height: 15vh;
        max-height: 15vh;
        padding: 10px;
    }

    #editForm {
        margin: 0 auto;
        width: 85vw;
        max-width: 85vw;
        padding: 10px;
    }
}

@media (min-width: 768px) and (max-width: 1280px) {
    .card {
        max-width: 85vw;
        min-width: 85vw;
    }

    #editForm textarea {
        width: 85vw;
        padding: 10px;
    }

    #editForm {
        margin: 0 auto;
        max-width: 100%;
        padding: 10px;
    }
}

@media (min-width: 1280px) and (max-width: 1920px) {
    .card {
        max-width: 35vw;
        min-width: 35vw;
    }
}

.hidden {
    opacity: 0;
    /* display: none; */
}
.highlighted{
    box-shadow: 0 0 20px 0px #e7e7e7;
}
