

.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 rgb(255, 0, 0);
}

.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 #00FF0A;
}

.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: #4CAF50;
    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: #fff0f0;
}

body.night-theme .comment.admin-comment {
    border-left-color: #4CAF50;
    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: #f44336; /* Красный в светлой теме */
}

body.night-theme .comment.admin-comment .comment-author {
    color: #4CAF50; /* Зеленый в темной теме */
}

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: #E00;
    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 rgba(255, 0, 0, 0.3);
}

.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: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.reply-form button:hover {
    background-color: #45a049;
}

.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: rgba(76, 175, 80, 0.2);
}
.timing {
    background-color: #FBB;
    padding: 2px 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.timing:hover {
    background-color: rgba(76, 175, 80, 0.3);
}

/* Попап */
.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: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.popup-close:hover {
    background-color: #45a049;
}

/* Адаптивность для мобильных */
@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: rgba(76, 175, 80, 0.2);
}
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 rgb(103, 255, 0);
}
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 red;
}
body.night-theme .comment-replies {
  border-left: 2px solid rgba(76, 175, 80, 0.3);
}
.reaction-btn.user-reacted {
  background-color: rgba(255, 0, 0, 0.2);
}
input:focus {
  outline: 1px solid red;
}
textarea:focus {
  outline: 1px solid red;
}
body.night-theme input:focus {
  outline: 1px solid green;
}
body.night-theme textarea:focus {
  outline: 1px solid green;
}
.submit-comment:hover {
  background-color: #3BD741;
}
.comment-form > textarea {
  border: 1px solid #ddd;
}
body.night-theme .admin-badge {
  background-color: #4CAF50;
}
body.night-theme .comment.admin-comment {
  background-color: #2a332a;
}
body.night-theme textarea {
  background-color: #2a2a2a;
}

.comment-form {
  overflow-x: hidden;
}