body.night-theme .avatars_link {
    color: green;
}
.upload-btn {
  background-color: var(--main-color);
  color: white;
}
.avatars_link {
    color: red;
}
.pinned-badge {
    font-size: 1.1em;
}
.views-counter {
  font-family: Pompadur, 'site', cursive;
  color: black;
  text-align: left;
  width: 100%;
  margin: 10px 0px;
  font-size: 15px;
  color: rgb(17, 17, 17);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .views-counter {
        font-size: 12px;
    }
}

.comments-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.night-theme .comments-container {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.comments-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

body.night-theme .comments-header {
    border-bottom-color: #444;
}

.comments-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    display: inline-block;
}

body.night-theme .comments-header h2 {
    color: #f0f0f0;
}

.comments-count {
    font-size: 24px;
    color: #666;
    margin-left: 5px;
}

body.night-theme .comments-count {
    color: #aaa;
}

/* Форма комментария */
.comment-form {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

body.night-theme .comment-form {
    background-color: #2a2a2a;
}

.form-row {
  margin-bottom: 15px;
}

.user-name {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  width: calc(100% - 70px); /* Оставляем место для аватарки */
  display: inline-block;
  vertical-align: middle;
}

.avatar-selector {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
}

body.night-theme .user-name {
    background-color: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

/* Выбор аватарки */
.avatar-selector {
    position: relative;
}

.avatar-preview-container {
    position: relative;
    display: inline-block;
}

.avatar-preview {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--main-color);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-tooltip {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.avatar-preview:hover .avatar-tooltip {
    opacity: 1;
}

.avatar-grid {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    position: absolute;
    z-index: 100;
    right: 0;
    top: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body.night-theme .avatar-grid {
    background-color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.avatar-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.avatar-option:hover {
    transform: scale(1.1);
}

body.night-theme .avatar-option.selected {
    box-shadow: 0 0 0 2px var(--main-color);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Поле комментария */
.comment-text {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 16px;
    resize: vertical;
    text-align: left;
}

body.night-theme .comment-text {
    border-color: #444;
    color: #f0f0f0;
}

/* Кнопки действий */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.emoji-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.emoji-picker span {
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.2s;
}

.emoji-picker span:hover {
    transform: scale(1.2);
}

.submit-comment {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-comment:hover {
    background-color: #45a049;
}

.comment-notice {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

body.night-theme .comment-notice {
    color: #aaa;
}

/* Стили для комментариев */
.comment {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

body.night-theme .comment {
    background-color: #2a2a2a;
}

.comment.admin-comment {
    background-color: var(--main-color-light-opaque);
}

body.night-theme .comment.admin-comment {
    border-left-color: var(--main-color);
    background-color: #1a2a3a;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.comment-author {
    font-weight: bold;
    margin-right: 10px;
    color: #333;
}

.comment.admin-comment .comment-author {
    color: var(--main-color); /* Красный в светлой теме */
}

body.night-theme .comment.admin-comment .comment-author {
    color: var(--main-color); /* Зеленый в темной теме */
}

body.night-theme .comment-author {
    color: #f0f0f0;
}

.admin-badge {
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 10px;
    background-color: var(--main-color);
    font-family: Pompadur, 'site', cursive;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-text {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #333;
}


/* Реакции */
.reaction-buttons {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    flex-wrap: wrap;
}

.reaction-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 2px;
    white-space: nowrap;
}

.reaction-btn:hover {
    background-color: #eee;
}

body.night-theme .reaction-btn:hover {
    background-color: #333;
}

body.night-theme .reaction-btn.user-reacted {
    background-color: rgba(76, 175, 80, 0.2);
}

.reaction-count {
    font-size: 14px;
    margin-left: 2px;
}

/* Форма ответа */
.reply-form .form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.reply-form .avatar-selector {
    margin-left: 10px;
}

.reply-form .avatar-grid {
    top: 100%;
    /* left: 0; */
    /* right: auto; */
}

/* Тайминги */
.timing:hover::after {
    content: ' (перейти)';
    font-size: 0.8em;
    opacity: 0.7;
}

/* Адаптивность для реакций */
@media (max-width: 600px) {
    .reaction-buttons {
        gap: 3px;
    }
    
    .reaction-btn {
        padding: 2px 5px;
        font-size: 14px;
    }
    
    .reaction-count {
        font-size: 12px;
    }
}

/* Ответы */
.reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

body.night-theme .reply-btn {
    color: #aaa;
}

.reply-btn:hover {
    background-color: #eee;
    color: #333;
}

body.night-theme .reply-btn:hover {
    background-color: #333;
    color: #f0f0f0;
}

.comment-replies {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid var(--main-color);
}

.comment-reply {
    margin-top: 10px;
}

/* Форма ответа */
.reply-form {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 6px;
}

body.night-theme .reply-form {
    background-color: #2a2a2a;
}

.reply-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 8px;
}

body.night-theme .reply-form textarea {
    background-color: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

.reply-buttons {
    display: flex;
    gap: 10px;
}

.reply-form button {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.reply-form button:hover {
    background-color: var(--main-color-light);
}

.reply-form .cancel-reply {
    background-color: #f44336;
}

.reply-form .cancel-reply:hover {
    background-color: #d32f2f;
}

/* Сообщения */
.no-comments {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

body.night-theme .no-comments {
    color: #aaa;
}

.error-loading {
    text-align: center;
    padding: 20px;
    color: #f44336;
    font-style: italic;
}

/* Тайминги */
body.night-theme .timing {
  background-color: var(--main-color);
}
.timing {
    background-color: var(--main-color-light-opaque);
    padding: 2px 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.timing:hover {
    background-color: var(--main-color-light);
}

/* Попап */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.night-theme .popup-content {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

.popup-message {
    margin-bottom: 15px;
    font-size: 16px;
}

.popup-close {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.popup-close:hover {
    background-color: var(--main-color-light);
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .comments-container {
        padding: 15px;
    }
    
    .comment-form {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .avatar-selector {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        top: 100%;
    }
    
    .comment-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .reaction-buttons {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .comment-replies {
        padding-left: 10px;
    }
    
    .reply-form {
        padding: 8px;
    }
}



body.night-theme .reaction-count {
  color: #e0e0e0;
}
body.night-theme .reaction-btn.user-reacted {
  background-color: var(--main-color);
}
body.night-theme .comment-replies {
  border-left: 2px solid rgba(76, 175, 80, 0.3);
}
.avatar-preview>img {
  max-width: 100%;
}


body.night-theme .avatar-preview {
  border: 2px solid var(--main-color);
}
body.night-theme .reply-user-name {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border: 1px solid #444;
}
.reply-header {
  text-align: left;
  font-family: Pompadur, 'site', cursive;
}
.reply-user-name {
  padding: 6px;
  border: 1px solid #bfbfbf;
}
.comment-text>textarea {
  background-color: #444;
}
.avatar-option>img {
  max-width: 100%;
}
.avatar-option.selected {
    box-shadow: 0 0 0 3px var(--main-color);
}
body.night-theme .comment-replies {
  border-left: 2px solid var(--main-color);
}
.reaction-btn.user-reacted {
  background-color: var(--main-color-light-opaque);
}
input:focus {
  outline: 1px solid var(--main-color-light);
}
textarea:focus {
  outline: 1px solid var(--main-color-light);
}
body.night-theme input:focus {
  outline: 1px solid var(--main-color);
}
body.night-theme textarea:focus {
  outline: 1px solid var(--main-color);
}
.submit-comment:hover {
  background-color: var(--main-color-light);
}
.comment-form > textarea {
  border: 1px solid #ddd;
}
body.night-theme .admin-badge {
  background-color: var(--main-color);
}
body.night-theme .comment.admin-comment {
  background-color: var(--main-color-dark-opaque);
}
body.night-theme textarea {
  background-color: #2a2a2a;
}

.comment-form {
  overflow-x: hidden;
}
/* Исправленные стили для галереи изображений */
.comment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.comment-image-container {
    width: 180px;
    height: 120px;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.comment-image-container:hover {
    transform: scale(1.05);
}

.comment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Стили для модального окна галереи */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

body.night-theme .image-modal-content {
    background-color: #2a2a2a;
}

.image-modal-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

body.night-theme .image-modal-header {
    border-bottom-color: #444;
}

.image-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.image-modal-username {
    font-weight: bold;
    color: #333;
}

body.night-theme .image-modal-username {
    color: #f0f0f0;
}

.image-modal-img-container {
    position: relative;
    max-width: 100%;
    max-height: 70vh;
    overflow: hidden;
}

.image-modal-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.image-modal-text {
    padding: 15px;
    color: #333;
    border-top: 1px solid #eee;
    /*! top: 15px; */
    /*! position: absolute; */
    margin-top: 15px;
}

body.night-theme .image-modal-text {
    color: #f0f0f0;
    border-top-color: #444;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.image-prev-btn {
    left: 20px;
}

.image-next-btn {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: 7.5%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
}

/* Стили для превью изображений в форме */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .comment-image-container {
        width: 80px;
        height: 80px;
    }
    
    .image-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .image-preview {
        width: 60px;
        height: 60px;
    }
}













/* Добавляем стили для кнопки скачивания в модальном окне */
.image-modal-download {
    position: absolute;
    top: 10px;
    right: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background-color 0.3s;
}

.image-modal-download:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Адаптивность */
@media (max-width: 768px) {
    .image-modal-download {
        top: 60px;
        right: 50px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

body.night-theme .comment-text a {
  color: var(--main-color);
}


/* Добавьте в comment.css */

/* Базовые стили шрифтов */
.comments-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.comments-container.pompadur-font {
    font-family: Pompadur, 'site', cursive !important;
}

.comments-container.lobster-font {
    font-family: 'Lobster', cursive !important;
}

/* Стили для попапа аватарок */
.avatar-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.avatar-popup {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 80%;
    overflow: auto;
    padding: 20px;
    width: 500px;
}

body.night-theme .avatar-popup {
    background: #2a2a2a;
    color: white;
}

.avatar-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.avatar-popup-close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.avatar-popup-close:hover {
    color: var(--main-color);
}

.avatar-categories {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avatar-category h4 {
    margin: 0 0 10px 0;
    color: var(--main-color);
}

.avatar-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.avatar-option-popup {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.avatar-option-popup:hover {
    transform: scale(1.1);
    border-color: var(--main-color);
}

.avatar-option-popup.selected-avatar {
    border: 3px solid var(--main-color);
    box-shadow: 0 0 8px var(--main-color);
}

.avatar-option-popup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 100%;
}

/* Стили для тэгов */
.comment-tags-container {
    margin-bottom: 15px;
}

.tags-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}

.tag-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tag-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

body.night-theme .tag-btn {
    background: #333;
    border-color: #444;
    color: white;
}

.tag-btn.active {
    background: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.tag-btn:hover {
    transform: translateY(-2px);
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.selected-tag {
    background: var(--main-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.comment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 8px 0;
}

.comment-tag {
    background: var(--main-color-light-opaque);
    color: var(--main-color);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    cursor: pointer;
}

.comment-tag:hover {
    background: var(--main-color-light);
}

/* Стили для настроек */
.comments-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--main-color);
}

.comment-settings-btn {
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    background: none;
    border: none;
    transition: transform 0.2s;
}

.comment-settings-btn:hover {
    transform: scale(1.1);
}

.comment-settings-panel {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body.night-theme .comment-settings-panel {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--main-color);
}

.font-selector {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

body.night-theme .font-selector {
    background: #333;
    border-color: #444;
    color: white;
}

.save-settings {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.save-settings:hover {
    background: var(--main-color-light);
}

/* Поиск по тэгам */
.tag-search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

body.night-theme .tag-search-container {
    background: #2a2a2a;
    border-color: #444;
}

.tag-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 200px;
}

body.night-theme .tag-search-input {
    background: #333;
    border-color: #444;
    color: white;
}

.search-tag-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-tag-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 7px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

body.night-theme .search-tag-btn {
    background: #333;
    border-color: #444;
    color: white;
}

.search-tag-btn.active {
    background: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.search-tag-btn:hover {
    transform: translateY(-2px);
}

.comments-count {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
}

body.night-theme .comments-count {
    color: #aaa;
}

.no-results-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

body.night-theme .no-results-message {
    color: #aaa;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .avatar-category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .avatar-popup {
        max-width: 95%;
        max-height: 85%;
        padding: 15px;
        width: 90%;
    }
    
    .tag-buttons {
        gap: 5px;
    }
    
    .tag-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .tag-search-input {
        width: 150px;
    }
    
    .comment-replies {
        padding-left: 10px;
    }
    
    .comment-text {
        word-break: break-word;
        overflow-wrap: break-word;
        min-width: 100%;
    }
    
    .tag-search-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-tag-buttons {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .avatar-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .comment-replies {
        padding-left: 5px;
    }
    
    .tag-search-input {
        width: 235px;
        font-size: 12px;
    }
    
    .comment-header {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .comment-author {
        font-size: 14px;
    }
    
    .comment-date {
        font-size: 11px;
    }
}

/* Обновленные стили для аватарок в комментариях */
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-preview {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--main-color);
    transition: border-color 0.2s;
}

.avatar-preview:hover {
    border-color: var(--main-color);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Стили для reply формы */
.reply-form .avatar-preview {
    cursor: pointer;
}

.reply-form .avatar-preview:hover {
    border-color: var(--main-color);
}

/* Реакции */
.reaction-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.reaction-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

body.night-theme .reaction-btn {
    background: #333;
    border-color: #444;
    color: white;
}

.reaction-btn:hover {
    transform: translateY(-1px);
    background: #e0e0e0;
}

body.night-theme .reaction-btn:hover {
    background: #444;
}

.reaction-btn.user-reacted {
    background: var(--main-color-light);
    border-color: var(--main-color);
}

body.night-theme .reaction-btn.user-reacted {
    background: var(--main-color);
}

.reaction-count {
    font-size: 12px;
    font-weight: bold;
}

/* Стили для текста комментариев */
.comment-text {
    white-space: pre-line;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* Глобальные стили для контейнера комментариев */
.comments-container * {
    box-sizing: border-box;
}

.comments-container h2,
.comments-container h3,
.comments-container h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.comments-container input,
.comments-container textarea,
.comments-container select, .user-name {
    font-family: inherit;
}

.comments-container button {
    font-family: inherit;
}
@media screen and (max-width: 600px) /* Mobile */ {
    .submit-comment {
        
    }
}











/* Красивые скроллбары для модалки аватарок */
.avatar-popup {
    scrollbar-width: thin;
    scrollbar-color: var(--main-color) #f0f0f0;
}

.avatar-popup::-webkit-scrollbar {
    width: 8px;
}

.avatar-popup::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.avatar-popup::-webkit-scrollbar-thumb {
    background: var(--main-color);
    border-radius: 4px;
}

.avatar-popup::-webkit-scrollbar-thumb:hover {
    background: var(--main-color-light);
}

/* Для ночной темы */
body.night-theme .avatar-popup {
    scrollbar-color: var(--main-color) #333;
}

body.night-theme .avatar-popup::-webkit-scrollbar-track {
    background: #333;
}

body.night-theme .avatar-popup::-webkit-scrollbar-thumb {
    background: var(--main-color);
}

body.night-theme .avatar-popup::-webkit-scrollbar-thumb:hover {
    background: var(--main-color-light);
}

/* Анимация появления скроллбара */
.avatar-popup {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.avatar-popup:hover {
    scrollbar-color: var(--main-color) #f0f0f0;
}

body.night-theme .avatar-popup:hover {
    scrollbar-color: var(--main-color) #333;
}

/* Для Firefox */
.avatar-popup {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.avatar-popup:hover {
    scrollbar-color: var(--main-color) #f0f0f0;
}

/* Улучшаем внешний вид модалки */
.avatar-popup {
    background: white;
    border-radius: 16px;
    max-width: 90%;
    max-height: 85%;
    overflow: auto;
    padding: 24px;
    width: 520px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid #e0e0e0;
}

body.night-theme .avatar-popup {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.avatar-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
    padding-bottom: 16px;
}

body.night-theme .avatar-popup-header {
    border-bottom-color: #444;
}

.avatar-popup-close {
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease, transform 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.avatar-popup-close:hover {
    color: var(--main-color);
    background: #f5f5f5;
    transform: scale(1.1);
}

body.night-theme .avatar-popup-close:hover {
    background: #333;
}

/* Анимация появления модалки */
.avatar-popup-overlay {
    animation: fadeIn 0.3s ease;
}

.avatar-popup {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}