.community-page {
    height: 100vh;
    overflow: hidden;
    background: #0a0a0b;
}
.message-request-banner {
    text-align: center;
    align-items: center;
    margin: auto;
    margin-bottom: 40px;
}

/* Search Bar */
.community-header-search {
    background: #0f0f12;
    padding: 0.8rem 2rem;
    border-bottom: 1px solid var(--dashboard-border);
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    z-index: 100;
}

.search-bar-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-search-btn {
    display: none;
}

#player-search-input {
    width: 100%;
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.search-results-dropdown.visible {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.search-result-item:hover {
    background: rgba(255,255,255,0.05);
}

.search-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    position: relative;
    z-index: 2;
    overflow: visible;
    border: none;
}
#view-full-profile {
    display: none;
}

.search-result-avatar .frame-border {
    /* Uso global .frame-border */
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    display: block;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.search-result-nickname {
    font-size: 0.75rem;
    color: var(--dashboard-accent);
}

/* Tabs */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.settings-tab-btn {
    background: transparent;
    border: none;
    color: var(--dashboard-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.settings-tab-btn.active {
    background: rgba(200, 58, 58, 0.1);
    color: var(--dashboard-accent);
}

.settings-section {
    display: none;
}

.settings-section.visible {
    display: block;
}

.community-container {
    display: grid;
    grid-template-columns: auto 1fr;
    height: calc(100vh - 120px);
    margin-top: 120px;
}

/* Sidebar */
.community-sidebar {
    /* margin-top: 4rem; */
    background: #121214;
    border-right: 1px solid #2a2a2e;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 350px;
    min-width: 320px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.community-sidebar.collapsed {
    width: 80px;
    min-width: 80px;
}
.community-sidebar.collapsed .item-avatar {
    width: 64px;
    height: 34px;
    border-radius: 50%;
    margin: 0 auto;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
}

.sidebar-toggle-btn {
    position: absolute;
    right: -15px;
    top: 20px;
    width: 30px;
    height: 30px;
    background: var(--dashboard-accent);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

.community-sidebar.collapsed .sidebar-toggle-btn {
    right: -12px;
}

.collapsed .sidebar-toggle-btn span {
    transform: rotate(180deg);
}

.collapsed .sidebar-header h2,
.collapsed .online-counter,
.collapsed .sidebar-tab span,
.collapsed .item-info,
.collapsed .friend-category h3,
.collapsed #create-group-btn,
.collapsed #no-friends-msg {
    display: none !important;
}

.collapsed .sidebar-tabs {
    flex-direction: column;
}

.collapsed .sidebar-tab {
    padding: 1rem 0;
    justify-content: center;
}

.collapsed .sidebar-tab i {
    margin: 0;
    font-size: 1.2rem;
}

.collapsed .item-avatar {
    margin: 0 auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #2a2a2e;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.online-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--dashboard-text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a4a4f;
}

.status-dot.online {
    background: #43b581;
    box-shadow: 0 0 8px rgba(67, 181, 129, 0.5);
}

.sidebar-tabs {
    flex-wrap: wrap;
    display: flex;
    padding: 0.5rem;
    background: #1a1a1e;
    gap: 5px;
    overflow: hidden;
}

.sidebar-tab {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    color: var(--dashboard-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    white-space: nowrap;
}

.sidebar-tab i {
    font-size: 1rem;
}

.sidebar-tab.active {
    background: #2a2a2e;
    color: #fff;
}

.badge-count {
    background: var(--dashboard-accent);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Intermediate Screen Sizes */
@media (min-width: 769px) and (max-width: 1100px) {
    .community-sidebar {
        width: 80px;
        min-width: 80px;
    }
    
    .community-sidebar .sidebar-header h2,
    .community-sidebar .online-counter,
    .community-sidebar .sidebar-tab span,
    .community-sidebar .item-info,
    .community-sidebar .friend-category h3,
    .community-sidebar #create-group-btn {
        display: none !important;
    }

    .community-sidebar .sidebar-tab {
        padding: 1rem 0;
        justify-content: center;
    }

    .community-sidebar .item-avatar {
        margin: 0 auto;
    }

    /* Expandir ao passar o mouse nesta faixa de tela */
    .community-sidebar:hover {
        width: 320px;
        min-width: 320px;
        box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    }

    .community-sidebar:hover .sidebar-header h2,
    .community-sidebar:hover .online-counter,
    .community-sidebar:hover .sidebar-tab span,
    .community-sidebar:hover .item-info,
    .community-sidebar:hover .friend-category h3,
    .community-sidebar:hover #create-group-btn {
        display: block !important;
    }
    
    .community-sidebar:hover .sidebar-tab {
        padding: 0.6rem;
        justify-content: center;
    }

    /* Se estiver forçadamente colapsado via botão, desativa o hover de expansão */
    .community-sidebar.collapsed:hover {
        width: 80px;
        min-width: 80px;
    }
    .community-sidebar.collapsed:hover * {
        display: none !important;
    }
    .community-sidebar.collapsed:hover .sidebar-tab {
        display: flex !important;
    }
    .community-sidebar.collapsed:hover .sidebar-tab i {
        display: block !important;
    }
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

.friend-category {
    margin-bottom: 1.5rem;
}

.friend-category h3 {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dashboard-text-muted);
    margin-bottom: 0.5rem;
}

/* Friends/Groups List Items */
.friend-item, .group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.friend-item:hover, .group-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.friend-item.active, .group-item.active {
    background: rgba(200, 58, 58, 0.1);
    border-left: 3px solid var(--dashboard-accent);
}

.item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2e;
    position: relative;
    z-index: 2;
    overflow: visible;
    border: none;
}

.item-avatar .frame-border {
    /* Uses global .frame-border styles */
}

.item-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #121214;
    background: #4a4a4f;
}

.item-status.online { 
    background: #43b581; 
    box-shadow: 0 0 10px #43b581, 0 0 20px #43b581;
}

.item-info {
    flex: 1;
    overflow: hidden;
}

.item-name {
    display: block;
    color: #eee;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-sub {
    font-size: 0.8rem;
    transition: color 0.3s;
    color: var(--dashboard-text-muted);
}

.friend-item .item-sub.online {
    color: #43b581;
    text-shadow: 0 0 5px rgba(67, 181, 129, 0.5);
    font-weight: 600;
}

.item-sub.offline {
    color: #ff4444;
    font-weight: 500;
}

/* Request Actions */
.request-actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.request-btn {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.request-btn.accept {
    background: #43b581;
    color: #fff;
}

.request-btn.decline {
    background: rgba(255, 255, 255, 0.1);
    color: #eee;
}

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

/* Chat Area */
.chat-area {
    margin-top: 4rem;
    background: #0f0f11;
    display: flex;
    flex-direction: column;
    position: relative;
}

.no-chat-placeholder {
    margin: 0 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--dashboard-text-muted);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.active-chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-size: cover;
    background-position: center;
}

.chat-header {
    top: -61px;
    width: 100%;
    position: absolute;
    padding: 1rem 2rem;
    background: rgba(18, 18, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #2a2a2e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2e;
}

.chat-header h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
}

.chat-status {
    font-size: 0.8rem;
    color: #43b581;
}

.chat-header-actions button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s;
    color: #fff;
}

.chat-header-actions button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    border-color: var(--dashboard-accent);
}

/* Messages */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message.received { align-self: flex-start; }
.message.sent { align-self: flex-end; }

.message-bubble {
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.received .message-bubble {
    background: #2a2a2e;
    color: #eee;
    border-bottom-left-radius: 2px;
}

.sent .message-bubble {
    background: var(--dashboard-accent);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.message-info {
    font-size: 0.7rem;
    color: var(--dashboard-text-muted);
}

.sent .message-info { text-align: right; }

/* Input Area */
.chat-input-area {
    position: relative;
    top: -26px;
    padding: 1.5rem 2rem;
    background: rgba(18, 18, 20, 0.9);
    border-top: 1px solid #2a2a2e;
    display: flex;
    gap: 15px;
    align-items: center;
}

#chat-input {
    flex: 1;
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

#chat-input:focus {
    outline: none;
    border-color: var(--dashboard-accent);
}

#chat-attach-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.6;
}

#chat-send-btn {
    background: var(--dashboard-accent);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

#chat-send-btn:hover {
    transform: scale(1.05);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    border-radius: 8px;
    padding: 5px;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    min-width: 180px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #eee;
    transition: background 0.2s;
}

.context-menu li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.context-menu li.danger {
    color: #ff4444;
}

.context-menu li.danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* Modal Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 2rem 0;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #121214;
    border: 1px solid #2a2a2e;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: auto; /* Centraliza verticalmente se couber, permite scroll se não */
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--dashboard-text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--dashboard-accent);
}

/* Modal Enhancements */
.settings-hint {
    font-size: 0.85rem;
    color: var(--dashboard-text-muted);
    margin-bottom: 1rem;
}

.groups-list {
    padding: 1rem 0;
}

#create-group-btn {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 1rem;
}

/* Mobile Responsiveness */
.mobile-community-nav {
    display: none;
}

/* Modal de Perfil Social (Compartilhado) */
.profile-modal-content {
    max-width: 450px;
    padding: 0;
    overflow: hidden;
    background: #121212;
    border: 1px solid #333;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.profile-popup-banner {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-popup-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #121212, transparent);
}

.profile-popup-info {
    position: relative;
    padding: 0 1.5rem 2rem;
    text-align: center;
    margin-top: -60px; /* Sobe para o avatar ficar sobre o banner */
    z-index: 2;
}

.profile-popup-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background-size: cover;
    background-position: center;
    background-color: #333;
    margin: 0 auto 0.8rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
    overflow: visible;
    -webkit-transition: transform 0.3s ease;
    -moz-transition: transform 0.3s ease;
    -ms-transition: transform 0.3s ease;
    -o-transition: transform 0.3s ease;
}

#avatar-img {
    transform: translateY(12px);
    -webkit-transform: translateY(12px);
    -moz-transform: translateY(12px);
    -ms-transform: translateY(12px);
    -o-transform: translateY(12px);
}

.profile-popup-avatar .frame-border {
    position: absolute;
    top: -22%;
    left: -22%;
    right: -22%;
    bottom: -22%;
    z-index: 10;
    pointer-events: none;
}

.profile-popup-avatar .frame-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Brilho atrás da foto */
    border-radius: 50%;
    pointer-events: none;
}

.profile-popup-name {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #fff;
    margin: 0;
    letter-spacing: 1px;
}

.profile-popup-subtitle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.2rem;
}

.profile-popup-nickname {
    color: var(--dashboard-accent);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.profile-popup-title {
    background: rgba(255, 255, 255, 0.1);
    color: #eee;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-premium {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    z-index: 10;
}

.profile-popup-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-popup-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup-stat-label {
    font-size: 0.65rem;
    color: var(--dashboard-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.popup-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.profile-popup-bio {
    color: #b0b0b0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.8rem;
    font-style: italic;
    padding: 0 0.5rem;
}

.profile-popup-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-popup-actions .btn-primary,
.profile-popup-actions .btn-secondary {
    color: white;
    flex: 1;
    min-width: 120px;
    padding: 0.8rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-popup-actions .btn-primary {
    background: var(--dashboard-accent);
    box-shadow: 0 4px 15px rgba(200, 58, 58, 0.3);
}

.profile-popup-actions .btn-primary:hover {
    background: #e04545;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 58, 58, 0.4);
}

.profile-popup-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
}

.profile-popup-actions .btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.3);
}

.profile-modal-content .modal-close-btn {
    top: 0.8rem;
    right: 0.8rem;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* font-size: 1.5rem; */
    line-height: 1;
}

@media (max-width: 768px) {
    .chat-header {
    top: -61px;
    width: 100%;
    position: absolute;
    padding: 1rem 2rem;
    background: rgba(18, 18, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #2a2a2e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
    .community-header-search {
        background: transparent;
        border-bottom: none;
        padding: 0;
        width: auto;
        left: auto;
        right: 20px;
        top: 15px; /* Alinhado com o header */
        z-index: 2000;
    }

    .search-bar-container {
        justify-content: flex-end;
    }

    .mobile-search-btn {
        position: absolute;
        top: 0;
        right: 95px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(18, 18, 20, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 2001;
        transition: all 0.3s ease;
    }

    #player-search-input {
        width: 0;
        padding: 0;
        border: none;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: absolute;
        right: 0;
        background: #1a1a1e;
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }

    .community-header-search.active #player-search-input {
        right: 43px;
        margin: auto;
        top: 60px;
        position: absolute;
        width: calc(100vw - 40px);
        max-width: 300px;
        padding: 0.7rem 1.2rem;
        padding-right: 45px; 
        border: 1px solid var(--dashboard-accent);
        opacity: 1;
        visibility: visible;
    }

    .community-header-search.active .mobile-search-btn {
        background: transparent;
        border-color: transparent;
        position: absolute;
        right: 95px;
    }

    .search-results-dropdown {
        top: 50px;
        width: calc(100vw - 40px);
        max-width: 300px;
        right: 0;
        left: auto;
    }

    .community-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 120px);
        margin-top: 120px;
    }

    .community-sidebar {
        display: none;
    }

    .chat-area {
        top: -48px;
        position: relative;
        margin-top: 0;
        height: 100%;
    }

    .active-chat-wrapper {
        height: 100%;
    }

    .chat-messages-container {
        padding: 1rem;
        margin-top: 72px;
    
    }

    .chat-input-area {
        padding: 1rem;
    }

    /* Mobile Bottom Nav Overlay */
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(3px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-nav-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    /* Message Request Banner */
.message-request-banner {
    background: #1a1a1e;
    border-top: 1px solid var(--dashboard-border);
    padding: 1rem 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
    animation: slideUp 0.3s ease-out;
}

.message-request-banner p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--dashboard-text-muted);
}

.banner-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.banner-btns button {
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    min-width: 100px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Chat Input Blocked State */
.chat-input-area.blocked {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile Bottom Nav */
    .mobile-community-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #121214;
        border-top: 1px solid #2a2a2e;
        border-radius: 20px 20px 0 0;
        z-index: 1000;
        transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        height: 76px;
        box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
    }

    .mobile-community-nav.expanded {
        height: 70vh;
    }

    .mobile-nav-handle {
        width: 40px;
        height: 4px;
        background: #2a2a2e;
        border-radius: 2px;
        margin: 8px auto 0;
    }

    .mobile-nav-icons {
        display: flex;
        justify-content: space-around;
        padding: 5px 0 15px;
    }

    .mobile-nav-btn {
        cursor: pointer;
        transition: color 0.2s;
        border-radius: 8px;
        background-color: rgb(117, 0, 0);
        border: none;
        font-size: 0.9rem;
        padding: 10px;
        color: var(--dashboard-text-muted);
        position: relative;
        -webkit-border-radius: 8px;
        -moz-border-radius: 8px;
        -ms-border-radius: 8px;
        -o-border-radius: 8px;
}

    .mobile-nav-btn.active {
        color: var(--dashboard-accent);
    }

    .mobile-nav-content {
        height: calc(70vh - 70px);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s;
        padding: 10px 0;
    }

    .expanded .mobile-nav-content {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .chat-header {
        top: 0px;
        width: 100%;
        position: absolute;
        padding: 1rem 2rem;
        background: rgba(18, 18, 20, 0.8);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid #2a2a2e;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}