/* ===== Skill Comments Section ===== */

.skill-comments-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid #e5e7eb;
}

.skill-comments-section .section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111418;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Comment Form */
.comment-form-wrap {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.comment-form-wrap textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #111418;
    background: #fff;
    resize: vertical;
    min-height: 90px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.comment-form-wrap textarea:focus {
    border-color: var(--color-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.comment-form-wrap .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.btn-submit-comment {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    background: var(--color-primary, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-submit-comment:hover {
    background: rgba(79, 70, 229, 0.9);
}

.btn-submit-comment:active {
    transform: scale(0.98);
}

.btn-submit-comment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Login prompt banner */
.comment-login-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.comment-login-tip p {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0;
}

.btn-login-tip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 1.1rem;
    background: var(--color-primary, #4f46e5);
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-login-tip:hover {
    background: rgba(79, 70, 229, 0.88);
}

/* Comment List */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Single comment item */
.comment-item {
    display: flex;
    gap: 0.875rem;
}

.comment-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}

.comment-author {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111418;
}

.comment-time {
    font-size: 0.775rem;
    color: #9ca3af;
}

.comment-text {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.65;
    word-break: break-word;
}

.comment-actions {
    margin-top: 0.5rem;
}

.btn-reply {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.btn-reply:hover {
    color: var(--color-primary, #4f46e5);
}

/* Replies (level 2) */
.replies-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-item {
    display: flex;
    gap: 0.75rem;
}

.reply-avatar {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
}

/* Inline reply form */
.reply-form-wrap {
    margin-top: 0.875rem;
    display: none;
}

.reply-form-wrap.active {
    display: block;
}

.reply-form-wrap textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #111418;
    background: #fff;
    resize: vertical;
    min-height: 72px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.reply-form-wrap textarea:focus {
    border-color: var(--color-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.reply-form-wrap .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cancel-reply {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-submit-reply {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.875rem;
    background: var(--color-primary, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit-reply:hover {
    background: rgba(79, 70, 229, 0.9);
}

.btn-submit-reply:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty state */
.comment-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #9ca3af;
}

.comment-empty .material-symbols-outlined {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #d1d5db;
}

/* Login Modal */
.comment-login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.comment-login-modal {
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.comment-login-modal .modal-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.comment-login-modal .modal-icon .material-symbols-outlined {
    color: var(--color-primary, #4f46e5);
    font-size: 1.75rem;
}

.comment-login-modal h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111418;
    margin-bottom: 0.5rem;
}

.comment-login-modal p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.comment-login-modal .modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn-modal-cancel {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-cancel:hover {
    background: #f9fafb;
}

.btn-modal-login {
    flex: 1;
    padding: 0.625rem 1rem;
    background: var(--color-primary, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-login:hover {
    background: rgba(79, 70, 229, 0.88);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .skill-comments-section {
        border-top-color: #374151;
    }

    .skill-comments-section .section-title {
        color: #f9fafb;
    }

    .comment-form-wrap {
        background: #1f2937;
        border-color: #374151;
    }

    .comment-form-wrap textarea,
    .reply-form-wrap textarea {
        background: #111827;
        border-color: #374151;
        color: #f3f4f6;
    }

    .comment-author {
        color: #f3f4f6;
    }

    .comment-text {
        color: #d1d5db;
    }

    .comment-avatar,
    .reply-avatar {
        border-color: #374151;
    }

    .replies-list {
        border-left-color: #374151;
    }

    .comment-login-tip {
        background: #1e2a4a;
        border-color: #3b4f8a;
    }

    .comment-login-tip p {
        color: #d1d5db;
    }

    .comment-login-modal {
        background: #1f2937;
    }

    .comment-login-modal .modal-icon {
        background: #1e2a4a;
    }

    .comment-login-modal h3 {
        color: #f3f4f6;
    }

    .comment-login-modal p {
        color: #9ca3af;
    }

    .btn-modal-cancel {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }

    .btn-cancel-reply {
        border-color: #374151;
        color: #9ca3af;
    }
}
