/**
 * AIDB Premium Comments - フロントエンドスタイル
 */

/* ============================
   セクション全体
   ============================ */
.aidb-pc-section {
    margin-top: 48px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.aidb-pc-header {
    margin-bottom: 20px;
}

.aidb-pc-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aidb-pc-icon {
    font-size: 22px;
}

/* ============================
   サマリーセクション
   ============================ */
.aidb-pc-summaries {
    margin-bottom: 24px;
}

.aidb-pc-summaries-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.aidb-pc-summary-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-left: 3px solid #4a90d9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.aidb-pc-summary-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.aidb-pc-summary-content {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.aidb-pc-summary-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.aidb-pc-summary-content li {
    margin-bottom: 4px;
}

.aidb-pc-notable {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f7ff;
    border-radius: 6px;
    font-size: 13px;
    color: #2c5282;
}

/* ============================
   投稿フォーム
   ============================ */
.aidb-pc-compose {
    margin-bottom: 24px;
}

.aidb-pc-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}

.aidb-pc-textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

.aidb-pc-compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.aidb-pc-char-count {
    font-size: 12px;
    color: #999;
}

/* ============================
   ボタン
   ============================ */
.aidb-pc-btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    font-family: inherit;
}

.aidb-pc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aidb-pc-btn-primary {
    background: #4a90d9;
    color: #fff;
}

.aidb-pc-btn-primary:hover:not(:disabled) {
    background: #3a7bc8;
}

.aidb-pc-btn-secondary {
    background: #e8e8e8;
    color: #555;
}

.aidb-pc-btn-secondary:hover:not(:disabled) {
    background: #d8d8d8;
}

/* ============================
   コメント一覧
   ============================ */
.aidb-pc-comments-header {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 16px;
}

.aidb-pc-loading,
.aidb-pc-empty,
.aidb-pc-error {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
}

.aidb-pc-error {
    color: #d32f2f;
}

/* ============================
   個別コメント
   ============================ */
.aidb-pc-comment {
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
}

.aidb-pc-comment.aidb-pc-permanent {
    border-left: 3px solid #4caf50;
}

.aidb-pc-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.aidb-pc-user {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.aidb-pc-days-left {
    font-size: 12px;
    color: #999;
}

.aidb-pc-badge-permanent {
    font-size: 12px;
    color: #4caf50;
    font-weight: 500;
}

.aidb-pc-comment-body {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 8px;
}

.aidb-pc-comment-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* いいねボタン */
.aidb-pc-like-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.aidb-pc-like-btn:hover:not(:disabled) {
    border-color: #4a90d9;
    color: #4a90d9;
}

.aidb-pc-like-btn.liked {
    background: #e3f2fd;
    border-color: #4a90d9;
    color: #4a90d9;
}

.aidb-pc-like-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 返信・削除ボタン */
.aidb-pc-reply-btn,
.aidb-pc-delete-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
}

.aidb-pc-reply-btn:hover {
    color: #4a90d9;
}

.aidb-pc-delete-btn:hover {
    color: #d32f2f;
}

/* ============================
   返信
   ============================ */
.aidb-pc-replies {
    margin-top: 12px;
    margin-left: 24px;
    padding-left: 16px;
    border-left: 2px solid #e8e8e8;
}

.aidb-pc-reply {
    padding: 12px;
    margin-bottom: 8px;
}

.aidb-pc-reply:last-child {
    margin-bottom: 0;
}

/* 返信フォーム */
.aidb-pc-reply-form {
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.aidb-pc-reply-textarea {
    min-height: 60px;
}

.aidb-pc-reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.aidb-pc-reply-form-actions .aidb-pc-btn {
    padding: 6px 12px;
    font-size: 13px;
}

/* ============================
   ロック表示（非プレミアム）
   ============================ */
.aidb-pc-locked .aidb-pc-locked-content {
    text-align: center;
    padding: 32px 16px;
}

.aidb-pc-locked-message {
    font-size: 15px;
    color: #555;
    margin-bottom: 16px;
}

.aidb-pc-upsell-btn {
    text-decoration: none;
    font-size: 15px;
    padding: 12px 24px;
}

/* ============================
   コメントありバナー（記事上部）
   ============================ */
.aidb-pc-has-comments-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 24px;
    background: #e3f2fd;
    border-left: 3px solid #4a90d9;
    border-radius: 6px;
    font-size: 13px;
    color: #1565c0;
}

.aidb-pc-banner-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.aidb-pc-banner-text {
    font-weight: 600;
}

.aidb-pc-banner-link {
    margin-left: auto;
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.aidb-pc-banner-link:hover {
    text-decoration: underline;
}

/* ============================
   タイトル横コメントバッジ
   ============================ */
.aidb-pc-comment-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.aidb-pc-comment-badge:hover {
    background: #bbdefb;
    color: #1565c0;
    text-decoration: none;
}

/* ============================
   チラ見せプレビュー（非プレミアム）
   ============================ */
.aidb-pc-locked .aidb-pc-locked-content {
    text-align: center;
    padding: 16px;
}

.aidb-pc-locked-stats {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px 0;
}

.aidb-pc-preview-list {
    position: relative;
    overflow: hidden;
    text-align: left;
    margin-bottom: 16px;
}

.aidb-pc-preview-item {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 8px;
}

.aidb-pc-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.aidb-pc-preview-avatar {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    flex-shrink: 0;
    position: relative;
}

.aidb-pc-preview-avatar::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 8px;
    width: 12px;
    height: 12px;
    background: #bbb;
    border-radius: 50% 50% 50% 50%;
    clip-path: path('M6 0a3.5 3.5 0 0 1 3.5 3.5c0 1.9-1.6 3.5-3.5 3.5S2.5 5.4 2.5 3.5A3.5 3.5 0 0 1 6 0zm0 8c3.3 0 6 1.3 6 3v1H0v-1c0-1.7 2.7-3 6-3z');
}

.aidb-pc-preview-user {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.aidb-pc-preview-text {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.aidb-pc-preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(250, 250, 250, 0), rgba(250, 250, 250, 1));
    pointer-events: none;
}

.aidb-pc-locked-more {
    font-size: 12px;
    color: #888;
    margin: 0 0 16px 0;
}

.aidb-pc-locked .aidb-pc-upsell-btn {
    display: inline-block;
    text-decoration: none;
    font-size: 15px;
    padding: 12px 24px;
}

/* ============================
   レスポンシブ
   ============================ */
@media (max-width: 600px) {
    .aidb-pc-section {
        margin-top: 32px;
        padding: 16px;
        border-radius: 8px;
    }

    .aidb-pc-title {
        font-size: 16px;
    }

    .aidb-pc-comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .aidb-pc-replies {
        margin-left: 12px;
        padding-left: 12px;
    }

    .aidb-pc-comment-footer {
        flex-wrap: wrap;
    }

    .aidb-pc-has-comments-banner {
        font-size: 12px;
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .aidb-pc-banner-link {
        margin-left: 0;
        width: 100%;
        margin-top: 4px;
    }
}
