/**
 * Fan Portal コメントシステム スタイルシート
 * 
 * @package Fan_Portal
 * @since 3.6.0
 */

/* 記事本文後のコンテンツラッパー */
.fp-after-content-wrapper {
    margin-top: 50px;
}

/* コメントセクション全体 */
.fp-comments-section {
    margin: 40px 0;
    padding: 30px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fp-comments-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.fp-comments-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.fp-comment-count {
    font-size: 18px;
    color: #666;
    font-weight: normal;
}

/* キャラクター選択 */
.fp-character-select {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fp-character-select p {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.fp-character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.fp-character-option {
    position: relative;
    cursor: pointer;
}

.fp-character-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.fp-character-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
}

.fp-character-option input[type="radio"]:checked + .fp-character-box {
    border-color: #4CAF50;
    background: #f0f8f0;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.fp-character-box:hover {
    border-color: #999;
    transform: translateY(-2px);
}

.fp-character-box .fp-icon {
    font-size: 32px;
    margin-bottom: 5px;
}

.fp-character-box .fp-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* コメントフォーム */
.fp-comment-form-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fp-comment-form {
    margin: 0;
}

.fp-comment-field {
    margin-bottom: 15px;
}

.fp-comment-field textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.fp-comment-field textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.fp-comment-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.fp-char-count {
    font-size: 14px;
    color: #666;
}

.fp-comment-submit {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.fp-comment-submit:hover {
    background: #45a049;
}

.fp-comment-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* コメントリスト */
.fp-comments-list {
    margin-top: 30px;
}

.fp-comments-sort {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.fp-sort-button {
    background: #fff;
    border: 2px solid #e0e0e0;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fp-sort-button.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.fp-sort-button:hover:not(.active) {
    border-color: #999;
}

.fp-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 個別コメント */
.fp-comment {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.fp-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-icon {
    font-size: 24px;
}

.user-name {
    font-weight: bold;
    color: #333;
}

.user-level {
    font-size: 12px;
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 12px;
    color: #666;
}

.comment-time {
    margin-left: auto;
    font-size: 14px;
    color: #999;
}

.comment-body {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-actions button {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.comment-actions button:hover {
    border-color: #999;
    background: #f5f5f5;
}

.like-btn.liked {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.report-btn {
    margin-left: auto;
}

/* 返信 */
.fp-comment-replies {
    margin-left: 40px;
    margin-top: 15px;
    list-style: none;
    padding: 0;
}

.fp-comment.reply {
    background: #f5f5f5;
}

/* 読み込みボタン */
.fp-load-more-wrapper {
    text-align: center;
    margin-top: 30px;
}

.fp-load-more-comments {
    background: #fff;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fp-load-more-comments:hover {
    background: #4CAF50;
    color: white;
}

/* コメントなし */
.fp-no-comments {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .fp-comments-section {
        padding: 20px 15px;
    }
    
    .fp-character-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .fp-comment-replies {
        margin-left: 20px;
    }
    
    .comment-header {
        flex-wrap: wrap;
    }
    
    .comment-time {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
        font-size: 12px;
    }
}

/* エラーメッセージ */
.fp-error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* 成功メッセージ */
.fp-success-message {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* ローディング */
.fp-loading {
    text-align: center;
    padding: 20px;
}

.fp-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: fp-spin 1s linear infinite;
}

@keyframes fp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}