/* Feedback 게시판 — GitHub Issues 스타일 */

/* === Header: 탭 + 필터 === */
.fb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.fb-tabs {
    display: flex;
    gap: 4px;
}

.fb-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary-color);
    text-decoration: none;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}

.fb-tab:hover {
    color: var(--text-color);
}

.fb-tab--active {
    color: var(--text-color);
    font-weight: 700;
    border-bottom-color: var(--primary-color);
}

.fb-tab .material-icons {
    font-size: 18px;
}

.fb-tab-count {
    background: var(--surface-alt-color);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.fb-tab--active .fb-tab-count {
    background: var(--primary-color);
    color: white;
}

/* === 필터 컨트롤 === */
.fb-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fb-filter-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--surface-color);
    color: var(--text-secondary-color);
    cursor: pointer;
}

/* === 검색 === */
.fb-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.fb-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.fb-search input:focus {
    border-color: var(--primary-color);
}

.fb-search button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.15s;
}

.fb-search button:hover {
    background: var(--primary-dark);
}

.fb-search button .material-icons {
    font-size: 20px;
}

/* === 카테고리 라벨 (GitHub label 스타일) === */
.fb-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.fb-label--bug {
    background: #fce4ec;
    color: #c62828;
}

.fb-label--feature {
    background: #e3f2fd;
    color: #1565c0;
}

.fb-label--improvement {
    background: #e8f5e9;
    color: #2e7d32;
}

.fb-label--anki {
    background: #ede7f6;
    color: #5e35b1;
}

.fb-label--logseq {
    background: #fff9c4;
    color: #9e7f00;
}

.fb-label--inquiry {
    background: #f5f5f5;
    color: #666;
}

.fb-label--report {
    background: #fff3e0;
    color: #e65100;
}

/* === 상태 배지 === */
.fb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.fb-status--open        { background: #e8f5e9; color: #2e7d32; }
.fb-status--reviewing   { background: #fff3e0; color: #e65100; }
.fb-status--planned     { background: #e3f2fd; color: #1565c0; }
.fb-status--in_progress { background: #f3e5f5; color: #7b1fa2; }
.fb-status--completed   { background: #e0e0e0; color: #555; }
.fb-status--on_hold     { background: #fafafa; color: #999; border: 1px solid #eee; }

/* === 리스트 === */
.fb-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.fb-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface-color);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    align-items: flex-start;
}

.fb-item:hover {
    background: var(--surface-alt-color);
}

.fb-item-icon {
    flex-shrink: 0;
    padding-top: 2px;
}

.fb-item-icon .material-icons {
    font-size: 20px;
}

.fb-item-icon--open .material-icons {
    color: #2e7d32;
}

.fb-item-icon--closed .material-icons {
    color: #7b1fa2;
}

.fb-item-main {
    flex: 1;
    min-width: 0;
}

.fb-item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.fb-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.fb-item:hover .fb-item-title {
    color: var(--primary-color);
}

.fb-item-meta {
    display: flex;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted-color);
    flex-wrap: wrap;
    align-items: center;
}

.fb-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.fb-item-meta .material-icons {
    font-size: 14px;
}

/* === 페이지네이션 === */
.fb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.fb-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary-color);
    text-decoration: none;
    transition: background 0.15s;
}

.fb-page-btn:hover {
    background: var(--surface-alt-color);
}

.fb-page-info {
    font-size: 0.85rem;
    color: var(--text-muted-color);
}

/* === 이슈 번호 === */
.fb-issue-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted-color);
}

/* === 투표 버튼 === */
.fb-vote-section {
    display: flex;
    justify-content: flex-start;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.fb-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface-color);
    color: var(--text-secondary-color);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: inherit;
}

.fb-vote-btn:hover {
    border-color: var(--border-color);
    background: var(--surface-alt-color);
}

.fb-vote-btn--active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff3e0;
}

.fb-vote-btn--active:hover {
    background: #ffe0b2;
}

.fb-vote-btn .material-icons {
    font-size: 18px;
}

/* === 관리자 배지 (GitHub maintainer 스타일) === */
.fb-admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary-color);
    background: var(--surface-alt-color);
}

/* === 관리자 컨트롤 (상태 + 중복 한 줄) === */
.fb-admin-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

.fb-admin-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fb-admin-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary-color);
    white-space: nowrap;
}

.fb-admin-form select,
.fb-admin-form input[type="number"] {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--surface-color);
}

.fb-admin-form button {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.fb-admin-form button:hover {
    background: var(--primary-dark);
}

.fb-admin-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fb-admin-form button .fb-btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: fb-spin 0.6s linear infinite;
}

@keyframes fb-spin {
    to { transform: rotate(360deg); }
}

.fb-admin-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* === 카테고리 선택 (작성 폼) === */
.fb-category-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fb-category-selector input[type="radio"] {
    display: none;
}

.fb-category-selector label {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary-color);
    user-select: none;
}

.fb-category-selector label:hover {
    border-color: var(--border-color);
}

.fb-category-selector input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background: #fff3e0;
    color: var(--primary-color);
    font-weight: 600;
}

/* 각 카테고리 선택 시 해당 색상 */
.fb-category-selector input[name="category"][value="bug"]:checked + label {
    border-color: #c62828;
    background: #fce4ec;
    color: #c62828;
}

.fb-category-selector input[name="category"][value="feature"]:checked + label {
    border-color: #1565c0;
    background: #e3f2fd;
    color: #1565c0;
}

.fb-category-selector input[name="category"][value="improvement"]:checked + label {
    border-color: #2e7d32;
    background: #e8f5e9;
    color: #2e7d32;
}

.fb-category-selector input[name="category"][value="inquiry"]:checked + label {
    border-color: #666;
    background: #f5f5f5;
    color: #666;
}

/* === 상세 페이지 배지 행 === */
.fb-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* === 중복 배너 (상세 페이지 상단) === */
.fb-duplicate-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: #6a1b9a;
}

.fb-duplicate-banner .material-icons {
    font-size: 20px;
    flex-shrink: 0;
}

.fb-duplicate-banner a {
    color: #6a1b9a;
    font-weight: 600;
    text-decoration: none;
}

.fb-duplicate-banner a:hover {
    text-decoration: underline;
}

.fb-duplicate-banner-btn {
    padding: 4px 12px;
    border: 1px solid #ce93d8;
    border-radius: 6px;
    background: var(--surface-color);
    color: #7b1fa2;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.fb-duplicate-banner-btn:hover {
    background: #fce4ec;
}

/* === 중복 배지 (목록) === */
.fb-duplicate-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #f3e5f5;
    color: #7b1fa2;
    white-space: nowrap;
    flex-shrink: 0;
}

.fb-duplicate-badge .material-icons {
    font-size: 12px;
}

/* === 비공개 배지 === */
.fb-private-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #FFF3E0;
    color: #E65100;
}
.fb-private-badge .material-icons {
    font-size: 12px;
}

/* === 비공개 체크박스 (작성 폼) === */
.fb-private-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary-color);
    margin-top: 12px;
    transition: all 0.15s;
}
.fb-private-checkbox:hover {
    border-color: #F57C00;
    background: var(--tint-amber-bg);
}
.fb-private-checkbox:has(input:checked) {
    border-color: #F57C00;
    background: #FFF3E0;
    color: #E65100;
}
.fb-private-checkbox input[type="checkbox"] {
    display: none;
}
.fb-private-checkbox .material-icons {
    font-size: 18px;
}

/* === 연결된 중복 이슈 섹션 === */
.fb-linked-issues {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.fb-linked-issues-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fb-linked-issues-header .material-icons {
    font-size: 20px;
    color: #7b1fa2;
}

.fb-linked-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: color 0.15s;
}

.fb-linked-item:last-child {
    border-bottom: none;
}

.fb-linked-item:hover .fb-linked-item-title {
    color: var(--primary-color);
}

.fb-linked-item-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-linked-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    color: var(--text-muted-color);
    flex-shrink: 0;
}

.fb-linked-item-meta .material-icons {
    font-size: 14px;
}

/* === 시스템 댓글 (상태 변경 · 중복 연결) === */
.fb-system-comment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: #7b1fa2;
    white-space: nowrap;
    overflow: hidden;
}

.fb-system-comment .material-icons {
    font-size: 16px;
    flex-shrink: 0;
}

.fb-system-comment-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-system-comment .comment-item-date {
    color: var(--text-muted-color);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* feedback 댓글 영역: 댓글 폼 위 이중 구분선 방지 */
.comment-section > .fb-system-comment:last-of-type {
    border-bottom: none;
}
.comment-section > .comment-item:last-of-type {
    border-bottom: none;
}

/* === 댓글 잠금 (중복 이슈) === */
.fb-comment-locked {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted-color);
    font-size: 0.85rem;
    text-align: center;
}

.fb-comment-locked .material-icons {
    font-size: 18px;
    color: var(--text-muted-color);
}

.fb-comment-locked a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.fb-comment-locked a:hover {
    text-decoration: underline;
}

/* === 빈 상태 === */
.fb-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted-color);
}

.fb-empty .material-icons {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.fb-empty p {
    font-size: 0.92rem;
    margin: 0 0 4px;
}

.fb-empty .empty-sub {
    font-size: 0.82rem;
    color: var(--text-muted-color);
}

/* === 모바일 === */
@media (max-width: 767px) {
    .fb-header {
        flex-direction: column;
        align-items: stretch;
    }

    .fb-controls {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fb-item {
        padding: 14px 16px;
    }

    .fb-item-title-row {
        flex-wrap: wrap;
    }

    .fb-filter-select {
        font-size: 16px;
    }

    /* iOS 입력 확대 방지 */
    .fb-search input {
        font-size: 16px;
    }

    .fb-status-form select {
        font-size: 16px;
    }

    .fb-category-selector {
        gap: 6px;
    }

    .fb-category-selector label {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}

/* === 공지 배지 === */
.fb-notice-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ffebee;
    color: #e53935;
    flex-shrink: 0;
}

.fb-item--notice {
    background: var(--tint-yellow-bg);
}

.fb-item--notice:hover {
    background: var(--tint-yellow-bg-strong);
}
