/* ==========================================================
   Root Variables (Modo Claro - padrão)
   ========================================================== */
:root {
    --primary-color: #0366d6;
    --primary-gradient: linear-gradient(45deg, #0038ff, #7000ff, #ff8c00);
    --secondary-color: #024a9a;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    
    /* Cores do modo claro */
    --background-color: #edf2f7;
    --surface-color: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #dddddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    
    --font-main: 'Roboto', Arial, sans-serif;
    
    /* Gradiente de fundo */
    --body-gradient: linear-gradient(to left, #f9fafb, #e6ecf0);
    
    /* Para transparências */
    --primary-rgb: 3, 102, 214;
}

/* ==========================================================
   Root Variables (Modo Escuro)
   ========================================================== */
[data-theme="dark"] {
    --primary-color: #4dabf7;
    --primary-gradient: linear-gradient(45deg, #5c7cfa, #9775fa, #ffa94d);
    --secondary-color: #339af0;
    --danger-color: #ff6b6b;
    --danger-hover: #ff5252;
    
    /* Cores do modo escuro */
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    
    --body-gradient: linear-gradient(to left, #0a0a0a, #1a1a1a);
    
    /* Para transparências */
    --primary-rgb: 77, 171, 247;
}

/* ==========================================================
   General Styles
   ========================================================== */
body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: var(--body-gradient);
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================
   Header
   ========================================================== */
.header {
    background: var(--primary-gradient);
    background-size: 400% 400%;
    padding: 20px;
    color: white;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: moveGradient 30s infinite alternate linear;
}

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    20% { background-position: 25% 75%; }
    40% { background-position: 50% 25%; }
    60% { background-position: 75% 50%; }
    80% { background-position: 100% 75%; }
    100% { background-position: 50% 50%; }
}

/* ==========================================================
   Typography
   ========================================================== */
h1 {
    margin: 0;
    font-size: 2.5rem;
    animation: slideIn 1s ease-out;
    color: white;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

h2, h3, h4, h5, h6 {
    color: var(--text-color);
}

p {
    font-size: 0.95rem;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================
   Auth Containers
   ========================================================== */
.auth-container {
    margin: 30px auto;
    max-width: 400px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#login-section, #signup-section {
    text-align: center;
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    width: 100%;
    max-width: 400px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

#login-section:hover, #signup-section:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

/* ==========================================================
   Forms & Inputs
   ========================================================== */
input[type="text"], input[type="email"], input[type="password"], textarea {
    padding: 12px;
    margin: 15px 0;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--surface-color);
    color: var(--text-color);
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(3, 102, 214, 0.5);
    outline: none;
}

textarea {
    width: 100%;
    min-height: 120px;
    font-size: 1rem;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

textarea:focus {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
}

/* ==========================================================
   Buttons - REDESIGN MODERNO (estilo Facebook/Instagram)
   ========================================================== */

/* Botões PRIMÁRIOS (Postar, Salvar, Login, Cadastrar) */
#post-btn, #save-profile-button, #start-call-btn, 
#signup-button, #login-button, #call-profile-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#post-btn:hover, #save-profile-button:hover, #start-call-btn:hover, 
#signup-button:hover, #login-button:hover, #call-profile-btn:hover {
    background-color: var(--secondary-color);
    opacity: 0.95;
    transform: none;
}

/* Botões SECUNDÁRIOS (normais, upload, voltar) */
button:not(#post-btn):not(#save-profile-button):not(#start-call-btn):not(#signup-button):not(#login-button):not(#call-profile-btn):not(.delete-btn):not(.toggle-comments-btn),
.custom-file-upload, .back-button {
    padding: 8px 16px;
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Hover para botões secundários - estilo Facebook/Instagram */
button:not(#post-btn):not(#save-profile-button):not(#start-call-btn):not(#signup-button):not(#login-button):not(#call-profile-btn):not(.delete-btn):not(.toggle-comments-btn):hover,
.custom-file-upload:hover, .back-button:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary-color);
    transform: none;
}

/* Botões de DANGER (Excluir, Sair, Encerrar) */
.delete-profile-btn, #logout-btn-sidebar, #end-call-btn {
    padding: 8px 16px;
    background-color: transparent;
    color: var(--danger-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--danger-color);
    transition: background-color 0.2s ease;
}

.delete-profile-btn:hover, #logout-btn-sidebar:hover, #end-call-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Botões no menu lateral (sidebar) - estilo moderno */
.sidebar-drawer button:not(#close-sidebar-btn) {
    padding: 10px 16px;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    width: 90%;
    margin: 6px auto;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
}

.sidebar-drawer button:not(#close-sidebar-btn):hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary-color);
}

/* Botão de logout no sidebar - destaque diferente */
#logout-btn-sidebar {
    background: transparent !important;
    color: var(--danger-color) !important;
    border: 1px solid var(--danger-color) !important;
}

#logout-btn-sidebar:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Botão de fechar sidebar */
#close-sidebar-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: auto;
}

/* Botões de upload */
.custom-file-upload {
    padding: 10px 18px;
    margin: 8px 0;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s ease;
}

.custom-file-upload:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
}

.upload-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

/* Botões desabilitados */
button:disabled, .delete-profile-btn:disabled {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Botões nos posts (like, comentar, etc) - mais sutis */
.post-actions button, .toggle-comments-btn, .comment-actions button {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.post-actions button:hover, .toggle-comments-btn:hover, .comment-actions button:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
}

/* Botão de deletar post */
.delete-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px;
    border: none;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.delete-btn:hover {
    color: var(--danger-color);
    opacity: 1;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
}

.delete-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================
   Responsive Search (Mobile)
   ========================================================== */
@media (max-width: 768px) {
    .search-container {
        padding: 0 15px;
        margin: 15px auto;
    }
    
    #search-input {
        padding: 10px 45px 10px 15px;
        font-size: 0.95rem;
    }
    
    #search-button {
        right: 25px; /* 15px do padding + 10px extra */
        width: 36px;
        height: 36px;
    }
    
    #search-button svg {
        width: 20px;
        height: 20px;
    }
    
    .search-results {
        left: 15px;
        right: 15px;
        top: calc(100% + 3px);
    }
    
    .search-results .result-item {
        padding: 10px 14px;
    }
}

@media (max-width: 600px) {
    .search-container {
        padding: 0 10px;
    }
    
    #search-input {
        padding: 10px 40px 10px 12px;
        font-size: 0.9rem;
        border-width: 1.5px;
    }
    
    #search-button {
        right: 20px; /* 10px do padding + 10px extra */
        width: 34px;
        height: 34px;
    }
    
    #search-button svg {
        width: 18px;
        height: 18px;
    }
    
    .search-results {
        left: 10px;
        right: 10px;
        top: calc(100% + 2px);
    }
    
    .search-results .result-item {
        padding: 8px 12px;
    }
    
    .search-results .result-item .username {
        font-size: 0.95rem;
    }
    
    .search-results .result-item .post-content {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        -webkit-line-clamp: 1; /* Mostra apenas 1 linha no mobile */
        line-clamp: 1;
    }
}

/* ==========================================================
   Profile Page
   ========================================================== */
.profile-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.profile-content {
    display: flex;
    gap: 20px;
}

.profile-info, .profile-posts {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    border: 1px solid var(--border-color);
}

.profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--primary-color);
    background-size: cover;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    border: 3px solid var(--border-color);
}

.profile-picture:hover {
    transform: scale(1.1);
}

.profile-posts h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

/* ==========================================================
   Main Container & Feed
   ========================================================== */
.main-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.new-post {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.new-post:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

#feed {
    margin-top: 30px;
}

/* ==========================================================
   Post & Comments
   ========================================================== */
.post {
    background-color: var(--surface-color);
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    transition: transform 0.2s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.post:hover {
    transform: translateY(-5px);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin-right: 15px;
    background-size: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.username {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-color);
    white-space: nowrap;
}

.post-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: auto;
    white-space: nowrap;
}

.post-content {
    margin-top: 15px;
    font-size: 1rem;
    color: var(--text-color);
}

.post-image, .post-video {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 12px;
    margin-top: 15px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.post-video {
    margin-left: 20px;
}

.post-actions {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Comentários */
.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.comment {
    display: flex;
    align-items: flex-start;
    margin-top: 10px;
    padding: 10px;
    border-left: 3px solid var(--border-color);
    background-color: var(--background-color);
    border-radius: 8px;
}

.comment .profile-img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-content .username {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.comment-content p {
    color: var(--text-secondary);
    margin: 0;
}

.comment-actions {
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Botão de alternar comentários */
.toggle-comments-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 10px;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-comments-btn:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.comments-list {
    margin-bottom: 10px;
}

.comments-section textarea {
    margin-top: 10px;
    background-color: var(--surface-color);
    color: var(--text-color);
}

.comments-section button {
    margin-top: 5px;
}

/* Contador de caracteres */
.char-counter {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}
.char-counter.red {
    color: var(--danger-color);
}

/* ==========================================================
   Toast Notification
   ========================================================== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.toast.show {
    opacity: 1;
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.info {
    background-color: var(--primary-color);
}

.file-name {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ==========================================================
   Video Call Section
   ========================================================== */
.video-call-section {
    margin: 20px auto;
    max-width: 600px;
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    text-align: center;
    border: 1px solid var(--border-color);
}

#call-username {
    width: 70%;
    margin-right: 10px;
    background-color: var(--surface-color);
    color: var(--text-color);
}

#end-call-btn {
    width: fit-content;
    margin-top: 10px;
}

#video-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 100%;
    overflow: visible;
}

.video-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

#local-video, #remote-video {
    width: 100%;
    max-width: 280px;
    height: 210px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    background-color: #000;
    object-fit: cover;
    box-sizing: border-box;
}

/* ==========================================================
   Modal
   ========================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    text-align: center;
    max-width: 600px;
    width: 90%;
    border: 1px solid var(--border-color);
}

.modal-content h2 {
    color: var(--text-color);
}

#record-preview {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: #000;
    margin-bottom: 20px;
}

.record-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================
   Legal Footer
   ========================================================== */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 5px var(--shadow-color);
}

.legal-link {
    color: var(--text-color);
    font-size: 0.75rem;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
}

.legal-link:hover {
    color: var(--primary-color);
    background: rgba(66, 153, 225, 0.1);
    text-decoration: underline;
}

.legal-link::after {
    content: " ↗";
    font-size: 0.7rem;
}

/* ==========================================================
   Responsive Design
   ========================================================== */
@media (min-width: 768px) {
    .video-wrapper {
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .auth-container {
        padding: 20px;
    }

    .new-post, #login-section, #signup-section, .post {
        width: 100%;
        padding: 15px;
    }

    .username {
        font-size: 1rem;
    }

    button {
        font-size: 0.9rem;
    }
}

/* ==========================================================
   Section: Verificação
   ========================================================== */
#verify-section {
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    border: 1px solid var(--border-color);
}

#verify-section h2 {
    color: var(--text-color);
    margin-bottom: 20px;
}

#verify-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    html, body {
        width: 100%;
        min-height: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        overflow-x: hidden;
        background-image: none;
    }

    *, *::before, *::after {
        box-sizing: border-box;
    }

    body {
        padding: 0 8px;
        background-image: none;
    }

    .main-container,
    .profile-page,
    .new-post,
    #login-section,
    #signup-section,
    .post,
    .profile-info,
    .profile-posts,
    .modal-content,
    #verify-section {
        width: 100%;
        max-width: 100%;
        margin: 0 auto 16px auto;
        padding-left: 8px;
        padding-right: 8px;
        box-sizing: border-box;
    }

    .header {
        font-size: 1.2rem;
        padding: 12px 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .search-container {
        padding: 0 8px;
        max-width: 100%;
        box-sizing: border-box;
    }

    #search-input {
        font-size: 1rem;
        padding: 8px 12px;
        border-radius: 18px;
        width: 100%;
        box-sizing: border-box;
    }

    .profile-header,
    .profile-content {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .profile-picture,
    .profile-img {
        width: 60px;
        height: 60px;
    }

    /* Centraliza vídeos e imagens dentro do post */
    .post-image,
    .post-video,
    #record-preview,
    #local-video,
    #remote-video {
        display: block;
        width: 100%;
        max-width: 400px; /* ajuste conforme o limite desejado */
        min-width: 0;
        height: auto;
        border-radius: 8px;
        box-sizing: border-box;
        margin-left: auto;
        margin-right: auto;
        margin-top: 15px;
    }

    .video-call-section,
    #video-container,
    .video-wrapper {
        padding: 0 8px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }

    button,
    .custom-file-upload,
    .back-button,
    .delete-profile-btn {
        width: 100%;
        font-size: 1rem;
        padding: 12px 0;
        margin: 5px 0;
        box-sizing: border-box;
    }

    .comments-section textarea {
        min-height: 60px;
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .legal-footer {
        font-size: 0.8rem;
        padding: 8px 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Centraliza o conteúdo dos posts no mobile */
    .post {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
        padding-left: 8px;
        padding-right: 8px;
        text-align: center;
    }
}

/* ==========================================================
   Drawer Hamburguer e Sidebar
   ========================================================== */
.hamburger {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1101;
    width: 44px;
    height: 44px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: background 0.2s;
}
.hamburger span {
    display: block;
    width: 26px;
    height: 4px;
    background: var(--primary-color); /* azul */
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger:active, .hamburger:hover {
    background: var(--background-color);
}

.sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 292px; /* 220px + 2cm (~72px) */
    min-width: 292px;
    max-width: 100vw;
    height: 100vh;
    background: var(--surface-color); /* fundo do tema */
    color: var(--text-color);      /* letras do tema */
    padding-top: 80px;
    z-index: 1100;
    box-shadow: 2px 0 8px var(--shadow-color);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto; /* Permite rolar o menu se passar da tela */
    border-right: 1px solid var(--border-color);
}
.sidebar-drawer.open {
    transform: translateX(0);
}
.sidebar-drawer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-drawer li {
    margin: 10px 0;
    text-align: center;
}

.close-sidebar {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2em;
    cursor: pointer;
    z-index: 1200;
}
/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.25);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.sidebar-overlay.show {
    opacity: 1;
    pointer-events: all;
}
/* Ajuste main-container para não ficar atrás do menu */
.main-container {
    margin-left: 0 !important;
    transition: margin-left 0.2s;
}

/* Botão de alternar tema no menu lateral */
#theme-toggle-sidebar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.theme-icon-sidebar {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
    transition: transform 0.3s ease;
}

#theme-toggle-sidebar:hover .theme-icon-sidebar {
    transform: rotate(30deg);
}

/* Ícones do tema (sol e lua) no menu lateral */
.sun-icon-sidebar {
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.moon-icon-sidebar {
    display: none;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Modo claro - mostra sol */
[data-theme="light"] .sun-icon-sidebar {
    display: block;
    opacity: 1;
    transform: scale(1);
}

[data-theme="light"] .moon-icon-sidebar {
    display: none;
    opacity: 0;
    transform: scale(0.5);
}

/* Modo escuro - mostra lua */
[data-theme="dark"] .sun-icon-sidebar {
    display: none;
    opacity: 0;
    transform: scale(0.5);
}

[data-theme="dark"] .moon-icon-sidebar {
    display: block;
    opacity: 1;
    transform: scale(1);
}

/* Ajustes para vídeos e botão de encerrar chamada no drawer */
.drawer-content {
    padding: 0 16px 20px 16px;
    box-sizing: border-box;
}
.drawer-section {
    max-width: 100%;
}
#drawer-video .video-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
#drawer-video video {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    background: #000;
    margin-bottom: 8px;
    box-sizing: border-box;
}
#drawer-video #end-call-btn {
    display: block;
    width: 100%;
    margin: 10px 0 0 0;
    background: transparent;
    color: #e53935;
    border: 1px solid #e53935;
    border-radius: 8px;
    padding: 12px 0;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

#drawer-video #end-call-btn:hover {
    background-color: rgba(229, 57, 53, 0.1);
}

@media (max-width: 900px) {
    .sidebar-drawer {
        width: 70vw;
        min-width: 200px;
        max-width: 350px;
    }
    #drawer-video video {
        max-width: 90vw;
    }
}
@media (max-width: 600px) {
    .sidebar-drawer {
        width: 90vw;
        min-width: 140px;
        max-width: 100vw;
    }
    .hamburger {
        top: 12px;
        left: 12px;
        width: 38px;
        height: 38px;
    }
    .hamburger span {
        width: 20px;
        height: 3px;
    }
    #drawer-video video {
        max-width: 100vw;
    }
}

.drawer-content {
    padding-bottom: 100px !important;
}

/* ==========================================================
   Seção: Comunidades - REORGANIZADA E CORRIGIDA
   ========================================================== */

/* Container principal das comunidades no drawer */
#drawer-communities {
    padding: 16px;
    max-width: 100%;
    overflow-y: auto;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#drawer-communities h2 {
    margin: 0 0 16px 0;
    color: var(--text-color);
    font-size: 1.5rem;
    text-align: center;
}

/* Controles das comunidades */
.communities-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.communities-controls button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.communities-controls button:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Container da lista de comunidades */
#communities-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#communities-container h3 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

#communities-container p {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Card de comunidade */
.community-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.community-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--primary-color);
}

.community-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.community-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-color);
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.community-info {
    flex: 1;
    min-width: 0; /* Permite que o texto quebre corretamente */
}

.community-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.community-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.community-category {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.community-privacy {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.privacy-public {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.privacy-restricted {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.privacy-private {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

/* Modal de criação de comunidade */
#community-create-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.community-modal-content {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.community-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: center;
}

.community-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.upload-preview {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.preview-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    overflow: hidden;
}

.preview-banner {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    overflow: hidden;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.tag {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.tag-remove:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#create-community-submit {
    background: var(--primary-color);
    color: white;
    border: none;
}

#create-community-submit:hover {
    background: var(--secondary-color);
}

#cancel-community {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

#cancel-community:hover {
    background: var(--background-color);
    border-color: var(--text-secondary);
}

/* Página da comunidade */
#community-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: none;
}

.community-page-header {
    margin-bottom: 20px;
}

.community-banner {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid var(--border-color);
}

.community-info-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.community-info-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 4px solid var(--surface-color);
    position: relative;
    top: -30px;
    flex-shrink: 0;
}

.community-details {
    flex: 1;
    min-width: 300px;
}

.community-details h2 {
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-size: 1.8rem;
}

.community-details > p {
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.community-stats {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    min-width: 80px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}

.members-section {
    margin: 20px 0;
}

.community-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.community-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-top: 20px;
}

.community-topics {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    border: 1px solid var(--border-color);
}

.community-topics h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.topics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.topic-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-item:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
    border-color: var(--primary-color);
}

.topic-item.active {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.1);
}

.topic-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.topic-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Área de posts da comunidade */
#community-posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#community-posts-container h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

#community-posts-container > p {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 20px;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Post na comunidade */
.community-post {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.community-post:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
}

.community-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.community-post-header .profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-color);
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.community-post-header .username {
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-color);
}

.community-post-header .post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.community-post-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 10px;
}

.community-post-content {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-media-container {
    margin: 15px 0;
    text-align: center;
}

.post-media-container img,
.post-media-container video {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    object-fit: contain;
    background: #000;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-media-container img:hover {
    transform: scale(1.02);
}

.community-post-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.community-post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.community-post-action:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
}

.community-post-action.liked {
    color: var(--danger-color);
}

.community-post-action.liked:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Novo post na comunidade */
#new-community-post {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

#new-community-post textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-color);
    color: var(--text-color);
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
}

#new-community-post textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

#community-char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

#media-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

#media-preview-container img,
#media-preview-container video {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.remove-media-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.2s ease;
    position: absolute;
    top: 5px;
    right: 5px;
}

.remove-media-btn:hover {
    background: var(--danger-hover);
}

/* Seção de comentários */
.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.03);
    border-left: 3px solid var(--border-color);
}

.comment .profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-color);
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-content .username {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.comment-content p {
    color: var(--text-color);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.comment-content small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: block;
    margin-top: 4px;
}

.comment-input {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-comment-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-comment-btn:hover {
    background: var(--secondary-color);
}

/* Modal de mídia em tela cheia */
.media-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.media-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.media-modal-content img,
.media-modal-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.close-media-modal {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-media-modal:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Lista de membros */
.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--surface-color);
    transition: all 0.2s ease;
}

.member-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.member-item .profile-img-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-color);
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.member-item > div:first-of-type {
    flex: 1;
    min-width: 0;
}

.member-item div:first-of-type div:first-child {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-item small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.member-item span[style*="color: var(--primary-color)"] {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color) !important;
    white-space: nowrap;
}

/* Botão de exclusão de comunidade */
#delete-community-btn {
    background: linear-gradient(45deg, var(--danger-color), var(--danger-hover));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    font-size: 1rem;
}

#delete-community-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Responsividade */
@media (max-width: 1024px) {
    .community-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .community-topics {
        order: 2;
    }
    
    #community-posts-container {
        order: 1;
    }
}

@media (max-width: 768px) {
    #community-page {
        padding: 15px;
    }
    
    .community-info-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .community-info-icon {
        position: static;
        top: 0;
        margin: 0 auto 15px auto;
    }
    
    .community-details {
        min-width: 100%;
        text-align: center;
    }
    
    .community-stats {
        justify-content: center;
        gap: 20px;
    }
    
    .community-actions {
        justify-content: center;
    }
    
    .community-actions button {
        flex: 1;
        min-width: 200px;
    }
    
    .community-post-actions {
        flex-wrap: wrap;
    }
    
    .community-post-action {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
    
    .member-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 15px;
    }
    
    .member-item > div:first-of-type {
        width: 100%;
    }
    
    .member-item span[style*="color: var(--primary-color)"] {
        margin-left: 0;
        margin-top: 5px;
    }
    
    #delete-community-btn {
        padding: 14px;
        font-size: 1.05rem;
    }
}

@media (max-width: 600px) {
    .communities-controls button {
        padding: 14px;
        font-size: 1.05rem;
    }
    
    .community-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .members-section {
        margin: 15px 0 !important;
    }
    
    #show-members-btn {
        width: 100%;
        padding: 14px;
    }
    
    .post-media-container img,
    .post-media-container video {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .community-card {
        padding: 12px;
    }
    
    .community-icon {
        width: 40px;
        height: 40px;
    }
    
    .community-name {
        font-size: 1rem;
    }
    
    .community-description {
        font-size: 0.85rem;
    }
    
    .community-meta {
        gap: 8px;
    }
    
    .community-category,
    .community-privacy {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .post-media-container img,
    .post-media-container video {
        max-height: 300px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.community-card {
    animation: fadeIn 0.3s ease-out;
}

.community-post {
    animation: fadeIn 0.4s ease-out;
}

/* Scrollbar personalizada para o drawer de comunidades */
#drawer-communities::-webkit-scrollbar {
    width: 6px;
}

#drawer-communities::-webkit-scrollbar-track {
    background: transparent;
}

#drawer-communities::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#drawer-communities::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}