/* ============================================
   COMMENTS SECTION - The Silicon Review
   ============================================ */

#comments-section {
    margin-top: 40px;
    margin-bottom: 30px;
    font-family: 'Merriweather', Georgia, serif;
}

#comments-section h2.comments-heading {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 3px solid #1a1a1a;
    padding-bottom: 12px;
    margin-bottom: 6px;
}

.comments-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 18px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 22px;
}

.comments-count-label {
    font-size: 14px;
    color: #555;
    font-family: Arial, sans-serif;
}

.comments-sort select {
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 10px;
    color: #444;
    background: #fff;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

/* ---- Write a comment box ---- */
.comment-write-box {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e0e0e0;
}

.comment-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: Arial, sans-serif;
}

.comment-input-area {
    flex: 1;
}

.comment-input-area textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    color: #333;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.comment-input-area textarea:focus {
    border-color: #1a1a1a;
}

.comment-input-area textarea::placeholder {
    color: #aaa;
}

.comment-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-post-comment {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background 0.2s;
}

.btn-post-comment:hover {
    background: #333;
}

.btn-post-comment:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.comment-login-hint {
    font-size: 13px;
    color: #777;
    font-family: Arial, sans-serif;
}

.comment-login-hint a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
}

.comment-login-hint a:hover {
    text-decoration: underline;
}

/* ---- Not logged in prompt ---- */
.comment-signin-prompt {
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 20px 24px;
    text-align: center;
    margin-bottom: 28px;
}

.comment-signin-prompt p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
    font-family: Arial, sans-serif;
}

.comment-signin-prompt .btn-signin-comment {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 9px 24px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.comment-signin-prompt .btn-signin-comment:hover {
    background: #333;
}

/* ---- Comment list ---- */
#comments-list {
    margin-top: 10px;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.comment-item .comment-avatar,
.comment-item .comment-avatar-placeholder {
    width: 38px;
    height: 38px;
    font-size: 14px;
    margin-top: 2px;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.comment-author-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    font-family: Arial, sans-serif;
}

.comment-time {
    font-size: 12px;
    color: #999;
    font-family: Arial, sans-serif;
}

.comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    font-family: Arial, sans-serif;
    margin: 0 0 8px;
    word-break: break-word;
}

.comment-text.is-deleted {
    color: #aaa;
    font-style: italic;
}

/* ---- Comment action buttons ---- */
.comment-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-like-comment,
.btn-reply-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #777;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.btn-like-comment:hover,
.btn-reply-toggle:hover {
    color: #1a1a1a;
}

.btn-like-comment.liked {
    color: #1a1a1a;
}

.btn-like-comment .like-count {
    font-weight: 600;
}

/* ---- Replies ---- */
.replies-container {
    margin-top: 14px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
}

.reply-item {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.reply-item .comment-avatar,
.reply-item .comment-avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

/* ---- Reply write box ---- */
.reply-write-box {
    margin-top: 12px;
    display: none;
}

.reply-write-box.open {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.reply-write-box textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    color: #333;
    resize: vertical;
    min-height: 68px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.reply-write-box textarea:focus {
    border-color: #1a1a1a;
}

.reply-write-box-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.btn-submit-reply {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-submit-reply:hover  { background: #333; }
.btn-submit-reply:disabled { background: #ccc; cursor: not-allowed; }

.btn-cancel-reply {
    background: none;
    border: 1px solid #ddd;
    padding: 7px 14px;
    border-radius: 4px;
    font-size: 13px;
    color: #777;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-cancel-reply:hover { border-color: #aaa; color: #444; }

/* ---- Load more ---- */
.load-more-comments {
    text-align: center;
    margin-top: 20px;
}

.btn-load-more {
    background: #fff;
    border: 1px solid #1a1a1a;
    color: #1a1a1a;
    padding: 9px 28px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: #1a1a1a;
    color: #fff;
}

/* ---- Empty state ---- */
.no-comments-msg {
    text-align: center;
    padding: 30px 0;
    color: #aaa;
    font-size: 15px;
    font-family: Arial, sans-serif;
}

/* ---- Toast notification ---- */
.comment-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a1a1a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.comment-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.comment-toast.error {
    background: #333;
}

/* ---- Divider between top-level comments ---- */
.comment-divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 0 0 22px;
}

/* ---- Spinner ---- */
.comment-spinner {
    text-align: center;
    padding: 20px 0;
    color: #aaa;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* ---- Delete button (own comment) ---- */
.btn-delete-comment {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #bbb;
    padding: 0;
    font-family: Arial, sans-serif;
    transition: color 0.2s;
}

.btn-delete-comment:hover {
    color: #1a1a1a;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .comment-write-box { flex-direction: row; }
    .comments-meta-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .comment-actions-row { flex-direction: column; align-items: flex-start; }
    .reply-write-box-actions { flex-direction: row; }
    .replies-container { padding-left: 10px; }
}