/* BAT Community Chat — matches site palette (styles.css) */

.community-app {
    --community-sidebar: var(--gray-dark, #121212);
    --community-panel: var(--bg-dark, #030303);
    --community-header: rgba(255, 255, 255, 0.04);
    --community-border: var(--gray-border, rgba(255, 255, 255, 0.08));
    --community-accent: var(--white, #ffffff);
    --community-accent-muted: rgba(255, 255, 255, 0.12);
    --community-outgoing: var(--white, #ffffff);
    --community-outgoing-text: var(--black, #000000);
    --community-incoming: var(--glass-bg, rgba(255, 255, 255, 0.05));
    --community-text-muted: var(--gray-text, #888888);
    --community-hover: rgba(255, 255, 255, 0.06);
    --community-active: rgba(255, 255, 255, 0.08);

    display: grid;
    grid-template-columns: 360px 1fr;
    height: calc(100vh - 180px);
    min-height: 560px;
    max-height: 820px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--community-border);
    background: var(--community-panel);
    font-family: var(--font-body, 'Inter', sans-serif);
}

.community-app.full-page {
    height: calc(100vh - 200px);
    max-height: none;
    margin: 0 auto;
    max-width: 1200px;
}

/* Sidebar */
.community-sidebar {
    background: var(--community-sidebar);
    border-right: 1px solid var(--community-border);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.community-sidebar-header {
    background: var(--community-header);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--community-border);
    flex-shrink: 0;
}

.community-sidebar-header h2 {
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--white, #fff);
    margin: 0;
}

.community-sidebar-header .community-user-badge {
    font-size: 12px;
    color: var(--community-text-muted);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.community-notify-btn,
.community-member-switch {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--community-border);
    color: var(--community-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.community-notify-btn:hover,
.community-member-switch:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white, #fff);
}

.community-notify-btn.active {
    color: var(--white, #fff);
    border-color: rgba(255, 255, 255, 0.2);
}

.community-typing-indicator {
    display: none;
    padding: 6px 20px 0;
    font-size: 12px;
    color: var(--community-text-muted);
    font-style: italic;
    min-height: 22px;
}

.community-typing-indicator.active {
    display: block;
}

.community-login-modal .community-login-hint {
    font-size: 13px;
    color: var(--community-text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.community-login-label {
    display: block;
    font-size: 12px;
    color: var(--community-text-muted);
    margin-bottom: 6px;
}

.community-login-modal input {
    margin-bottom: 14px;
}

.community-login-error {
    color: #ff6b6b;
    font-size: 13px;
    margin: 0 0 12px;
}

.community-blocked-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    padding: 60px 50px;
    text-align: center;
    color: var(--community-text-muted);
    background: var(--community-panel);
    z-index: 10;
}

.community-blocked-screen i {
    font-size: 80px;
    color: #ff6b6b;
    margin-bottom: 28px;
    animation: banned-shake 0.5s ease-in-out;
    filter: drop-shadow(0 6px 20px rgba(255, 107, 107, 0.4));
}

@keyframes banned-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-10px) rotate(-6deg); }
    40% { transform: translateX(10px) rotate(6deg); }
    60% { transform: translateX(-6px) rotate(-3deg); }
    80% { transform: translateX(6px) rotate(3deg); }
}

.community-blocked-screen h3 {
    color: #ff6b6b;
    margin-bottom: 18px;
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(255, 107, 107, 0.25);
}

.community-blocked-screen p {
    font-size: 15px;
    line-height: 1.6;
    max-width: 440px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.community-blocked-note {
    font-size: 13px;
    max-width: 400px;
    line-height: 1.6;
    margin: 20px 0 36px;
    color: rgba(255, 255, 255, 0.55);
    padding: 18px 24px;
    background: rgba(255, 107, 107, 0.08);
    border-radius: 10px;
    border-left: 3px solid #ff6b6b;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.1);
}

.community-blocked-contact {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: #fff;
    padding: 14px 36px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.community-blocked-contact:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff3d3d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(255, 107, 107, 0.45);
}

.community-message-action-btn.block-btn {
    color: #ff6b6b;
    font-weight: 600;
}

.community-message-action-btn.report-btn:hover {
    color: #ffb347;
}

.community-message-action-btn.block-btn:hover {
    color: #ff6b6b;
}

.community-search {
    padding: 10px 14px;
    background: var(--community-header);
    border-bottom: 1px solid var(--community-border);
    flex-shrink: 0;
}

.community-search input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--community-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--white, #fff);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.community-search input:focus {
    border-color: var(--gray-border-light, rgba(255, 255, 255, 0.15));
}

.community-search input::placeholder {
    color: var(--community-text-muted);
}

.community-groups-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.community-groups-list::-webkit-scrollbar {
    width: 6px;
}

.community-groups-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.community-group-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.community-group-item:hover {
    background: var(--community-hover);
}

.community-group-item.active {
    background: var(--community-active);
}

.community-group-item.pinned {
    background: rgba(255, 255, 255, 0.02);
}

.community-group-item.unread .community-group-name {
    font-weight: 700;
    color: var(--white, #fff);
}

.community-group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--black, #000);
    background: var(--white, #fff) !important;
    flex-shrink: 0;
}

.community-group-info {
    flex: 1;
    min-width: 0;
}

.community-group-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.community-group-name {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-group-time {
    font-size: 11px;
    color: var(--community-text-muted);
    flex-shrink: 0;
}

.community-group-preview {
    font-size: 13px;
    color: var(--community-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.community-group-preview.unread-preview {
    color: var(--gray-light, #cccccc);
    font-weight: 500;
}

.community-unread-dot {
    width: 10px;
    height: 10px;
    background: var(--white, #fff);
    border-radius: 50%;
    flex-shrink: 0;
}

.community-pin-icon {
    font-size: 10px;
    color: var(--community-text-muted);
    margin-right: 4px;
}

.community-group-menu-btn {
    background: none;
    border: none;
    color: var(--community-text-muted);
    padding: 6px 8px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    flex-shrink: 0;
}

.community-group-item:hover .community-group-menu-btn {
    opacity: 1;
}

.community-group-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white, #fff);
}

/* Chat panel */
.community-chat {
    display: flex;
    flex-direction: column;
    background: var(--community-panel);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.community-chat-header {
    background: var(--community-header);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--community-border);
    flex-shrink: 0;
}

.community-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--black, #000);
    background: var(--white, #fff) !important;
}

.community-chat-header-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--white, #fff);
    margin: 0 0 2px;
}

.community-chat-header-info p {
    font-size: 12px;
    color: var(--community-text-muted);
    margin: 0;
}

.community-chat-header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.community-chat-header-actions button {
    background: none;
    border: none;
    color: var(--community-text-muted);
    padding: 8px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s, background 0.2s;
}

.community-chat-header-actions button:hover {
    color: var(--white, #fff);
    background: rgba(255, 255, 255, 0.08);
}

.community-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.community-messages::-webkit-scrollbar {
    width: 8px;
}

.community-messages::-webkit-scrollbar-track {
    background: transparent;
}

.community-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.community-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.community-message {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
}

.community-message.incoming {
    align-self: flex-start;
    background: var(--community-incoming);
    color: var(--white, #fff);
    border: 1px solid var(--community-border);
    border-bottom-left-radius: 2px;
}

.community-message.outgoing {
    align-self: flex-end;
    background: var(--community-outgoing);
    color: var(--community-outgoing-text);
    border-bottom-right-radius: 2px;
}

.community-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-light, #cccccc);
    margin-bottom: 4px;
}

.community-message-reply {
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    padding: 6px 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
    font-size: 12px;
    cursor: pointer;
}

.community-message.outgoing .community-message-reply {
    border-left-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.06);
}

.community-message-reply-sender {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
    opacity: 0.85;
}

.community-message-reply-text {
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.community-message-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.community-message:hover .community-message-actions {
    opacity: 1;
}

.community-message-action-btn {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.55;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.community-message-action-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.community-message.outgoing .community-message-action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.community-message-action-btn.delete-btn:hover {
    color: #ff6b6b;
}

.community-message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.5;
}

.community-date-divider {
    align-self: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--community-text-muted);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    margin: 12px 0;
    flex-shrink: 0;
}

.community-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--community-text-muted);
    text-align: center;
    padding: 40px;
}

.community-empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.25;
}

.community-empty-state h3 {
    font-family: var(--font-heading, 'Syne', sans-serif);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.community-reply-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid var(--community-border);
    flex-shrink: 0;
}

.community-reply-bar.active {
    display: flex;
}

.community-reply-bar-content {
    flex: 1;
    min-width: 0;
    border-left: 3px solid var(--white, #fff);
    padding-left: 12px;
}

.community-reply-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-light, #ccc);
    margin-bottom: 2px;
}

.community-reply-bar-preview {
    font-size: 13px;
    color: var(--community-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-reply-bar-cancel {
    background: none;
    border: none;
    color: var(--community-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.community-reply-bar-cancel:hover {
    color: var(--white, #fff);
    background: rgba(255, 255, 255, 0.08);
}

.community-input-area {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--community-border);
    flex-shrink: 0;
}

.community-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--community-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--white, #fff);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.community-input-area input:focus {
    border-color: var(--gray-border-light, rgba(255, 255, 255, 0.15));
}

.community-input-area input::placeholder {
    color: var(--community-text-muted);
}

.community-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--white, #fff);
    color: var(--black, #000);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.community-send-btn:hover {
    transform: scale(1.05);
}

.community-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Context menu */
.community-context-menu {
    position: fixed;
    background: var(--gray-dark, #121212);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    z-index: 2000;
    overflow: hidden;
    border: 1px solid var(--community-border);
}

.community-context-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: none;
    color: var(--white, #fff);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.community-context-menu button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.community-context-menu button i {
    width: 18px;
    color: var(--community-text-muted);
}

/* Rename modal */
.community-rename-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.community-rename-modal {
    background: var(--gray-dark, #121212);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--community-border);
}

.community-rename-modal h3 {
    font-family: var(--font-heading, 'Syne', sans-serif);
    margin: 0 0 16px;
    color: var(--white, #fff);
}

.community-rename-modal input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--community-border);
    border-radius: 8px;
    padding: 12px;
    color: var(--white, #fff);
    font-size: 15px;
    outline: none;
    margin-bottom: 16px;
}

.community-rename-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.community-rename-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

.community-rename-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white, #fff);
}

.community-rename-save {
    background: var(--white, #fff);
    color: var(--black, #000);
}

.community-setup-banner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--community-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.community-setup-banner code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

@media (max-width: 991px) {
    .community-app {
        grid-template-columns: 1fr;
        height: calc(100vh - 140px);
    }

    .community-app.show-chat .community-sidebar {
        display: none;
    }

    .community-app:not(.show-chat) .community-chat {
        display: none;
    }

    .community-messages {
        padding: 16px;
    }

    .community-message {
        max-width: 85%;
    }

    .community-message-actions {
        opacity: 1;
    }

    .community-back-btn {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .community-app,
    .community-app.full-page {
        height: calc(100dvh - 160px);
        min-height: 480px;
        max-height: none;
        border-radius: 10px;
    }

    .community-sidebar-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .community-sidebar-header h2 {
        font-size: 16px;
    }

    .community-input-area input {
        font-size: 16px;
    }

    .community-login-modal .modal-content {
        width: calc(100% - 32px);
        max-width: 400px;
        margin: 16px;
    }
}

@media (max-width: 576px) {
    .community-app,
    .community-app.full-page {
        height: calc(100dvh - 140px);
        min-height: 400px;
    }

    .community-page-wrap {
        padding: 12px 16px 24px;
    }

    .community-message {
        max-width: 92%;
        font-size: 13px;
    }

    .community-message-reply-text {
        max-width: 100%;
    }

    .community-chat-header {
        padding: 12px 16px;
    }

    .community-chat-header-info h3 {
        font-size: 15px;
        max-width: 50vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .community-input-area {
        padding: 10px 12px;
        gap: 8px;
    }

    .community-input-area input {
        font-size: 16px;
    }

    .community-send-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .community-empty-state {
        padding: 24px 16px;
    }

    .community-empty-state i {
        font-size: 48px;
    }
}

/* Admin portal embedded chat */
.admin-portal-chat {
    max-width: 100%;
}

.admin-portal-chat .community-message-sender.admin-label {
    color: var(--gray-light, #cccccc);
}

.admin-portal-chat .community-message-sender.client-label {
    color: var(--gray-text, #888888);
}

.community-back-btn {
    display: none;
    background: none;
    border: none;
    color: var(--community-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 4px;
}

/* Profile Modal & Avatar Styles */
.community-profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.community-profile-modal {
    background: var(--gray-dark, #121212);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    border: 1px solid var(--community-border);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.community-profile-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--community-text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.community-profile-modal-close:hover {
    color: var(--white, #fff);
}

.community-profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: var(--black, #000);
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.community-profile-name {
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--white, #fff);
    margin: 0 0 4px;
    text-align: center;
}

.community-profile-title {
    font-size: 14px;
    color: var(--gray-light, #cccccc);
    margin: 0 0 16px;
    text-align: center;
    font-weight: 500;
}

.community-profile-bio {
    font-size: 14px;
    color: var(--community-text-muted);
    text-align: center;
    line-height: 1.5;
    margin: 0 0 24px;
    max-width: 100%;
    word-wrap: break-word;
}

.community-profile-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.community-profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.community-profile-form-group label {
    font-size: 12px;
    color: var(--community-text-muted);
}

.community-profile-form-group input,
.community-profile-form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--community-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--white, #fff);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.community-profile-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.community-profile-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.community-profile-color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.community-profile-color-option.selected {
    border-color: var(--white, #fff);
    transform: scale(1.1);
}

.community-edit-profile-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--community-border);
    color: var(--community-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.community-edit-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white, #fff);
}

.community-message-with-avatar {
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.community-message-with-avatar.outgoing {
    flex-direction: row-reverse;
}

.community-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--black, #000);
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
}

.community-message-avatar:hover {
    transform: scale(1.05);
}

.community-message-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--white, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.community-attach-btn {
    background: none;
    border: none;
    color: var(--community-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.community-attach-btn:hover {
    color: var(--white, #fff);
}

.community-voice-btn {
    background: none;
    border: none;
    color: var(--community-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.community-voice-btn:hover {
    color: #ff4b4b;
}

.community-voice-btn.recording {
    color: #ff4b4b;
    animation: community-pulse 1.5s infinite;
}

@keyframes community-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.community-voice-preview {
    display: none;
    padding: 10px 20px;
    background: rgba(255, 75, 75, 0.05);
    border-top: 1px solid rgba(255, 75, 75, 0.2);
    align-items: center;
    justify-content: space-between;
    color: #ff4b4b;
}

.community-voice-preview.active {
    display: flex;
}

.community-voice-preview-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.community-voice-preview-indicator {
    width: 10px;
    height: 10px;
    background: #ff4b4b;
    border-radius: 50%;
    animation: community-pulse 1s infinite;
}

.community-message-audio {
    margin: 8px 0;
    width: 100%;
    min-width: 240px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 4px;
    display: flex;
    align-items: center;
}

.community-message-audio audio {
    width: 100%;
    height: 32px;
    outline: none;
}

/* Custom Audio Player Styling (Webkit) */
.community-message-audio audio::-webkit-media-controls-panel {
    background-color: transparent;
}

.community-message-audio audio::-webkit-media-controls-play-button {
    background-color: var(--white);
    border-radius: 50%;
}

.community-message.outgoing audio {
    filter: invert(1) hue-rotate(180deg);
}

.community-voice-timer {
    font-family: monospace;
    font-weight: 600;
    margin-left: 4px;
}

.community-media-preview {
    display: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid var(--community-border);
    align-items: center;
    justify-content: space-between;
}

.community-media-preview.active {
    display: flex;
}

.community-media-preview-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-media-preview-content img,
.community-media-preview-content video {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
}

.community-media-preview-info {
    display: flex;
    flex-direction: column;
}

.community-media-preview-name {
    font-size: 13px;
    color: var(--white, #fff);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-media-preview-size {
    font-size: 11px;
    color: var(--community-text-muted);
}

.community-media-preview-cancel {
    background: none;
    border: none;
    color: var(--community-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

.community-media-preview-cancel:hover {
    color: var(--white, #fff);
    background: rgba(255,255,255,0.1);
}

.community-message-media {
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.community-message-media img,
.community-message-media video {
    max-width: 100%;
    max-height: 280px;
    display: block;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0,0,0,0.2);
}

.community-message-media img {
    cursor: pointer;
}

