/* コメントエリア全体 */
.p-commentArea {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* コメント一覧の背景色を統一 */
.c-commentList {
    background-color: transparent;
    padding: 0;
}

/* ツリー表示のメインスタイル */
.comment-thread {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

/* スレッドごとの色分け */
.comment-thread:nth-child(odd) {
    background: rgba(52, 152, 219, 0.03);
    border-color: rgba(52, 152, 219, 0.15);
}

.comment-thread:nth-child(even) {
    background: rgba(155, 89, 182, 0.03);
    border-color: rgba(155, 89, 182, 0.15);
}

/* 基本のコメントスタイル */
.comment {
    position: relative;
    padding: 16px;
    border-left: 3px solid #dee2e6;
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

/* 親コメントのスタイル */
.comment.parent {
    border-left-color: #3498db;
    background: rgba(52, 152, 219, 0.08);
    border-bottom: 2px solid rgba(52, 152, 219, 0.1);
}

.comment-thread:nth-child(even) .comment.parent {
    border-left-color: #9b59b6;
    background: rgba(155, 89, 182, 0.08);
    border-bottom: 2px solid rgba(155, 89, 182, 0.1);
}

/* 返信コメントのスタイル */
.comment.reply {
    margin-left: 24px;
    border-left-color: #95a5a6;
    background: rgba(149, 165, 166, 0.03);
    position: relative;
    border-bottom: 1px solid rgba(149, 165, 166, 0.1);
}

/* シンプルな縦線の表示 */
.comment.reply::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #95a5a6;
    border-radius: 1px;
}

/* コメントメタデータ */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

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

.comment-edit {
    font-size: 12px;
}

.comment-edit a {
    color: #6c757d;
    text-decoration: none;
}

.comment-edit a:hover {
    color: #3498db;
}

/* コメント内容 */
.comment-content {
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* 返信リンク */
.reply {
    font-size: 12px;
}

.reply a {
    color: #3498db;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(52, 152, 219, 0.1);
}

.reply a:hover {
    background: rgba(52, 152, 219, 0.2);
}

/* 返信フォームのスタイル */
#respond {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

#respond h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 16px;
}

#respond .comment-form-comment label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

#respond .comment-form-comment textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

#respond .comment-form-author,
#respond .comment-form-email,
#respond .comment-form-url {
    margin-bottom: 16px;
}

#respond .comment-form-author label,
#respond .comment-form-email label,
#respond .comment-form-url label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

#respond .comment-form-author input,
#respond .comment-form-email input,
#respond .comment-form-url input {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

#respond .form-submit {
    margin-top: 16px;
}

#respond .form-submit input {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

#respond .form-submit input:hover {
    background: #2980b9;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .p-commentArea {
        padding: 16px;
    }
    
    .comment {
        padding: 12px;
    }
    
    .comment.reply {
        margin-left: 20px;
    }
    
    .comment.reply::before {
        left: -10px;
    }
    
    .comment-meta {
        gap: 8px;
    }
    
    .comment-author {
        font-size: 13px;
    }
    
    .comment-date {
        font-size: 11px;
    }
    
    .comment-content {
        font-size: 13px;
    }
    
    #respond {
        padding: 16px;
    }
}

/* 既存のWordPressクラスとの互換性 */
.commentlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.commentlist .comment-body {
    background: transparent;
    border: none;
    padding: 0;
}

/* SWELLテーマとの統合 */
.c-commentList .comment {
    border: none;
    background: transparent;
    padding: 0;
}

.c-commentList .comment-thread {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.c-commentList .comment-thread:nth-child(odd) {
    background: rgba(52, 152, 219, 0.03);
}

.c-commentList .comment-thread:nth-child(even) {
    background: rgba(155, 89, 182, 0.03);
}