.community-app {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

/* ── Sidebar ── */

.sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-800);
}

.sidebar__logo {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
}

.sidebar__logo .cross-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 9999px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 400;
    transition: background var(--transition-fast);
}

.sidebar__link:hover {
    background: var(--gray-900);
    opacity: 1;
}

.sidebar__link--active {
    font-weight: 700;
}

.sidebar__link svg {
    flex-shrink: 0;
}

.sidebar__badge {
    background: var(--community-accent);
    color: var(--white);
    font-size: 12px;
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 5px;
}

.sidebar__post-btn {
    width: 100%;
    margin-top: 16px;
    background: var(--community-accent) !important;
    color: var(--white);
    justify-content: center;
    font-size: 17px;
    padding: 14px;
}

.sidebar__post-btn:hover {
    opacity: 0.9;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 9999px;
    margin-top: auto;
    cursor: pointer;
}

.sidebar__user:hover {
    background: var(--gray-900);
}

.sidebar__user-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
}

.sidebar__user-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Feed ── */

.feed {
    flex: 1;
    min-width: 0;
    border-right: 1px solid var(--gray-800);
}

.feed__header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-800);
}

.feed__tabs {
    display: flex;
}

.feed__tab {
    flex: 1;
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

.feed__tab:hover {
    background: rgba(231, 233, 234, 0.03);
}

.feed__tab--active {
    color: var(--white);
    font-weight: 700;
}

.feed__tab--active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    background: var(--community-accent);
    border-radius: 2px;
}

.feed__loading {
    display: flex;
    justify-content: center;
    padding: 32px;
}

.feed__load-more {
    width: 100%;
    padding: 16px;
    color: var(--community-accent);
    font-size: 15px;
    border-top: 1px solid var(--gray-800);
}

/* ── Compose ── */

.compose {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--gray-800);
}

.compose__avatar {
    flex-shrink: 0;
}

.compose__content {
    flex: 1;
}

.compose__input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    resize: none;
    min-height: 60px;
    outline: none;
    font-family: var(--font-body);
}

.compose__input::placeholder {
    color: var(--text-secondary);
}

.compose__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--gray-800);
}

.compose__actions {
    display: flex;
    gap: 4px;
}

.compose__action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--community-accent);
    transition: background var(--transition-fast);
}

.compose__action:hover {
    background: rgba(29, 155, 240, 0.1);
}

.compose__right {
    display: flex;
    align-items: center;
}

.compose__counter {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 12px;
}

.compose__counter.warning {
    color: var(--accent);
}

.compose__counter.danger {
    color: var(--error);
}

.compose__images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.compose__images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.compose__poll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
}

.compose__poll-option {
    padding: 12px;
    background: transparent;
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.compose__poll-option:focus {
    border-color: var(--community-accent);
}

.compose__poll-duration {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
}

/* ── Post Card ── */

.post {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--gray-800);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.post:hover {
    background: var(--gray-900);
}

.post__avatar {
    flex-shrink: 0;
}

.post__body {
    flex: 1;
    min-width: 0;
}

.post__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.post__name {
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
}

.post__admin-badge {
    color: var(--community-accent);
    font-size: 14px;
}

.post__handle {
    color: var(--text-secondary);
    font-size: 15px;
}

.post__time {
    color: var(--text-secondary);
    font-size: 15px;
}

.post__dot {
    color: var(--text-secondary);
    font-size: 15px;
}

.post__content {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post__content a {
    color: var(--community-accent);
}

.post__content .hashtag {
    color: var(--community-accent);
}

.post__images {
    display: grid;
    gap: 2px;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 12px;
}

.post__images--1 {
    grid-template-columns: 1fr;
}

.post__images--2 {
    grid-template-columns: 1fr 1fr;
}

.post__images--3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
}

.post__images--3 img:first-child {
    grid-row: 1 / 3;
}

.post__images--4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}

.post__images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 300px;
}

.post__actions {
    display: flex;
    gap: 0;
    margin-top: 12px;
    justify-content: space-between;
    max-width: 400px;
}

.post__action {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 9999px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.post__action:hover {
    color: var(--community-accent);
    background: rgba(29, 155, 240, 0.1);
}

.post__action--liked {
    color: var(--error);
}

.post__action--liked:hover {
    color: var(--error);
    background: rgba(244, 33, 46, 0.1);
}

.post__action--reposted {
    color: var(--success);
}

.post__action--reposted:hover {
    color: var(--success);
    background: rgba(0, 186, 124, 0.1);
}

.post__action svg {
    width: 18px;
    height: 18px;
}

/* ── Poll ── */

.poll {
    margin-top: 12px;
}

.poll__option {
    position: relative;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-800);
    margin-bottom: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.poll__option:hover {
    border-color: var(--community-accent);
}

.poll__option--voted {
    border-color: transparent;
}

.poll__bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(29, 155, 240, 0.15);
    border-radius: 8px;
    transition: width 500ms ease-out;
}

.poll__option-text {
    position: relative;
    z-index: 1;
}

.poll__option-pct {
    position: relative;
    z-index: 1;
    float: right;
    font-weight: 700;
}

.poll__info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── Scripture Embed ── */

.scripture-embed {
    background: var(--gray-900);
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
}

.scripture-embed__text {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.scripture-embed__ref {
    font-size: 13px;
    color: var(--accent);
    margin-top: 8px;
}

/* ── Quoted Post ── */

.quoted-post {
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.quoted-post:hover {
    background: var(--gray-900);
}

.quoted-post .post__header {
    margin-bottom: 4px;
}

.quoted-post .post__content {
    font-size: 14px;
}

/* ── Right Sidebar ── */

.right-sidebar {
    width: 320px;
    flex-shrink: 0;
    padding: 16px;
}

.right-sidebar__section {
    padding: 16px;
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    margin-bottom: 16px;
}

.right-sidebar__section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
}

.right-sidebar__cta {
    display: block;
    text-decoration: none;
    color: inherit;
}

.right-sidebar__cta:hover {
    opacity: 1;
}

.right-sidebar__cta p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.right-sidebar__footer {
    border: none;
    padding: 16px 0;
}

.right-sidebar__footer a {
    color: var(--text-secondary);
    font-size: 13px;
}

.right-sidebar__footer p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 8px;
}

.trending-item {
    padding: 8px 0;
}

.trending-item__tag {
    font-weight: 700;
    color: var(--white);
    font-size: 15px;
}

.trending-item__count {
    font-size: 13px;
    color: var(--text-secondary);
}

.suggested-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.suggested-user__info {
    flex: 1;
    min-width: 0;
}

.suggested-user__name {
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
}

.suggested-user__handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.suggested-user__follow {
    background: var(--community-accent);
    color: var(--white);
    border: none;
    border-radius: 9999px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.suggested-user__follow:hover {
    opacity: 0.9;
}

/* ── Mobile Nav ── */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--black);
    border-top: 1px solid var(--gray-800);
    height: 56px;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
}

.mobile-nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 24px;
    color: var(--text-primary);
    position: relative;
}

.mobile-nav__link--active {
    color: var(--white);
}

.mobile-nav__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--community-accent);
    border-radius: 50%;
}

/* ── Auth Modal ── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
}

/* ── Like Animation ── */

@keyframes likeHeart {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.post__action--liked svg {
    animation: likeHeart 300ms ease;
}

/* ── Responsive ── */

@media (max-width: 1023px) {
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 767px) {
    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    .feed {
        width: 100%;
        border-right: none;
    }

    .feed__header {
        position: sticky;
        top: 0;
    }

    .community-app {
        padding-bottom: 56px;
    }
}
