* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: #1e1f22; color: #dbdee1; user-select: none; }
input { user-select: text; }

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* TOASTS */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast { background-color: #2b2d31; color: white; padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); border-left: 4px solid; animation: slideIn 0.3s forwards; }
.toast.sucesso { border-color: #57F287; }
.toast.erro { border-color: #da373c; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* BOTŐES E INPUTS GERAIS */
button { cursor: pointer; border: none; outline: none; transition: 0.2s; font-weight: bold; }
input { background-color: #1e1f22; color: #dbdee1; border: none; padding: 12px; border-radius: 6px; outline: none; width: 100%; margin-bottom: 15px; }
.btn-primary { background-color: #5865F2; color: white; padding: 12px; border-radius: 6px; width: 100%; margin-bottom: 10px; }
.btn-primary:hover { background-color: #4752C4; }
.btn-secondary { background-color: #4e5058; color: white; padding: 12px; border-radius: 6px; width: 100%; }
.btn-secondary:hover { background-color: #6d6f78; }
.btn-danger { background-color: #da373c; color: white; padding: 12px; border-radius: 6px; width: 100%; }
.btn-danger:hover { background-color: #a1282c; }
.btn-icon { background: none; color: #b5bac1; padding: 5px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { color: #dbdee1; background-color: #3f4147; }

/* MODAIS */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 5000; }
.modal-content { background-color: #313338; padding: 25px; border-radius: 8px; width: 400px; max-width: 90%; }
.modal-content h3 { margin-bottom: 20px; color: #fff; text-align: center; }
.modal-content label { display: block; margin-bottom: 5px; color: #b5bac1; font-size: 12px; font-weight: bold; text-transform: uppercase; }
.modal-actions { display: flex; gap: 10px; margin-top: 15px; }
#btn-logout:hover { color: #a1282c !important; text-decoration: underline !important; }

/* LOGIN */
.screen-container { height: 100vh; display: flex; justify-content: center; align-items: center; }
.auth-box { background-color: #313338; padding: 40px; border-radius: 8px; width: 400px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.auth-box h2 { font-size: 24px; color: #fff; margin-bottom: 5px; }
.auth-box p { color: #949ba4; margin-bottom: 20px; font-size: 14px; }

/* LAYOUT 4 COLUNAS */
.main-layout { display: flex; width: 100%; height: 100vh; overflow: hidden; background-color: #313338; }
.main-content { flex: 1; display: flex; overflow: hidden; }
.room-container { flex: 1; display: flex; width: 100%; }

/* BARRA DE SERVIDORES */
.server-sidebar { width: 72px; background-color: #1e1f22; display: flex; flex-direction: column; align-items: center; padding: 12px 0; overflow-y: auto; flex-shrink: 0; }
.server-icon { width: 48px; height: 48px; border-radius: 24px; background-color: #313338; color: #dbdee1; display: flex; justify-content: center; align-items: center; font-size: 18px; font-weight: bold; cursor: pointer; transition: 0.2s; margin-bottom: 10px; overflow: hidden; }
.server-icon:hover, .server-icon.active { border-radius: 16px; background-color: #5865F2; color: #fff; }
.perfil-icon { background-color: #2b2d31; }
.add-icon { background-color: transparent; border: 1px dashed #5865F2; color: #57F287; }
.server-separator { width: 32px; height: 2px; background-color: #3f4147; margin-bottom: 10px; }

/* DASHBOARD CARDS */
.action-cards { display: flex; gap: 20px; flex-wrap: wrap; }
.card { background-color: #2b2d31; padding: 25px; border-radius: 8px; width: 300px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; text-align: center; }
.card:hover { border-color: #5865F2; background-color: #383a40; }
.card .icon { margin-bottom: 15px; }
.card h3 { color: #fff; margin-bottom: 10px; }
.card input { margin-bottom: 15px; background-color: #1e1f22; }

/* BARRAS LATERAIS */
.sidebar { width: 260px; background-color: #2b2d31; display: flex; flex-direction: column; flex-shrink: 0; }
.members-sidebar { width: 260px; background-color: #2b2d31; padding: 20px 10px; display: flex; flex-direction: column; flex-shrink: 0; }
.sala-header { padding: 20px; border-bottom: 1px solid #1e1f22; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.badge { background-color: #1e1f22; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; color: #949ba4; margin-top: 5px; display: inline-block; }
.categoria-header { padding: 15px 20px 5px; display: flex; justify-content: space-between; align-items: center; }
.categoria { font-size: 12px; font-weight: bold; color: #949ba4; text-transform: uppercase; }
.canais { padding: 0 10px; overflow-y: auto; }
.sala-btn { width: 100%; text-align: left; background: none; color: #949ba4; padding: 8px 10px; border-radius: 4px; font-size: 15px; display: flex; align-items: center; margin-bottom: 2px; }
.sala-btn:hover { background-color: #3f4147; color: #dbdee1; }

/* PAINEL DE USUÁRIO */
.user-panel { background-color: #232428; padding: 10px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-panel-avatar { width: 32px; height: 32px; border-radius: 50%; background-color: #5865F2; color: #fff; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 14px; }
.user-panel-info { flex: 1; overflow: hidden; }
.user-panel-name { font-size: 13px; font-weight: bold; color: #fff; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-panel-status { font-size: 11px; color: #949ba4; }

/* CHAT */
.chat-area { flex: 1; display: flex; flex-direction: column; background-color: #313338; }
.chat-header { padding: 15px 20px; border-bottom: 1px solid #2b2d31; display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.chat-header h3 { color: #fff; font-size: 16px; margin: 0; }
.mensagens-container { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.msg-box { display: flex; flex-direction: column; }
.msg-box .autor-click { font-weight: bold; margin-right: 8px; font-size: 15px; cursor: pointer; }
.msg-box .autor-click:hover { text-decoration: underline; }
.msg-box .hora { font-size: 11px; color: #949ba4; }
.msg-box .texto { color: #dbdee1; font-size: 15px; margin-top: 5px; word-break: break-word; }
.chat-link { color: #00a8fc; text-decoration: none; }
.chat-link:hover { text-decoration: underline; }
.chat-imagem { max-width: 300px; max-height: 300px; border-radius: 8px; margin-top: 10px; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.editado-tag { font-size: 10px; color: #949ba4; margin-left: 5px; user-select: none; }
.input-area { padding: 0 20px 20px 20px; }
.input-wrapper { display: flex; align-items: center; background-color: #383a40; border-radius: 8px; padding: 0 10px; }
.input-wrapper input[type="text"] { background: transparent; margin: 0; padding: 15px 10px; width: 100%; font-size: 15px; }
.upload-btn { cursor: pointer; padding: 10px; border-radius: 50%; }

/* MENU DE CONTEXTO */
#context-menu { position: absolute; background-color: #111214; border: 1px solid #2b2d31; padding: 15px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 10000; width: 220px; }
#context-menu label { font-size: 12px; color: #b5bac1; font-weight: bold; margin-bottom: 5px; display: block; }
#context-menu select, #context-menu input[type="range"] { width: 100%; margin-bottom: 10px; background-color: #1e1f22; color: #dbdee1; border: none; padding: 8px; border-radius: 4px; outline: none; }

/* MEMBROS ONLINE/OFFLINE */
.membro-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; cursor: pointer; transition: 0.2s; color: #949ba4; }
.membro-item:hover { background-color: #3f4147; }
.membro-avatar-container { position: relative; }
.membro-avatar { width: 32px; height: 32px; background-color: #5865F2; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-weight: bold; font-size: 14px; }
.membro-status { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #2b2d31; position: absolute; bottom: -2px; right: -2px; }
.status-on { background-color: #57F287; }
.status-off { background-color: #80848e; }
.membro-offline { opacity: 0.5; }

/* VOZ (Barra Lateral e Grid Central) */
.membro-voz-lista { font-size: 13px; color: #949ba4; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 30px; margin-bottom: 2px; }
.membro-voz-lista .avatar-mini { width: 22px; height: 22px; background-color: #5865F2; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-size: 11px; font-weight: bold; flex-shrink: 0; }

.voice-grid { flex: 1; background-color: #111214; padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; align-content: start; overflow-y: auto; }
.voice-card { background-color: #2b2d31; border-radius: 12px; aspect-ratio: 16/9; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.3); width: 100%; height: auto; overflow: hidden; }
.voice-card .nome-tag { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.7); padding: 4px 8px; border-radius: 4px; font-size: 13px; font-weight: bold; color: #fff; z-index: 10; }
.voice-video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 5; }

/* BOTOES DE CONTROLE DE VOZ (Tamanhos exatos) */
.voice-controls { height: 80px; background-color: #2b2d31; display: flex; justify-content: center; align-items: center; gap: 15px; }
.vc-btn { background-color: #383a40; padding: 0; border-radius: 50%; width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; color: #dbdee1; transition: 0.2s; }
.vc-btn:hover { background-color: #4e5058; }
.vc-btn.active-vc-btn { background-color: #fff; color: #111214; }
.btn-danger.vc-btn { background-color: #da373c; color: white; }
.btn-danger.vc-btn:hover { background-color: #a1282c; }

/* RESPONSIVO */
.mobile-toggle { display: none; margin: 0; }
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .chat-header { justify-content: space-between; padding: 0 10px; width: 100%; box-sizing: border-box; }
    .chat-header h3 { flex: 1; text-align: center; font-size: 16px; margin: 0; }
    .sidebar, .members-sidebar { position: fixed; top: 0; height: 100vh; z-index: 1000; transition: 0.3s transform; background-color: #2b2d31; }
    .sidebar { left: 72px; transform: translateX(-150%); width: calc(100vw - 72px); max-width: 280px; box-shadow: 2px 0 10px rgba(0,0,0,0.5); }
    .sidebar.open { transform: translateX(0); }
    .members-sidebar { right: 0; transform: translateX(150%); width: 260px; box-shadow: -2px 0 10px rgba(0,0,0,0.5); }
    .members-sidebar.open { transform: translateX(0); }
    .chat-area { width: calc(100vw - 72px); max-width: 100%; position: relative; }
    .input-wrapper input[type="text"] { font-size: 16px; }
}