/* ===================================================================
   MiCord CHAT APP - TEMA BRANCO COM ROSA CLARO & MODO ESCURO
   =================================================================== */

:root {
    /* Paleta Clara Padrão: Branco com Rosa Claro */
    --bg-primary: #ffffff;
    --bg-secondary: #fff5f8;
    --bg-tertiary: #ffeef3;
    --bg-hover: #ffe4ee;
    --bg-card: #ffffff;
    
    --accent-pink: #ff5c8d;
    --accent-pink-hover: #ff3d77;
    --accent-pink-soft: #ffeaf1;
    --accent-pink-border: #f8c9d9;
    --accent-gradient: linear-gradient(135deg, #ff759f 0%, #ff4b82 100%);

    --text-primary: #2d1c25;
    --text-secondary: #745f6b;
    --text-muted: #a6919e;
    --text-inverse: #ffffff;

    --border-color: #f7d6e2;
    --border-light: #fcecf2;

    --online-green: #2ecc71;
    --idle-yellow: #f1c40f;
    --dnd-red: #e74c3c;
    --offline-gray: #95a5a6;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 10px rgba(255, 92, 141, 0.08);
    --shadow-md: 0 8px 25px rgba(255, 92, 141, 0.12);
    --shadow-lg: 0 16px 40px rgba(255, 92, 141, 0.16);

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --rail-width: 72px;
    --sidebar-width: 250px;
    --members-width: 240px;
}

[data-theme="dark"] {
    /* Tema Escuro com Acentos Rosa Claro / Neon Soft */
    --bg-primary: #151117;
    --bg-secondary: #1d1720;
    --bg-tertiary: #271f2b;
    --bg-hover: #332838;
    --bg-card: #1f1823;

    --accent-pink: #ff6899;
    --accent-pink-hover: #ff85ae;
    --accent-pink-soft: #38212f;
    --accent-pink-border: #523046;
    --accent-gradient: linear-gradient(135deg, #ff6899 0%, #ff407d 100%);

    --text-primary: #fcf7fa;
    --text-secondary: #c9bac4;
    --text-muted: #857280;
    --text-inverse: #151117;

    --border-color: #382c3c;
    --border-light: #2c2330;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* ===================================================================
   TELA DE AUTENTICAÇÃO (LOGIN / REGISTRO)
   =================================================================== */

.auth-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, var(--bg-tertiary) 0%, var(--bg-primary) 80%);
    z-index: 999;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-pink-soft);
    border: 1px solid var(--accent-pink-border);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 14px;
}

.brand-icon {
    font-size: 1.2rem;
}

.brand-title {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--accent-pink);
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--accent-pink);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-select:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(255, 92, 141, 0.15);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(255, 92, 141, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-danger {
    background: #e74c3c;
    color: #ffffff;
}

.btn-success {
    background: #2ecc71;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

.btn-chip {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-pink-border);
    border-radius: var(--radius-sm);
    color: var(--accent-pink);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 8px;
    cursor: pointer;
}

.btn-chip:hover {
    background: var(--accent-pink-soft);
}

.alert-box {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-box.error {
    background: #fde8e8;
    color: #c81e1e;
    border: 1px solid #f8b4b4;
}

.alert-box.success {
    background: #def7ec;
    color: #03543f;
    border: 1px solid #84e1bc;
}

/* ===================================================================
   LAYOUT PRINCIPAL
   =================================================================== */

.main-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* 1. Barra de Servidores (Rail) */
.servers-rail {
    width: var(--rail-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    flex-shrink: 0;
    z-index: 10;
}

.server-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.server-btn:hover {
    border-radius: var(--radius-md);
    background: var(--accent-pink);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(255, 92, 141, 0.35);
}

.server-btn.active {
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(255, 92, 141, 0.4);
}

.server-btn.home-btn {
    font-size: 1.3rem;
}

.server-btn.add-btn {
    border: 2px dashed var(--accent-pink-border);
    color: var(--accent-pink);
    font-weight: 700;
}

.server-btn.theme-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.rail-divider {
    width: 32px;
    height: 2px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    margin: 4px 0;
}

.servers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    width: 100%;
    align-items: center;
    flex: 1;
}

.servers-list::-webkit-scrollbar {
    display: none;
}

.rail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 2. Barra Lateral Secundária (Canais / Amigos) */
.sidebar-secondary {
    width: var(--sidebar-width);
    background-color: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.header-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.friends-nav-links {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-pink-soft);
    color: var(--accent-pink);
}

.nav-item.highlight {
    color: var(--accent-pink);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--accent-pink);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.section-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dm-conversations-list,
.channels-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.channel-item,
.dm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.channel-item:hover,
.dm-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.channel-item.active,
.dm-item.active {
    background: var(--accent-pink-soft);
    color: var(--accent-pink);
    font-weight: 600;
}

.channel-symbol {
    font-weight: 700;
    color: var(--accent-pink);
}

.channel-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    padding: 4px 8px;
}

.btn-icon-tiny {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

.btn-icon-tiny:hover {
    color: var(--accent-pink);
    background: var(--bg-hover);
}

/* Membros dentro da sala de voz no sidebar */
.voice-channel-members {
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 3px;
}

.voice-peer-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
}

.voice-peer-pill .peer-avatar {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
}

.voice-peer-pill.speaking .peer-avatar {
    border-color: var(--online-green);
    box-shadow: 0 0 6px var(--online-green);
}

/* Barra de Usuário Inferior */
.user-control-tray {
    height: 56px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.user-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    flex: 1;
    overflow: hidden;
}

.user-preview:hover {
    background: var(--bg-hover);
}

.avatar-wrapper {
    position: relative;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--accent-pink-border);
}

.status-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

.status-indicator.online { background-color: var(--online-green); }
.status-indicator.idle { background-color: var(--idle-yellow); }
.status-indicator.dnd { background-color: var(--dnd-red); }
.status-indicator.offline { background-color: var(--offline-gray); }

.user-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-display-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.user-media-controls {
    display: flex;
    gap: 4px;
}

.tray-icon-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.tray-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-pink);
}

.tray-icon-btn.active {
    color: var(--dnd-red);
}

/* 3. Área Central (Workspace) */
.chat-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

.workspace-topbar {
    height: 52px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
}

.topbar-divider {
    color: var(--border-color);
}

.topbar-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent-pink);
}

.workspace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Hub de Amigos */
.hub-search-bar {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.hub-search-bar input {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.friends-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.friend-row:hover {
    border-color: var(--accent-pink-border);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.friend-actions {
    display: flex;
    gap: 8px;
}

/* Adicionar Amigo */
.add-friend-section {
    padding: 24px;
}

.add-friend-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.add-friend-card h3 {
    margin-bottom: 6px;
    font-size: 1.1rem;
    color: var(--accent-pink);
}

.add-friend-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.feedback-msg {
    margin-top: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}

/* Área de Mensagens */
.messages-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-item {
    display: flex;
    gap: 14px;
    animation: fadeIn 0.15s ease;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.message-body {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.message-author {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.message-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.message-text {
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.message-attachment-img {
    margin-top: 8px;
    max-width: 420px;
    max-height: 300px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: block;
}

.message-attachment-img:hover {
    filter: brightness(0.95);
}

.typing-indicator-bar {
    padding: 4px 24px;
    font-size: 0.78rem;
    color: var(--accent-pink);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Barra de envio */
.message-composer-wrapper {
    padding: 12px 20px 18px 20px;
    background: var(--bg-primary);
    position: relative;
}

.composer-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
}

.composer-box:focus-within {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(255, 92, 141, 0.12);
}

.btn-composer-icon {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.btn-composer-icon:hover {
    color: var(--accent-pink);
    background: var(--bg-hover);
}

.composer-box textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    line-height: 1.4;
}

.btn-composer-send {
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

.attachment-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--accent-pink-soft);
    border: 1px solid var(--accent-pink-border);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--accent-pink);
    font-weight: 600;
}

.btn-close-sm {
    background: transparent;
    border: none;
    color: var(--accent-pink);
    cursor: pointer;
    font-weight: bold;
}

.emoji-picker-dropdown {
    position: absolute;
    bottom: 75px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 12px;
    z-index: 50;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    font-size: 1.4rem;
    cursor: pointer;
}

.emoji-grid span {
    padding: 6px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.emoji-grid span:hover {
    background: var(--bg-hover);
    transform: scale(1.15);
}

/* 4. Coluna de Membros */
.sidebar-members {
    width: var(--members-width);
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.members-header {
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.members-header h4 {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
}

.members-badge {
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--accent-pink);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.members-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.member-item:hover {
    background: var(--bg-hover);
}

/* Modais */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 24px;
    animation: fadeInScale 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
}

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

.modal-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 18px;
}

.modal-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.modal-tab.active {
    background: var(--bg-card);
    color: var(--accent-pink);
    box-shadow: var(--shadow-sm);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.radio-card input {
    margin-top: 3px;
}

.card-box strong {
    display: block;
    font-size: 0.9rem;
}

.card-box small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

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

.form-actions-split button {
    flex: 1;
}

/* Banner de Chamada Recebida */
.incoming-call-card {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 2px solid var(--accent-pink);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: bounceIn 0.4s ease;
}

.caller-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.caller-info img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
}

.call-actions {
    display: flex;
    gap: 10px;
}

.call-actions button {
    flex: 1;
}

/* Lightbox de Imagem */
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox-content img {
    max-width: 85vw;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--accent-pink);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 12px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    animation: slideInRight 0.25s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}


/* ===================================================================
   EDITOR DE AVATAR E CARTÃO DE PERFIL DO USUÁRIO
   =================================================================== */
.clickable-user {
    cursor: pointer;
}

.message-author.clickable-user:hover {
    text-decoration: underline;
}

.profile-avatar-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-avatar-preview-img {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--accent-pink);
    box-shadow: var(--shadow-sm);
}

.user-profile-modal-card {
    max-width: 380px;
}

.user-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-card-avatar-wrap {
    position: relative;
    width: 78px;
    height: 78px;
    flex-shrink: 0;
}

.user-card-avatar-img {
    width: 78px;
    height: 78px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--accent-pink);
    cursor: zoom-in;
}

.user-card-identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.user-card-identity h3 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
}

.user-card-handle {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.user-card-role {
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.user-card-role.ceo {
    background: linear-gradient(135deg, #fef08a, #fde047);
    color: #854d0e;
    border: 1px solid #eab308;
}

.user-card-role.admin {
    background: #f3e8ff;
    color: #7e22ce;
}

.user-card-role.moderator {
    background: #e1effe;
    color: #1e429f;
}

.user-card-bio-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.user-card-bio-box small {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.user-card-bio-box p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.user-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* ===================================================================
   BOTÃO FLUTUANTE DE REPORTAR BUG & BOTÃO SAIR DO GRUPO
   =================================================================== */
.floating-bug-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 2px solid var(--accent-pink);
    box-shadow: var(--shadow-lg);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.floating-bug-btn:hover {
    transform: translateY(-3px) scale(1.06);
    background: var(--accent-pink-soft);
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.35);
}

.server-footer-actions {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-leave-group {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(231, 76, 60, 0.35);
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-leave-group:hover {
    background: #e74c3c;
    color: #ffffff;
}


/* ===================================================================
   LINKS CLICÁVEIS E PRÉ-VISUALIZAÇÃO DE VÍDEOS DO YOUTUBE NO CHAT
   =================================================================== */
.chat-link {
    color: var(--accent-pink);
    text-decoration: underline;
    word-break: break-all;
}

.chat-link:hover {
    opacity: 0.85;
}

.youtube-embed-card {
    margin-top: 8px;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid #ff0000;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.youtube-embed-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.youtube-provider {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.youtube-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-pink);
    text-decoration: none;
    line-height: 1.3;
}

.youtube-title:hover {
    text-decoration: underline;
}

.youtube-author {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.youtube-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000000;
    cursor: pointer;
}

.youtube-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.youtube-thumb-wrapper:hover .youtube-thumb-img {
    transform: scale(1.03);
    opacity: 0.9;
}

.youtube-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 0, 0, 0.9);
    color: #ffffff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: background 0.15s ease, transform 0.15s ease;
}

.youtube-thumb-wrapper:hover .youtube-play-btn {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.08);
}

.youtube-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
