/**
 * Стили комментариев к тайтлам манги
 * Version: 1.0
 */

/* ========== СЕКЦИЯ КОММЕНТАРИЕВ ========== */
.title-comments-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.title-comments-title {
    color: #FCA311;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* ========== СОРТИРОВКА ========== */
.title-comments-sort-dropdown {
    position: relative;
    display: inline-block;
}

.title-sort-dropdown-btn {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 30px;
    padding: 8px 16px;
    color: #FCA311;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.title-sort-dropdown-btn:hover {
    background: rgba(252,163,17,0.15);
    border-color: #FCA311;
}

.title-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.title-sort-dropdown-btn.open .title-dropdown-arrow {
    transform: rotate(180deg);
}

.title-sort-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 12px;
    min-width: 180px;
    overflow: hidden;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.title-sort-dropdown-menu.show {
    display: block;
    animation: titleDropdownFade 0.15s ease;
}

@keyframes titleDropdownFade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.title-sort-option {
    padding: 10px 16px;
    color: #ddd;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-sort-option:hover {
    background: rgba(252,163,17,0.1);
    color: #FCA311;
}

.title-sort-option.active {
    background: rgba(252,163,17,0.2);
    color: #FCA311;
    font-weight: 500;
}

.title-sort-option.active::before {
    content: "✓";
}

/* ========== ФОРМА ОТПРАВКИ ========== */
#mainTitleCommentForm {
    margin-bottom: 30px;
}

.title-comment-form textarea {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    margin-bottom: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.title-comment-form textarea:focus {
    outline: none;
    border-color: #FCA311;
}

.title-comment-submit {
    background: #FCA311;
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: opacity 0.2s;
}

.title-comment-submit:hover {
    opacity: 0.9;
}

.title-comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.title-anonymous-note {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-align: right;
}

/* ========== СООБЩЕНИЯ ========== */
.title-comment-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 13px;
}

.title-comment-message.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.title-comment-message.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* ========== КОММЕНТАРИЙ ========== */
.title-comment {
    margin-bottom: 24px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.title-comment:last-child {
    border-bottom: none;
}

.title-comment__main {
    display: flex;
    gap: 14px;
}

.title-comment__avatar {
    flex-shrink: 0;
}

.title-comment__avatar .avatar {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    background: #1a1a1a !important;
}

.title-comment__body {
    flex: 1;
    min-width: 0;
}

.title-comment__header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.title-comment__author {
    color: #FCA311;
    font-weight: 600;
    font-size: 14px;
}

.title-comment__time {
    color: #888;
    font-size: 12px;
}

.title-comment__text {
    color: #ddd;
    line-height: 1.5;
    margin-bottom: 10px;
    word-break: break-word;
}

.title-comment__text p {
    margin: 0;
}

.title-comment__actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* ========== КНОПКИ ДЕЙСТВИЙ ========== */
.title-comment__like,
.title-comment__dislike,
.title-reply__like,
.title-reply__dislike {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #888;
}

.title-comment__like:hover:not(:disabled),
.title-reply__like:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.title-comment__dislike:hover:not(:disabled),
.title-reply__dislike:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.title-comment__like:disabled,
.title-comment__dislike:disabled,
.title-reply__like:disabled,
.title-reply__dislike:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.title-comment__reply-btn,
.title-reply__reply-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    color: #888;
    transition: all 0.2s;
}

.title-comment__reply-btn:hover,
.title-reply__reply-btn:hover {
    background: rgba(252,163,17,0.15);
    color: #FCA311;
}

.title-comment__delete-btn,
.title-reply__delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    color: #d9534f;
    transition: all 0.2s;
}

.title-comment__delete-btn:hover,
.title-reply__delete-btn:hover {
    background: rgba(217, 83, 79, 0.15);
}

.like-count,
.dislike-count {
    font-weight: 500;
}

/* ========== ОТВЕТЫ ========== */
.title-comment__replies {
    margin-top: 16px;
    margin-left: 56px;
}

.title-replies__header {
    margin-bottom: 12px;
}

.title-load-replies-btn,
.title-load-more-replies {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #FCA311;
    transition: all 0.2s;
}

.title-load-replies-btn:hover,
.title-load-more-replies:hover {
    background: rgba(252,163,17,0.15);
}

.title-replies__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.title-reply {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #333;
}

.title-reply__avatar {
    flex-shrink: 0;
}

.title-reply__avatar .avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.title-reply__body {
    flex: 1;
    min-width: 0;
}

.title-reply__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.title-reply__author {
    color: #FCA311;
    font-weight: 500;
    font-size: 13px;
}

.title-reply__time {
    color: #888;
    font-size: 11px;
}

.title-reply__text {
    color: #ddd;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
}

.title-reply__text p {
    margin: 0;
}

.title-reply__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.title-replies__load-more {
    text-align: center;
    margin-top: 12px;
}

/* ========== ФОРМА ОТВЕТА ========== */
.title-reply-form-container {
    margin-top: 12px;
    margin-bottom: 8px;
}

.title-reply-form {
    margin-top: 10px;
    padding: 12px;
    background: #252525;
    border-radius: 12px;
}

.title-reply-form textarea {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    resize: vertical;
    font-size: 13px;
    box-sizing: border-box;
}

.title-reply-form textarea:focus {
    outline: none;
    border-color: #FCA311;
}

.title-cancel-reply-btn {
    background: #444;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.title-cancel-reply-btn:hover {
    background: #555;
}

/* ========== МОДАЛКА УДАЛЕНИЯ ========== */
.title-delete-modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

.title-delete-modal-container {
    background: #2d2d2d;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    animation: titleModalFadeIn 0.2s ease;
}

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

.title-delete-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
}

.title-delete-modal-header h3 {
    color: #FCA311;
    margin: 0;
    font-size: 18px;
}

.title-delete-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-delete-modal-close:hover {
    background: rgba(255,255,255,0.1);
}

.title-delete-modal-content {
    padding: 24px;
}

.title-delete-modal-content p {
    color: #ddd;
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
}

.title-delete-warning {
    background: rgba(217, 83, 79, 0.15);
    border-left: 3px solid #d9534f;
    padding: 12px;
    border-radius: 8px;
}

.title-delete-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.title-delete-cancel-btn {
    background: #444;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.title-delete-cancel-btn:hover {
    background: #555;
}

.title-delete-confirm-btn {
    background: #d9534f;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.title-delete-confirm-btn:hover:not(:disabled) {
    background: #c9302c;
}

.title-delete-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== ПАГИНАЦИЯ ========== */
.title-comments-pagination {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.title-load-more-btn {
    background: #FCA311;
    color: #1a1a1a;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
}

.title-load-more-btn:hover {
    background: #e09100;
    transform: scale(1.02);
}

.title-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== СКЕЛЕТОН ========== */
.title-comments-skeleton {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.title-skeleton-comment {
    display: flex;
    gap: 14px;
    animation: titlePulse 1.5s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.title-skeleton-avatar {
    width: 42px;
    height: 42px;
    background: #3a3a3a;
    border-radius: 50%;
}

.title-skeleton-content {
    flex: 1;
}

.title-skeleton-line {
    height: 14px;
    background: #3a3a3a;
    border-radius: 7px;
    margin-bottom: 10px;
}

.title-skeleton-line.short {
    width: 100px;
}

.title-skeleton-line.medium {
    width: 200px;
}

.title-skeleton-line.long {
    width: 80%;
}

/* ========== ЗАГРУЗКА ========== */
.title-comments-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.title-spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(252,163,17,0.2);
    border-top: 3px solid #FCA311;
    border-radius: 50%;
    animation: titleSpin 0.6s linear infinite;
    margin: 0 auto 10px;
}

@keyframes titleSpin {
    to { transform: rotate(360deg); }
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .title-comment__main {
        gap: 10px;
    }
    
    .title-comment__avatar .avatar {
        width: 34px !important;
        height: 34px !important;
    }
    
    .title-comment__replies {
        margin-left: 44px;
    }
    
    .title-reply {
        gap: 10px;
    }
    
    .title-reply__avatar .avatar {
        width: 28px !important;
        height: 28px !important;
    }
    
    .title-sort-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 160px;
    }
    
    .title-comments-title {
        font-size: 16px;
    }
    
    .title-comment__actions,
    .title-reply__actions {
        gap: 10px;
    }
    
    .title-delete-modal-container {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .title-comment__replies {
        margin-left: 30px;
    }
    
    .title-comment__avatar .avatar {
        width: 30px !important;
        height: 30px !important;
    }
    
    .title-reply__avatar .avatar {
        width: 24px !important;
        height: 24px !important;
    }
    
    .title-comment__actions,
    .title-reply__actions {
        gap: 6px;
    }
    
    .title-comment__like,
    .title-comment__dislike,
    .title-reply__like,
    .title-reply__dislike {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .title-comment__reply-btn,
    .title-reply__reply-btn,
    .title-comment__delete-btn,
    .title-reply__delete-btn {
        font-size: 11px;
        padding: 3px 6px;
    }
}