/* ============================================================
   LANGLR Community V2 Styles
   ============================================================ */

/* ── レイアウト ── */
.cv2-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
}

.cv2-page-header {
    margin-bottom: 24px;
}

.cv2-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.cv2-page-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ── タブ ── */
.cv2-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 24px;
}

.cv2-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.cv2-tab:hover {
    color: #1a1a2e;
}

.cv2-tab-active {
    color: #4361ee;
    border-bottom-color: #4361ee;
}

.cv2-tab-content {
    display: none;
}

.cv2-tab-content-active {
    display: block;
}

/* ── カテゴリセクション ── */
.cv2-category-section {
    margin-bottom: 32px;
}

.cv2-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* ── コミュニティグリッド ── */
.cv2-community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.cv2-community-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.2s;
    position: relative;
}

.cv2-community-card:hover {
    border-color: #4361ee;
    box-shadow: 0 2px 12px rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

.cv2-community-card.cv2-joined {
    border-color: #4361ee;
    background: #f8f9ff;
}

.cv2-community-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.cv2-community-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.cv2-community-members {
    font-size: 11px;
    color: #999;
}

.cv2-joined-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    background: #4361ee;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}

.cv2-region-card {
    padding: 20px 16px;
}

/* ── コミュニティヘッダー ── */
.cv2-community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.cv2-community-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cv2-community-big-icon {
    font-size: 48px;
}

.cv2-member-count {
    font-size: 14px;
    color: #666;
    margin: 4px 0 0;
}

/* ── ボタン ── */
.cv2-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.cv2-btn-primary {
    background: #4361ee;
    color: #fff;
}

.cv2-btn-primary:hover {
    background: #3a56d4;
}

.cv2-btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.cv2-btn-outline:hover {
    border-color: #999;
    color: #333;
}

/* ── コントロールバー ── */
.cv2-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.cv2-translate-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.cv2-translate-mode label {
    color: #666;
}

.cv2-translate-mode-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* ── クォータバー ── */
.cv2-quota-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.cv2-quota-bar.warning {
    color: #e67e22;
}

.cv2-quota-bar.danger {
    color: #e74c3c;
}

.cv2-quota-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
}

.cv2-quota-plan {
    font-weight: 600;
    color: #4361ee;
}

.cv2-quota-progress {
    width: 120px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.cv2-quota-progress-bar {
    height: 100%;
    background: #4361ee;
    border-radius: 3px;
    transition: width 0.3s;
}

.cv2-quota-bar.warning .cv2-quota-progress-bar {
    background: #e67e22;
}

.cv2-quota-bar.danger .cv2-quota-progress-bar {
    background: #e74c3c;
}

/* ── ソートバー ── */
.cv2-sort-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.cv2-sort-link {
    font-size: 13px;
    color: #999;
    text-decoration: none;
    padding-bottom: 4px;
}

.cv2-sort-active {
    color: #4361ee;
    border-bottom: 2px solid #4361ee;
    font-weight: 600;
}

/* ── 投稿フォーム ── */
.cv2-post-form-container {
    margin-bottom: 24px;
}

.cv2-post-form {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px;
}

.cv2-post-textarea {
    width: 100%;
    min-height: 80px;
    border: none;
    resize: vertical;
    font-size: 14px;
    line-height: 1.5;
    padding: 0;
    outline: none;
    font-family: inherit;
}

.cv2-post-textarea::placeholder {
    color: #aaa;
}

.cv2-post-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.cv2-image-upload-btn {
    font-size: 13px;
    color: #666;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.cv2-image-upload-btn:hover {
    background: #f0f0f0;
}

.cv2-image-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
}

.cv2-image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.cv2-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
}

/* ── 投稿カード ── */
.cv2-post-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.cv2-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cv2-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.cv2-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.cv2-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv2-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #4361ee;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.cv2-author-info {
    display: flex;
    flex-direction: column;
}

.cv2-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.cv2-community-label {
    font-size: 11px;
    color: #4361ee;
}

.cv2-post-time {
    font-size: 11px;
    color: #999;
}

.cv2-post-lang {
    font-size: 11px;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    color: #666;
}

/* ── 投稿本文 ── */
.cv2-post-body {
    margin-bottom: 12px;
    line-height: 1.6;
}

.cv2-post-body p {
    margin: 0;
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

.cv2-translation-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 8px 0;
}

.cv2-translated-text {
    font-size: 14px;
    color: #4361ee;
    font-style: italic;
}

/* ── 投稿画像 ── */
.cv2-post-image {
    margin-bottom: 12px;
}

.cv2-post-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: cover;
}

/* ── アクションバー ── */
.cv2-post-actions {
    display: flex;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.cv2-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: none;
    border: none;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.cv2-action-btn:hover {
    background: #f0f0f0;
}

.cv2-like-btn.cv2-liked {
    color: #e74c3c;
}

.cv2-translate-btn {
    margin-left: auto;
}

/* ── コメントセクション ── */
.cv2-comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.cv2-comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.cv2-comment-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.cv2-comment-item .cv2-avatar {
    width: 28px;
    height: 28px;
}

.cv2-comment-content {
    flex: 1;
}

.cv2-comment-author {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
}

.cv2-comment-text {
    font-size: 13px;
    color: #333;
    margin: 2px 0;
}

.cv2-comment-time {
    font-size: 11px;
    color: #999;
}

.cv2-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cv2-comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

.cv2-comment-input:focus {
    border-color: #4361ee;
}

.cv2-comment-submit {
    padding: 8px 16px;
    background: #4361ee;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.cv2-comment-submit:hover {
    background: #3a56d4;
}

/* ── 空状態 ── */
.cv2-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #999;
}

.cv2-empty-state p {
    margin: 0 0 16px;
}

/* ── ページネーション ── */
.cv2-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

/* ── レスポンシブ ── */
@media (max-width: 600px) {
    .cv2-container {
        padding: 12px;
    }

    .cv2-community-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    .cv2-community-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .cv2-controls-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .cv2-quota-progress {
        width: 80px;
    }

    .cv2-page-title {
        font-size: 20px;
    }
}
