:root {
    --community-bg: #f4f7fb;
    --community-primary: #2563eb;
    --community-dark: #0f172a;
}
body.community-body { background: var(--community-bg); }
.community-navbar { border-bottom: 1px solid rgba(15,23,42,.08); }
.hero-community {
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
    color: #fff;
    border-radius: 28px;
    padding: 42px 30px;
    position: relative;
    overflow: hidden;
}
.hero-community:after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 260px;
    height: 260px;
    background: rgba(255,255,255,.16);
    border-radius: 50%;
}
.stat-card, .community-card, .online-member-card, .room-card {
    background: #fff;
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.stat-card { padding: 20px; }
.stat-number { font-size: 32px; font-weight: 800; color: var(--community-dark); }
.stat-label { color: #64748b; font-size: 14px; }
.online-member-card { padding: 16px; transition: .2s ease; }
.online-member-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15,23,42,.1); }
.member-avatar-lg { width: 76px; height: 76px; object-fit: cover; border-radius: 50%; border: 4px solid #eef2ff; }
.member-avatar-md { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; }
.room-card { padding: 18px; height: 100%; }
.room-icon { width: 52px; height: 52px; border-radius: 16px; background: #eef2ff; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.profile-cover {
    height: 210px;
    border-radius: 24px;
    background: linear-gradient(135deg, #2563eb, #9333ea);
    background-size: cover;
    background-position: center;
}
.public-profile-avatar {
    width: 136px;
    height: 136px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid #fff;
    margin-top: -68px;
    background: #fff;
}
.badge-soft { background: #eef2ff; color: #3730a3; }
.nav-pills .nav-link.active { background: var(--community-primary); }
.small-muted { color:#64748b; font-size: 13px; }
@media (max-width: 767px) {
    .hero-community { padding: 30px 20px; border-radius: 20px; }
    .stat-number { font-size: 26px; }
    .profile-cover { height: 150px; }
}

/* v11 profile community */
.profile-info-list { display: grid; gap: 10px; }
.profile-info-item { display:flex; justify-content:space-between; gap:12px; padding:12px 14px; background:#f8fafc; border-radius:14px; border:1px solid rgba(15,23,42,.06); }
.profile-info-item .label { color:#64748b; font-size:13px; }
.profile-info-item .value { font-weight:700; color:#0f172a; text-align:right; }
.interest-chip { display:inline-flex; align-items:center; gap:6px; padding:7px 11px; border-radius:999px; background:#eef2ff; color:#3730a3; font-size:13px; margin:0 6px 6px 0; }
.profile-action-card { background:#fff; border-radius:20px; border:1px solid rgba(15,23,42,.08); padding:18px; box-shadow:0 10px 28px rgba(15,23,42,.06); }
.profile-cover.profile-cover-tall { height:260px; }
.profile-meta-pill { border:1px solid rgba(15,23,42,.08); background:#fff; border-radius:999px; padding:7px 12px; font-size:13px; color:#475569; }
.quote-box { background:linear-gradient(135deg,#eff6ff,#f5f3ff); border:1px solid rgba(37,99,235,.12); border-radius:18px; padding:18px; color:#334155; }
@media (max-width: 767px) {
    .profile-cover.profile-cover-tall { height:170px; }
    .profile-info-item { display:block; }
    .profile-info-item .value { text-align:left; margin-top:4px; }
}

/* v12 room chat */
.room-chat-body { min-height: 100vh; }
.room-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    height: calc(100vh - 92px);
}
.room-chat-main, .room-users-panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    overflow: hidden;
}
.room-chat-main { display: flex; flex-direction: column; min-height: 0; }
.room-chat-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.room-chat-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    font-size: 24px;
}
.room-messages-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.room-chat-form {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: #fff;
}
.room-message {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: flex-start;
}
.room-message.mine { flex-direction: row-reverse; }
.room-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}
.room-message-content { max-width: min(680px, 76%); }
.room-message.mine .room-message-content { text-align: right; }
.room-message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}
.room-message.mine .room-message-meta { justify-content: flex-end; }
.room-message-bubble {
    padding: 10px 13px;
    border-radius: 16px;
    background: #f1f5f9;
    color: #0f172a;
    line-height: 1.55;
    word-break: break-word;
    text-align: left;
}
.room-message.mine .room-message-bubble {
    background: #0d6efd;
    color: #fff;
}
.room-users-panel { display: flex; flex-direction: column; min-height: 0; }
.room-users-list { flex: 1; min-height: 0; overflow-y: auto; }
.room-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    color: inherit;
    text-decoration: none;
}
.room-user-item:hover { background: #f8fafc; }
.room-user-item img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.min-width-0 { min-width: 0; }
@media (max-width: 992px) {
    .room-chat-layout { grid-template-columns: 1fr; height: auto; }
    .room-chat-main { height: calc(100vh - 105px); }
    .room-users-panel { max-height: 260px; }
}
@media (max-width: 576px) {
    .room-chat-main { height: calc(100vh - 96px); border-radius: 0; }
    .room-chat-layout { gap: 10px; }
    .room-messages-box { padding: 12px; }
    .room-message-content { max-width: 82%; }
    .room-chat-form { padding: 10px; }
}

/* v13 Facebook-style Feed */
.feed-page { max-width: 1180px; }
.feed-hero { background: linear-gradient(135deg, #ffffff, #eef5ff); }
.composer-card { border: 1px solid rgba(13,110,253,.08); }
.feed-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(15,23,42,.12); flex: 0 0 auto; }
.composer-input { border-radius: 18px; background: #f8fafc; resize: vertical; border-color: #e5e7eb; }
.privacy-select { width: 150px; }
.feed-post { overflow: hidden; border: 1px solid rgba(15,23,42,.08); }
.feed-content { font-size: 1rem; line-height: 1.65; color: #1f2937; white-space: normal; word-break: break-word; }
.feed-image-wrap { background: #0f172a; text-align: center; }
.feed-image { max-width: 100%; max-height: 680px; object-fit: contain; display: inline-block; }
.feed-actions .btn { border-radius: 12px; font-weight: 600; color: #475569; }
.feed-actions .btn:hover { background: #eef5ff; color: #0d6efd; }
.feed-actions .active-like { color: #0d6efd; background: #e7f0ff; }
.comments-box { background: #fff; }
.comment-item { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.comment-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.comment-bubble { background: #f1f5f9; border-radius: 16px; padding: 9px 12px; max-width: calc(100% - 44px); word-break: break-word; }
.comment-input { background: #f8fafc; border-color: #e5e7eb; }
.sticky-feed-sidebar { position: sticky; top: 84px; }
@media (max-width: 991px) { .sticky-feed-sidebar { position: static; } }

/* v13.1 image preview before posting */
.post-preview-box{
    position:relative;
    border:1px solid #e5e7eb;
    border-radius:18px;
    overflow:hidden;
    background:#f8fafc;
}
.post-preview-image{
    display:block;
    width:100%;
    max-height:360px;
    object-fit:contain;
}
.post-preview-remove{
    position:absolute;
    top:10px;
    right:10px;
    z-index:2;
    width:34px;
    height:34px;
    border-radius:999px;
    font-size:22px;
    line-height:1;
    box-shadow:0 6px 20px rgba(15,23,42,.16);
}

/* v15 Banner Ads */
.madoo-ad-zone{margin:1rem 0}.madoo-ad-card{display:flex;align-items:center;gap:1rem;background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:1rem;box-shadow:0 .35rem 1.2rem rgba(15,23,42,.06);padding:.75rem;text-decoration:none;color:#111827;overflow:hidden;transition:.15s ease}.madoo-ad-card:hover{transform:translateY(-1px);box-shadow:0 .75rem 1.8rem rgba(15,23,42,.10);color:#111827}.madoo-ad-card img{width:180px;height:90px;object-fit:cover;border-radius:.8rem;background:#eef2ff}.madoo-ad-placeholder{width:180px;height:90px;border-radius:.8rem;background:linear-gradient(135deg,#2563eb,#7c3aed);color:white;font-weight:800;display:flex;align-items:center;justify-content:center;font-size:1.4rem}.madoo-ad-info{display:flex;flex-direction:column;gap:.15rem;min-width:0}.madoo-ad-info strong{font-size:1rem;line-height:1.25}.madoo-ad-info small{color:#6b7280}.madoo-ad-label{font-size:.7rem;color:#2563eb;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.madoo-ad-sidebar .madoo-ad-card{display:block;text-align:center}.madoo-ad-sidebar .madoo-ad-card img,.madoo-ad-sidebar .madoo-ad-placeholder{width:100%;height:170px;margin-bottom:.65rem}.madoo-ad-compact .madoo-ad-card{padding:.55rem}.madoo-ad-compact .madoo-ad-card img,.madoo-ad-compact .madoo-ad-placeholder{width:120px;height:64px}.ad-preview-img{max-width:260px;max-height:130px;object-fit:cover;border-radius:.75rem;border:1px solid #e5e7eb;background:#f8fafc}@media(max-width:576px){.madoo-ad-card{align-items:flex-start}.madoo-ad-card img,.madoo-ad-placeholder{width:110px;height:74px}.madoo-ad-sidebar .madoo-ad-card img,.madoo-ad-sidebar .madoo-ad-placeholder{height:120px}.madoo-ad-info strong{font-size:.9rem}}
