/* community-feature-board.css — Community Feature Board (Fas 1) */

/* ─── Section ──────────────────────────────────────────────────────────── */
.community-feature-board-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
}

.cfb-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 4px 0;
}

.cfb-header h2 i {
    color: #818cf8;
    margin-right: 8px;
}

.cfb-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 16px 0;
}

/* ─── Filter-knappar ────────────────────────────────────────────────────── */
.cfb-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cfb-filter {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.cfb-filter:hover {
    border-color: #818cf8;
    color: #c7d2fe;
}

.cfb-filter.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #a5b4fc;
    font-weight: 600;
}

/* ─── Lista ─────────────────────────────────────────────────────────────── */
.cfb-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.3) transparent;
}

.cfb-list::-webkit-scrollbar { width: 5px; }
.cfb-list::-webkit-scrollbar-track { background: transparent; }
.cfb-list::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }

.cfb-loading,
.cfb-empty,
.cfb-error {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    padding: 32px 16px;
}

.cfb-error { color: #f87171; }

/* ─── Ticket-kort ────────────────────────────────────────────────────────── */
.cfb-ticket {
    display: flex;
    gap: 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.15s;
}

.cfb-ticket:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

/* Vänster: röstkolumn */
.cfb-ticket-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
    padding-top: 2px;
}

.cfb-vote-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cfb-vote-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1;
}

.cfb-vote-icon {
    font-size: 0.7rem;
    color: #475569;
}

/* Höger: innehåll */
.cfb-ticket-main {
    flex: 1;
    min-width: 0;
}

.cfb-ticket-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: #64748b;
}

.cfb-subject-icon { font-size: 0.9rem; }

.cfb-subject-label {
    font-weight: 600;
    color: #94a3b8;
}

.cfb-app-badge {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 1px 8px;
    color: #818cf8;
    font-size: 0.72rem;
}

.cfb-ticket-date { margin-left: auto; }

.cfb-ticket-body {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 10px;
    word-break: break-word;
}

.cfb-ticket-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ─── Status-badges ─────────────────────────────────────────────────────── */
.cfb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid;
}

.cfb-status-open        { color: #94a3b8; background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.2); }
.cfb-status-inprogress  { color: #60a5fa; background: rgba(96,165,250,0.1);  border-color: rgba(96,165,250,0.25); }
.cfb-status-escalated   { color: #fab005; background: rgba(250,176,5,0.1);   border-color: rgba(250,176,5,0.3); }
.cfb-status-implemented { color: #34d399; background: rgba(52,211,153,0.1);  border-color: rgba(52,211,153,0.25); }
.cfb-status-wontfix     { color: #f87171; background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.25); }
.cfb-status-disputed    { color: #fb923c; background: rgba(251,146,60,0.1);  border-color: rgba(251,146,60,0.25); }

.cfb-escalation-note {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

/* ─── Light theme ────────────────────────────────────────────────────────── */
body.light-theme .community-feature-board-panel,
body.theme-light .community-feature-board-panel {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .cfb-header h2,
/* theme-light override removed - uses var(--text-primary) */

body.light-theme .cfb-subtitle,
body.theme-light .cfb-subtitle { color: #64748b; }

body.light-theme .cfb-filter,
body.theme-light .cfb-filter {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

body.light-theme .cfb-filter.active,
body.theme-light .cfb-filter.active {
    background: rgba(99,102,241,0.08);
    border-color: #6366f1;
    color: #6366f1;
}

body.light-theme .cfb-ticket,
body.theme-light .cfb-ticket {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .cfb-ticket-body,
body.theme-light .cfb-ticket-body { color: #334155; }

body.light-theme .cfb-vote-num,
body.theme-light .cfb-vote-num { color: #475569; }

body.light-theme .cfb-subject-label,
body.theme-light .cfb-subject-label { color: #475569; }

/* Expandera-knapp */
.cfb-expand-btn {
    background: none;
    border: none;
    color: #818cf8;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 4px;
    display: block;
    text-decoration: underline;
}
.cfb-expand-btn:hover { color: #a5b4fc; }
.cfb-ellipsis { color: #64748b; }

/* Parent-badge */
.cfb-parent-badge {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    font-style: italic;
}
.cfb-parent-badge em { color: #94a3b8; font-style: normal; }

/* Svar */
.cfb-response {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.06);
    border-left: 3px solid #6366f1;
    border-radius: 0 6px 6px 0;
}
.cfb-response-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 4px;
}
.cfb-response-text {
    font-size: 0.83rem;
    color: #cbd5e1;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

body.light-theme .cfb-response,
body.theme-light .cfb-response {
    background: rgba(99,102,241,0.05);
}
body.light-theme .cfb-response-text,
body.theme-light .cfb-response-text { color: #334155; }

/* User badge */
.cfb-user-badge {
    font-size: 0.72rem;
    color: #64748b;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1px 8px;
}

body.light-theme .cfb-user-badge,
body.theme-light .cfb-user-badge {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Language toggle */
.cfb-lang-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.73rem;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 2px;
    display: inline-block;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cfb-lang-toggle:hover { color: #94a3b8; }

/* ─── Vote-knapp ──────────────────────────────────────────────────────────── */
.cfb-vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 10px;
    cursor: pointer;
    min-width: 52px;
    transition: all 0.15s;
    line-height: 1.2;
}

.cfb-vote-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99,102,241,0.1);
}

.cfb-vote-btn:disabled {
    cursor: default;
}

.cfb-vote-btn--voted {
    border-color: rgba(52,211,153,0.4) !important;
    color: #34d399 !important;
    background: rgba(52,211,153,0.08) !important;
}

.cfb-vote-num {
    font-size: 1rem;
    font-weight: 700;
}

.cfb-gate-badge {
    font-size: 0.7rem;
    margin-top: 2px;
}

.cfb-vote-error {
    font-size: 0.72rem;
    color: #f87171;
    margin-left: 6px;
}

body.light-theme .cfb-vote-btn,
body.theme-light .cfb-vote-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

body.light-theme .cfb-vote-btn:hover:not(:disabled),
body.theme-light .cfb-vote-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99,102,241,0.06);
}

/* ─── Admin-panel ────────────────────────────────────────────────────────── */
.cfb-admin-panel {
    background: rgba(250, 176, 5, 0.06);
    border: 1px solid rgba(250, 176, 5, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.cfb-admin-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fab005;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}

.cfb-admin-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cfb-admin-select {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.82rem;
    padding: 6px 10px;
    cursor: pointer;
}

.cfb-admin-select:first-of-type { flex: 1; min-width: 200px; }

.cfb-admin-save-btn {
    background: #fab005;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 16px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.cfb-admin-save-btn:hover { opacity: 0.85; }

.cfb-admin-feedback {
    font-size: 0.78rem;
    font-weight: 600;
}

.cfb-status-answered    { color: #60a5fa; background: rgba(96,165,250,0.1);  border-color: rgba(96,165,250,0.25); }

/* Priority voting banner */
.cfb-priority-banner {
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    color: #c4b5fd;
}

.cfb-priority-mode-btn {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 0.78rem;
    padding: 3px 10px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.15s;
}
.cfb-priority-mode-btn:hover { background: rgba(167,139,250,0.25); }


/* --- Implementation-bekr�ftelse (Steg 5b) -------------------------------- */
.cfb-impl-vote-section {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(52, 211, 153, 0.04);
    border: 1px solid rgba(52, 211, 153, 0.15);
    border-radius: 8px;
}

.cfb-impl-title {
    font-size: 0.77rem;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 8px;
}

.cfb-impl-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cfb-impl-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.cfb-impl-btn:hover:not(:disabled) {
    background: var(--surface-color);
    color: var(--text-primary);
}

.cfb-impl-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.cfb-impl-btn--yes:hover:not(:disabled) {
    border-color: #34d399;
    color: #34d399;
    background: rgba(52,211,153,0.08);
}

.cfb-impl-btn--partial:hover:not(:disabled) {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(251,191,36,0.08);
}

.cfb-impl-btn--no:hover:not(:disabled) {
    border-color: #f87171;
    color: #f87171;
    background: rgba(248,113,113,0.08);
}

.cfb-impl-voted-label {
    font-size: 0.78rem;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 6px;
}

.cfb-impl-result {
    margin-top: 8px;
}

.cfb-impl-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface-color);
    margin-bottom: 4px;
}

.cfb-impl-bar-yes     { background: #34d399; transition: width 0.4s ease; }
.cfb-impl-bar-partial { background: #fbbf24; transition: width 0.4s ease; }
.cfb-impl-bar-no      { background: #f87171; transition: width 0.4s ease; }

.cfb-impl-result-label {
    font-size: 0.73rem;
    color: #64748b;
    margin-top: 2px;
}

body.light-theme .cfb-impl-vote-section,
body.theme-light .cfb-impl-vote-section {
    background: rgba(52,211,153,0.03);
    border-color: rgba(52,211,153,0.2);
}

body.light-theme .cfb-impl-btn,
body.theme-light .cfb-impl-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

/* --- Needs Work badge ----------------------------------------------------- */
.cfb-needs-work-badge {
    display: inline-block;
    background: #f87171;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.4;
}

/* --- Priority Ranking header ---------------------------------------------- */
.cfb-ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: #c4b5fd;
    font-weight: 600;
}

.cfb-ranking-votes-left {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 400;
}

.cfb-ranking-votes-left strong {
    color: #a78bfa;
    font-weight: 700;
}


/* --- Pagination (Steg 5d) --- */
.cfb-counter {
    font-size: 0.75rem;
    color: #475569;
    text-align: right;
    margin-bottom: 8px;
    min-height: 1em;
}

.cfb-load-more-spinner {
    text-align: center;
    color: #475569;
    font-size: 0.8rem;
    padding: 12px;
    animation: cfb-pulse 1.2s ease-in-out infinite;
}

@keyframes cfb-pulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* --- Follow-up thread polish (Steg 6) ------------------------------------ */

/* Indent child tickets */
.cfb-ticket--child {
    margin-left: 20px;
    border-left: 3px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 0 10px 10px 0 !important;
}

.cfb-ticket--child:hover {
    border-left-color: rgba(99, 102, 241, 0.6) !important;
}

/* Thread highlight pulse */
.cfb-ticket--thread-highlight {
    border-color: rgba(99, 102, 241, 0.6) !important;
    background: rgba(99, 102, 241, 0.06) !important;
    transition: background 0.3s, border-color 0.3s;
}

/* Thread reply count button */
.cfb-thread-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
    margin-left: auto;
}

.cfb-thread-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

body.light-theme .cfb-ticket--child,
body.theme-light .cfb-ticket--child {
    border-left-color: rgba(99, 102, 241, 0.4) !important;
}

body.light-theme .cfb-thread-btn,
body.theme-light .cfb-thread-btn {
    color: #6366f1;
}