/* ════════════════════════════════════════════════════════════
 * GBI Slawi — community.css
 * Tab komunitas digital
 * ════════════════════════════════════════════════════════════ */

/* ================================================
   KOMUNITAS DIGITAL
   ================================================ */

.section-komunitas-digital {
    padding: 100px 24px;
    background: var(--bg);
}

/* ── TABS ── */
.kom-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.kom-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    border-radius: 8px 8px 0 0;
}

.kom-tab:hover {
    color: var(--text);
    background: var(--bg3);
}

.kom-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: var(--bg3);
}

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

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

/* ── FORM SHARED ── */
.kom-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.kom-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
}

.kom-optional {
    font-weight: 400;
    color: var(--text3);
}

.kom-input {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg4);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.kom-input:focus {
    border-color: var(--gold-border);
}

.kom-textarea {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg4);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

.kom-textarea:focus {
    border-color: var(--gold-border);
}

.kom-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kom-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
}

.kom-radio input {
    accent-color: var(--gold);
}

.kom-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.kom-form-row {
    display: flex;
    gap: 10px;
}

.kom-submit-btn {
    width: 100%;
    margin-top: 8px;
}

/* ── UPLOAD ── */
.kom-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg4);
}

.kom-upload-area:hover {
    border-color: var(--gold-border);
    background: var(--gold-dim);
}

.kom-upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.kom-upload-text {
    font-size: 14px;
    color: var(--text2);
}

.kom-upload-sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: 4px;
}

.kom-file-preview {
    padding: 10px 14px;
    background: var(--bg4);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text2);
    margin-top: 8px;
}

/* ── PESAN GRID ── */
.kom-pesan-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: flex-start;
}

.kom-form-card {
    padding: 28px;
}

.kom-tracking-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 88px;
    /* navbar height + sedikit jarak */
    max-height: calc(100vh - 108px);
}

.kom-tracking-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* penting agar flex child bisa shrink */
    overflow: hidden;
}

.kom-tracking-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
    /* search bar tidak ikut di-scroll */
}

.kom-track-btn {
    white-space: nowrap;
}

.kom-tracking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 420px;
    padding-right: 4px;
    /* ruang scrollbar */
    /* Scrollbar tipis & sesuai tema */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.kom-tracking-list::-webkit-scrollbar {
    width: 4px;
}

.kom-tracking-list::-webkit-scrollbar-track {
    background: transparent;
}

.kom-tracking-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}

.kom-tracking-list::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.kom-tracking-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.kom-tracking-item:last-child {
    border-bottom: none;
}

.kom-tracking-jenis {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

.kom-tracking-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.kom-tracking-meta {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.kom-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    margin-top: 1px;
    flex-shrink: 0;
}

.status-proses {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-selesai {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-menunggu {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

/* ── Animasi highlight saat status berubah (real-time polling) ── */
@keyframes statusChanged {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
        transform: scale(1);
    }

    40% {
        box-shadow: 0 0 0 6px rgba(251, 191, 36, 0);
        transform: scale(1.08);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
        transform: scale(1);
    }
}

@keyframes itemFlash {
    0% {
        background: transparent;
    }

    25% {
        background: rgba(251, 191, 36, 0.08);
    }

    75% {
        background: rgba(251, 191, 36, 0.05);
    }

    100% {
        background: transparent;
    }
}

.kom-status-badge.status-changed {
    animation: statusChanged 0.7s ease forwards;
}

.kom-tracking-item.item-status-changed {
    animation: itemFlash 1.2s ease forwards;
    border-radius: 8px;
}

/* ── NOTIFIKASI ── */
.kom-notif-card {
    padding: 24px;
}

.kom-notif-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.kom-notif-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s;
}

.kom-notif-item.unread {
    background: var(--gold-dim);
}

.kom-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    margin-top: 5px;
}

.kom-notif-item:not(.unread) .kom-notif-dot {
    background: var(--border);
}

.kom-notif-body {
    flex: 1;
}

.kom-notif-text {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
}

.kom-notif-time {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
}

.kom-notif-all {
    background: none;
    border: none;
    color: var(--text3);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.kom-notif-all:hover {
    color: var(--gold);
}

/* ── FORUM ── */
.kom-forum-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.kom-post-form {
    padding: 24px;
    margin-bottom: 20px;
}

.kom-forum-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kom-forum-item {
    display: flex;
    gap: 14px;
    padding: 20px;
}

.kom-forum-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg4);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.kom-forum-avatar.has-photo {
    background: transparent;
    border-color: var(--border);
}

.kom-forum-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.kom-forum-body {
    flex: 1;
    min-width: 0;
}

.kom-forum-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.kom-forum-author {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.kom-forum-time {
    font-size: 12px;
    color: var(--text3);
}

.kom-forum-role-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.role-jemaat {
    background: var(--gold-dim);
    color: var(--gold);
}

.role-admin {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.kom-forum-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.kom-forum-preview {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 12px;
}

.kom-forum-footer {
    display: flex;
    gap: 10px;
}

.kom-forum-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.kom-forum-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.kom-forum-btn.liked {
    color: var(--gold);
    border-color: var(--gold);
}

.kom-reply-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.kom-reply-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.kom-reply-item {
    display: flex;
    gap: 10px;
}

.kom-reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg4);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.kom-reply-body {
    flex: 1;
    background: var(--bg4);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text2);
}

.kom-reply-body p {
    margin: 4px 0 0;
}

.kom-reply-input-wrap {
    display: flex;
    gap: 8px;
}

.kom-reply-send {
    white-space: nowrap;
}

/* ── PROFIL ── */
.kom-profil-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    align-items: flex-start;
}

.kom-profil-card {
    padding: 28px;
    text-align: center;
}

.kom-profil-avatar-wrap {
    position: relative;
    width: 80px;
    margin: 0 auto 16px;
}

.kom-profil-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg4);
    border: 3px solid var(--gold-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
}

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

.kom-avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kom-profil-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.kom-profil-role {
    margin-bottom: 20px;
}

.kom-profil-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.kom-profil-stat {
    text-align: center;
}

.stat-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
}

.stat-lbl {
    font-size: 11px;
    color: var(--text3);
}

.kom-profil-edit {
    padding: 28px;
}

.kom-riwayat-card {
    padding: 24px;
}

.kom-riwayat-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kom-riwayat-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.kom-riwayat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.kom-riwayat-body {
    flex: 1;
}

.kom-riwayat-text {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
}

.kom-riwayat-time {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

/* ── LEADERBOARD ── */
.kom-leaderboard-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kom-lb-header {
    text-align: center;
}

.kom-lb-header h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.kom-lb-header p {
    color: var(--text2);
    font-size: 14px;
}

.kom-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    padding: 32px 0;
}

.kom-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 120px;
}

.kom-podium-crown {
    font-size: 24px;
}

.kom-podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg4);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.podium-1 .kom-podium-avatar {
    width: 80px;
    height: 80px;
    border-color: var(--gold);
    font-size: 36px;
}

.kom-podium-name {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

.kom-podium-score {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
}

.kom-podium-rank {
    font-size: 20px;
}

.kom-lb-list {
    padding: 8px 16px;
}

.kom-lb-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
}

.kom-lb-item:last-child {
    border-bottom: none;
}

.kom-lb-no {
    font-size: 16px;
    font-weight: 900;
    color: var(--text3);
    min-width: 24px;
}

.kom-lb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kom-lb-info {
    flex: 1;
}

.kom-lb-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.kom-lb-badges {
    font-size: 11px;
    color: var(--text3);
}

.kom-lb-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
}

.kom-badge-list {
    display: flex;
    gap: 4px;
}

.kom-badge {
    font-size: 16px;
}

.kom-badge-info {
    padding: 24px;
}

.kom-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.kom-badge-item {
    text-align: center;
    padding: 16px 12px;
    background: var(--bg4);
    border-radius: 12px;
}

.kom-badge-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.kom-badge-name {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.kom-badge-desc {
    font-size: 11px;
    color: var(--text3);
}

/* ── PENGUMUMAN ── */
.kom-pengumuman-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#peng-list-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kom-pengumuman-item {
    padding: 28px 28px 22px;
    margin-top: 20px;
    margin-bottom: 20px;
}

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

.kom-pengumuman-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.badge-penting {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.badge-info {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

/* .badge-umum {
    background: var(--bg4);
    color: var(--text3);
} */

.badge-umum {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.kom-pengumuman-date {
    font-size: 12px;
    color: var(--text3);
}

.kom-pengumuman-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.kom-pengumuman-body {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.7;
    margin-bottom: 16px;
}

.kom-pengumuman-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kom-pengumuman-author {
    font-size: 12px;
    color: var(--text3);
}

/* ── ULANG TAHUN ── */
.kom-ultah-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kom-ultah-header {
    text-align: center;
}

.kom-ultah-header h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.kom-ultah-header p {
    color: var(--text2);
    font-size: 14px;
}

.kom-ultah-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kom-ultah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.kom-ultah-item {
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.kom-ultah-item.today-bday {
    border-color: var(--gold-border);
    background: var(--gold-dim);
}

.kom-ultah-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

/* Foto jemaat */
.ultah-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border: 2px solid var(--border);
    transition: border-color .2s;
}

.kom-ultah-item.today-bday .ultah-avatar-img {
    border-color: var(--gold);
}

/* Fallback inisial jika foto tidak ada */
.ultah-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
    border: 2px solid var(--border);
}

.ultah-avatar-fallback.female {
    background: linear-gradient(135deg, #f9a8d4, #f472b6);
    color: #831843;
    border-color: #f9a8d4;
}

.ultah-avatar-fallback.male {
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    color: #1e3a5f;
    border-color: #93c5fd;
}

/* Ring kuning melingkari avatar pada hari ulang tahun */
.ultah-avatar-today-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2.5px solid var(--gold);
    animation: ultahRingPulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ultahRingPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .55;
        transform: scale(1.07);
    }
}

.kom-ultah-name {
    font-size: 14px;
    font-weight: 700;
}

.kom-ultah-date {
    font-size: 12px;
    color: var(--text3);
}

.kom-doakan-btn {
    width: 100%;
}

/* ── RESPONSIVE KOMUNITAS ── */
@media (max-width: 1024px) {
    .kom-pesan-grid {
        grid-template-columns: 1fr;
    }

    /* Di layar kecil: sidebar tidak sticky, scroll area lebih pendek */
    .kom-tracking-side {
        position: static;
        max-height: none;
    }

    .kom-tracking-list {
        max-height: 300px;
    }

    .kom-profil-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section-komunitas-digital {
        padding-top: calc(65px + 48px);
        padding-left: 16px;
        padding-right: 16px;
    }

    .kom-tabs {
        gap: 4px;
    }

    .kom-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .kom-podium {
        gap: 8px;
    }

    .kom-podium-item {
        min-width: 90px;
    }

    .kom-lb-item {
        flex-wrap: wrap;
    }

    .kom-forum-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

