/* ============================================================
   community.css — Customer Community forum panel
   ============================================================ */

.community-view {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 5rem;
}
.community-view {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.community-view::-webkit-scrollbar { width: 10px; }
.community-view::-webkit-scrollbar-track { background: transparent; }
.community-view::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.community-view::-webkit-scrollbar-thumb:hover { background: var(--comm-card-hover-border); }
.community-view.hidden { display: none; }

.community-inner  {
    max-width: 720px;
    margin: 0 auto;
    padding-top: 1.2rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.community-header { margin-bottom: 1.4rem; }
.community-header h2 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.3rem; }
.community-meta  { font-size: 0.82rem; color: var(--muted); }

/* Topic card list */
.topic-list { display: grid; gap: 0.6rem; }
.topic-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
    background: var(--comm-card-bg);
}
.topic-card:hover {
    border-color: var(--comm-card-hover-border);
    background: var(--comm-card-hover-bg);
}
.topic-card-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.2rem; }
.topic-card-desc  { font-size: 0.78rem; color: var(--muted); }
.topic-card-meta  { font-size: 0.73rem; color: var(--comm-card-meta); margin-top: 0.45rem; }

/* Back button */
.community-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0 0 0.9rem;
    font-family: inherit;
}
.community-back:hover { color: var(--text); }

/* Thread view */
.thread-header { border-bottom: 1px solid var(--line); padding-bottom: 0.9rem; margin-bottom: 1rem; }
.thread-header h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.thread-posts { display: grid; gap: 0.7rem; margin-bottom: 1.4rem; }

.thread-post {
    background: var(--comm-post-bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
}
.thread-post-author { font-size: 0.78rem; font-weight: 600; color: var(--comm-post-author); margin-bottom: 0.3rem; }
.thread-post-body   { font-size: 0.88rem; line-height: 1.6; white-space: pre-wrap; }
.thread-post-time   { font-size: 0.7rem; color: var(--comm-post-time); margin-top: 0.35rem; }
.thread-empty       { font-size: 0.84rem; color: var(--muted); padding: 0.4rem 0 0.8rem; }

/* Reply form */
.thread-reply { border-top: 1px solid var(--line); padding-top: 1rem; }
.thread-reply .row { justify-content: flex-end; }
.reply-submit-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--reply-btn-bg-start) 0%, var(--reply-btn-bg-end) 100%);
    color: var(--reply-btn-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease;
}
.reply-submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    border-color: var(--reply-btn-hover-border);
}
.reply-submit-btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

/* Bottom community search */
.community-search-wrap {
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 0.62rem;
}
.community-search-minimal {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    background: var(--bg);
}
.community-search-dock {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    background: var(--bg);
    padding-top: 0.5rem;
    padding-bottom: 1.1rem;
    z-index: 20;
    transform: translateZ(0);
    will-change: transform;
}
.community-search-dock::before {
    content: '';
    display: block;
    position: absolute;
    top: -3rem;
    left: 0;
    right: 0;
    height: 3rem;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
}
.community-search-label {
    font-size: 0.73rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}
.community-search-stage {
    width: 100%;
    margin-top: 0;
}
.community-search-dock .search-wrap {
    min-height: 46px;
    border-radius: 22px;
    padding: 0.24rem 0.38rem;
}
.community-search-dock .search-wrap .text-input {
    font-size: 0.95rem;
}
.community-search-dock .composer-icon-btn {
    width: 30px;
    height: 30px;
}
.community-search-minimal .community-search-stage { margin-top: 0; }
.community-search-results {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
    max-height: 36vh;
    overflow-y: auto;
}
.community-search-hit {
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--comm-card-bg);
    color: var(--text);
    padding: 0.65rem 0.75rem;
    cursor: pointer;
}
.community-search-hit:hover {
    border-color: var(--comm-card-hover-border);
    background: var(--comm-card-hover-bg);
}
.community-search-hit-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.community-search-hit-topic {
    font-size: 0.8rem;
    font-weight: 600;
}
.community-search-hit-kind {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.community-search-hit-text {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
}
.community-search-empty {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ---- Documentation cards / search ---- */
.docs-card {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.docs-link {
    margin-top: 0.45rem;
    display: inline-flex;
    font-size: 0.82rem;
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.docs-link:hover { opacity: 0.8; }
.docs-card-hit {
    border-color: var(--comm-card-hover-border);
    box-shadow: 0 0 0 1px var(--comm-card-hover-border);
}

/* ---- Education cards ---- */
.education-list { gap: 0.75rem; }
.education-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.education-section {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    margin-bottom: 1.2rem;
}
.education-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.education-section-head h3 {
    font-size: 0.88rem;
    font-weight: 600;
}
.education-card {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    margin-bottom: 0.5rem;
}
.education-compact-btn {
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel);
    color: var(--text);
    padding: 0.45rem 0.56rem;
    display: grid;
    gap: 0.14rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
}
.education-compact-btn:last-child { margin-bottom: 0; }
.education-compact-btn:hover {
    border-color: var(--comm-card-hover-border);
    background: var(--comm-card-hover-bg);
}
.education-compact-title {
    font-size: 0.82rem;
    font-weight: 600;
}
.education-compact-summary {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
}
.education-compact-meta {
    font-size: 0.68rem;
    color: var(--comm-card-meta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.education-embed-wrap {
    margin-top: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
    background: #000;
}
.education-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}
.education-content {
    margin-top: 0.55rem;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--muted);
}
.education-detail-body {
    margin-bottom: 0.5rem;
}

/* ---- Ticket cards ---- */
.ticket-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.55rem;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
    background: var(--comm-card-bg);
}
.ticket-card:hover { border-color: var(--comm-card-hover-border); background: var(--comm-card-hover-bg); }

.ticket-card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.ticket-detail-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.ticket-card-id {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.04em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.ticket-card-title { font-size: 0.94rem; font-weight: 500; margin-bottom: 0.22rem; }
.ticket-card-meta  { font-size: 0.75rem; color: var(--muted); }

/* Status pills */
.ticket-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.12rem 0.52rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.ticket-status-resolved   { background: rgba(142, 203, 149, 0.15); color: var(--ok); }
.ticket-status-open       { background: rgba(214, 162, 90, 0.15);  color: #d6a25a; }
.ticket-status-in-progress{ background: rgba(100, 160, 240, 0.15); color: #64a0f0; }

/* Resolution vs pending post styling */
.ticket-resolution .thread-post-author { color: var(--ok); }
.ticket-pending    .thread-post-author { color: var(--muted); }

[data-theme="light"] .ticket-status-resolved    { background: rgba(21, 128, 61, 0.1);  color: #15803d; }
[data-theme="light"] .ticket-status-open        { background: rgba(180, 120, 20, 0.12); color: #92600f; }
[data-theme="light"] .ticket-status-in-progress { background: rgba(37, 99, 235, 0.1);  color: #2563eb; }

/* Community list (legacy small view) */
.community-list { list-style: none; margin-top: 0.5rem; display: grid; gap: 0.35rem; }
.community-list li {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--list-item-bg);
    padding: 0.52rem;
    color: #c7d2ec;
    font-size: 0.81rem;
    line-height: 1.4;
}
.community-list strong { color: var(--text); }
