/* LIBERTY - Premium Minimalist Design System
 * Black & Gold Professional Theme
 * Clean, elegant, purposeful
 */

:root {
    /* Primary Palette - Refined Gold */
    --gold-primary: #D4AF37;
    --gold-light: #E8C547;
    --gold-dark: #B8941F;
    --gold-muted: #8B7355;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-subtle: rgba(212, 175, 55, 0.08);
    --gold-border: rgba(212, 175, 55, 0.15);
    
    /* Black Scale - Sophisticated Depth */
    --black-pure: #000000;
    --black-deep: #050505;
    --black-rich: #0A0A0A;
    --black-elevated: #0F0F0F;
    --black-card: #141414;
    --black-surface: #1A1A1A;
    --black-border: #222222;
    --black-border-hover: #2A2A2A;
    
    /* Text Hierarchy */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-tertiary: rgba(255, 255, 255, 0.50);
    --text-muted: rgba(255, 255, 255, 0.35);
    --text-inverse: #000000;
    
    /* Status Colors */
    --status-online: #D4AF37;
    --status-idle: #F0A500;
    --status-dnd: #C41E3A;
    --status-offline: #666666;
    
    /* System */
    --error: #C41E3A;
    --success: #4ADE80;
    --warning: #F59E0B;
    
    /* Spacing Scale - 4px base */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Border Radius - Subtle */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Typography Scale */
    --font-xs: 11px;
    --font-sm: 12px;
    --font-base: 14px;
    --font-md: 15px;
    --font-lg: 16px;
    --font-xl: 18px;
    --font-2xl: 20px;
    --font-3xl: 24px;
    
    /* Transitions - Refined */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Shadows - Minimalist Depth */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px var(--gold-glow);
    --shadow-gold-sm: 0 0 8px var(--gold-glow);
}

/* Base Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-feature-settings: 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-base);
    font-weight: 400;
    line-height: 1.5;
    background: var(--black-rich);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Scrollbar - Minimalist */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gold-muted);
    border-radius: var(--radius-full);
    opacity: 0.5;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Selection */
::selection {
    background: var(--gold-subtle);
    color: var(--gold-light);
}

/* Utility */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

/* Remover overlays pretos de imagens */
img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    background: transparent;
}
img::before,
img::after {
    display: none !important;
}

/* Animations - Premium */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--gold-glow); }
    50% { box-shadow: 0 0 20px var(--gold-glow), 0 0 40px var(--gold-subtle); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes borderGlow {
    0%, 100% { border-color: var(--gold-border); }
    50% { border-color: var(--gold-muted); }
}

/* LOGIN - Premium Gold */
.login-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black-pure);
    animation: fadeIn 0.5s ease;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, var(--gold-subtle) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, var(--gold-subtle) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

.mouse-follower {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    filter: blur(80px);
}

.login-box {
    position: relative;
    width: 380px;
    padding: 48px 40px;
    background: var(--black-surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gold-border);
    text-align: center;
    animation: slideUp 0.6s ease;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.1);
}

.login-logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    border-radius: var(--radius-xl);
    object-fit: cover;
    filter: drop-shadow(0 0 30px var(--gold-glow));
    animation: float 6s ease-in-out infinite, glow 4s ease-in-out infinite;
}

.login-box h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 4px;
    text-shadow: 0 0 30px var(--gold-glow);
    letter-spacing: -0.5px;
}

.login-box > p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 14px;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--black-deep);
    border: 1px solid var(--black-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-base);
}

.form-group {
    margin-bottom: 12px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--black-deep);
    border: 1px solid var(--black-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.auth-form input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-subtle);
}

.auth-form button {
    width: 100%;
    padding: 14px;
    background: var(--gold-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--black-pure);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--gold-glow);
    background: var(--gold-light);
}

.auth-form button:active {
    transform: translateY(0);
}

.switch-text {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.switch-text a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

.switch-text a:hover { color: var(--gold-light); }

/* Auth choice & MFA setup */
.auth-choice-buttons { display: flex; flex-direction: column; gap: 12px; }
.auth-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}
.auth-btn.primary {
    background: var(--gold-primary);
    color: var(--black-pure);
    border-color: var(--gold-primary);
}
.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--gold-glow);
    background: var(--gold-light);
}
.auth-btn.secondary {
    background: transparent;
    color: var(--gold-primary);
    border-color: var(--gold-border);
}
.auth-btn.secondary:hover {
    border-color: var(--gold-primary);
    background: var(--gold-subtle);
}
.mfa-setup-box { max-width: 400px; }
.mfa-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.channel-perms-list label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--black-elevated);
    border: 1px solid var(--black-border);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.channel-perms-list label:hover {
    border-color: var(--gold-border);
    background: var(--gold-subtle);
}

.mfa-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--black-deep);
    border: 1px solid var(--black-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
}
.mfa-option:hover {
    border-color: var(--gold-primary);
    background: var(--gold-subtle);
}
.mfa-option i { font-size: 18px; color: var(--gold-primary); width: 24px; }
#mfa-skip { margin-top: 8px; }

/* APP LAYOUT */
.app {
    display: flex;
    height: 100vh;
    animation: fadeIn 0.5s ease;
    position: relative;
}
.app .server-bar,
.app .channel-bar,
.app .main-content,
.app .member-bar {
    position: relative;
    z-index: 1;
}
.app-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center;
}
.app-bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.app-has-custom-bg .server-bar { background: rgba(10, 10, 10, var(--interface-opacity, 0.6)); }
.app-has-custom-bg .channel-bar { background: rgba(17, 17, 17, var(--interface-opacity, 0.6)); }
.app-has-custom-bg .main-content { background-color: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .channel-content { background: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .ranking-view { background: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .search-box { background: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .channel-header { background: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .main-header { background: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .user-panel { background: rgba(0, 0, 0, var(--interface-opacity, 0.5)); }
.app-has-custom-bg .dm-item,
.app-has-custom-bg .channel-item {
    background: rgba(0, 0, 0, var(--interface-opacity, 0.5));
}
.app-has-custom-bg .dm-item:hover,
.app-has-custom-bg .channel-item:hover {
    background: rgba(26, 26, 26, calc(var(--interface-opacity, 0.5) + 0.1));
}
.app-has-custom-bg .member-bar,
.app-has-custom-bg .member-bar .member-header,
.app-has-custom-bg .member-bar .member-group {
    background: rgba(17, 17, 17, var(--interface-opacity, 0.6));
}
.app-has-custom-bg .member-bar .member-item:hover {
    background: rgba(26, 26, 26, calc(var(--interface-opacity, 0.6) + 0.1));
}
.app.compact-mode .server-bar { padding: 6px 0; }
.app.compact-mode .server-icon { width: 40px; height: 40px; margin-bottom: 4px; font-size: 16px; }
.app.compact-mode .channel-item { padding: 4px 12px; font-size: 13px; }
.app.compact-mode .member-item { padding: 6px 12px; }

/* Server Bar */
.server-bar {
    width: 72px;
    background: var(--black-elevated);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    border-right: 1px solid var(--black-border);
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    color: #000;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-base);
}

.server-icon::before {
    content: '';
    position: absolute;
    left: -16px;
    width: 8px;
    height: 0;
    background: var(--gold-primary);
    border-radius: 0 4px 4px 0;
    transition: height var(--transition-base);
}

.server-icon:hover {
    border-radius: 12px;
    background: linear-gradient(135deg, #FFE55C, #FFD700);
    color: #000;
    transform: scale(1.1);
}

.server-icon:hover img {
    border-radius: 10px;
}

.server-icon:hover::before {
    height: 20px;
}

.server-icon.active {
    border-radius: 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.server-icon.active img {
    border-radius: 10px;
}

.server-icon.active::before {
    height: 36px;
}

.server-icon.add {
    border: 2px dashed var(--gold-primary);
    background: transparent;
    color: var(--gold-primary);
    border-radius: 12px;
}

.server-icon.add:hover {
    background: var(--gold-primary);
    color: var(--black-rich);
    border-style: solid;
}

.server-divider {
    width: 32px;
    height: 2px;
    background: var(--black-surface);
    border-radius: 1px;
    margin: 8px 0;
}

#server-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

/* Channel Bar - Order 1, leftmost */
.channel-bar {
    width: 240px;
    background: #000;
    display: flex;
    flex-direction: column;
    order: 1;
}

.channel-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--black-surface);
    flex-shrink: 0;
    background: #000;
}

.channel-header span {
    font-weight: 600;
    color: var(--gold-primary);
}

.channel-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.channel-header button:hover { 
    color: var(--gold-primary); 
    background: var(--gold-subtle);
}

.channel-header .header-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}
.header-icon-btn:hover {
    color: var(--gold-primary);
    background: var(--gold-subtle);
}
.header-icon-btn.hidden { display: none !important; }

.channel-header .admin-btn.hidden { display: none !important; }

.search-box {
    position: relative;
    padding: 12px;
    flex-shrink: 0;
}

.search-box i {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 12px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--black-rich);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-base);
}

.search-box input:focus {
    box-shadow: 0 0 0 2px var(--gold-subtle);
}

/* Wrapper para manter o dropdown alinhado à barra de pesquisa */
.search-box-wrapper {
    position: relative;
    flex-shrink: 0;
}

.search-results-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--black-rich);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border: 1px solid var(--black-surface);
    z-index: 9999;
    display: none;
}

.search-results-panel.is-open,
.search-results-panel.active {
    display: block;
}

.search-results-inner {
    padding: 6px 0;
}

.search-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 6px 12px 4px;
    letter-spacing: 0.02em;
}

.search-results-section {
    padding: 4px 0;
}

.search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.search-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.search-result-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.search-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.search-results-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 6px 12px 4px;
    letter-spacing: 0.02em;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border: none;
    width: 100%;
    background: none;
    color: var(--text-primary);
    font-size: 13px;
    text-align: left;
    transition: background var(--transition-base);
}

.search-result-item:hover,
.search-result-item:focus {
    background: var(--gold-subtle);
    outline: none;
}

.search-result-item i {
    color: var(--text-tertiary);
    width: 18px;
    text-align: center;
}

.search-result-item .search-result-primary {
    flex: 1;
    min-width: 0;
}

.search-result-item .search-result-primary strong {
    color: var(--text-primary);
}

.search-result-item .search-result-secondary {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-msg {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.search-results-loading {
    padding: 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Destaque ao navegar para uma mensagem pela pesquisa */
.message.search-highlight {
    animation: searchHighlight 0.6s ease;
}

@keyframes searchHighlight {
    0%, 100% { background: transparent; }
    50% { background: var(--gold-subtle); border-radius: var(--radius-md); }
}

.channel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    background: #000;
}

/* Force channel section visibility */
#channel-section {
    display: block !important;
    min-height: 100px;
}

#channel-section.hidden {
    display: none !important;
}

#channel-section:not(.hidden) {
    display: block !important;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 8px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.add-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.add-btn:hover {
    color: var(--gold-primary);
    background: var(--gold-subtle);
}

/* Atalhos do menu inicial (Rankings, etc.) - estilo Discord */
.dm-home-shortcuts {
    padding: 12px 8px 8px;
    border-bottom: 1px solid var(--black-surface);
    margin-bottom: 4px;
}
.dm-shortcut-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 14px;
    color: var(--text-secondary);
}
.dm-shortcut-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-tertiary);
    transition: color var(--transition-base);
}
.dm-shortcut-item:hover {
    background: var(--black-surface);
    color: var(--text-primary);
}
.dm-shortcut-item:hover i {
    color: var(--gold-primary);
}
.dm-shortcut-item.active {
    background: var(--gold-subtle);
    color: var(--gold-primary);
}
.dm-shortcut-item.active i {
    color: var(--gold-primary);
}
.dm-shortcut-disabled {
    opacity: 0.5;
    cursor: default;
}
.dm-shortcut-disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}
.dm-shortcut-disabled:hover i {
    color: var(--text-tertiary);
}

.dm-item, .channel-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 2px;
    transition: all var(--transition-base);
    background: #000;
}

.dm-item:hover, .channel-item:hover { 
    background: var(--black-surface); 
}

.dm-item.active, .channel-item.active { 
    background: var(--gold-subtle); 
}

.dm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

.dm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dm-item span, .channel-item span {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color var(--transition-base);
}

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

.dm-folder .dm-avatar { border-radius: var(--radius-md); }
.dm-folder.expanded .dm-avatar i { transform: rotate(0deg); }
.dm-avatar i.fa-chevron-down { transition: transform var(--transition-base); }
.dm-folder:not(.expanded) .dm-avatar i.fa-chevron-down { transform: rotate(-90deg); }
.dm-folder-children { margin-left: 12px; border-left: 1px solid var(--black-surface); padding-left: 8px; }
.dm-folder-children .dm-item { padding: 6px 10px; }
.dm-text .dm-avatar { border-radius: 4px; }

.dm-list-empty {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}

.channel-item i {
    margin-right: 8px;
    color: var(--text-tertiary);
    transition: color var(--transition-base);
}

.channel-item:hover i, .channel-item.active i { 
    color: var(--gold-primary); 
}

.category-header {
    padding: 16px 8px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    cursor: pointer;
}

.channel-drop-zone {
    padding: 8px 12px;
    margin: 4px 8px 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border: 2px dashed transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
}
.channel-drop-zone i { opacity: 0.7; }
.channel-drop-zone.drag-over,
.category-drop.drag-over .category-header {
    border-color: var(--gold-primary);
    background: var(--gold-subtle);
    color: var(--gold-primary);
}
.category-drop.drag-over {
    border-radius: var(--radius-md);
    border: 2px dashed var(--gold-primary);
    margin: 2px 4px;
    padding: 0 4px 8px;
}
.category-drop.drag-over .category-header {
    border: none;
    background: transparent;
    margin: 0 -4px;
}
.channel-item.dragging { opacity: 0.5; }
.channel-item[draggable="true"] { cursor: grab; }
.channel-item[draggable="true"]:active { cursor: grabbing; }

/* Add Channel Button - Visible with + icon */
.channel-item-add {
    border: 2px dashed var(--gold-primary) !important;
    background: rgba(255, 215, 0, 0.1) !important;
    color: var(--gold-primary) !important;
    font-weight: 600 !important;
    margin-top: 8px !important;
    cursor: pointer !important;
}

.channel-item-add i {
    color: var(--gold-primary) !important;
    font-size: 14px !important;
    margin-right: 8px !important;
}

.channel-item-add span {
    color: var(--gold-primary) !important;
    font-size: 14px !important;
}

.channel-item-add:hover {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: var(--gold-light) !important;
    transform: scale(1.02) !important;
}

.channel-item-add:hover i,
.channel-item-add:hover span {
    color: var(--gold-light) !important;
}

/* User Panel */
.user-panel {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #000;
    flex-shrink: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 12px;
    color: var(--black-rich);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-avatar img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
    font-size: 0.5em;
    color: var(--black-rich);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.user-avatar .avatar-initials { font-size: 12px; }
.user-profile-avatar .avatar-initials { font-size: 28px; }
.account-avatar .avatar-initials { font-size: 24px; }
.profile-avatar-small .avatar-initials { font-size: 18px; }

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--gold-glow);
}

.user-info { flex: 1; min-width: 0; }
.username { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.user-tag { font-size: 11px; color: var(--text-tertiary); }

.user-controls { display: flex; gap: 4px; }
.user-controls button {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.user-controls button:hover { 
    color: var(--gold-primary); 
    background: var(--gold-subtle);
}

.user-controls button.muted { 
    color: var(--error); 
    background: rgba(239, 68, 68, 0.1);
}

.user-controls button.deafened { 
    color: var(--error); 
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content - Order 2, between channel and server bars */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--black-rich);
    min-width: 0;
    height: 100%;
    overflow: hidden;
    order: 2;
}

/* Message Actions */
.message-actions {
    display: none;
}

.message:hover .message-actions {
    display: flex;
}

/* Server Config Modal */
.server-config-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #1f1f1f;
    padding-bottom: 12px;
}

.config-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.config-tab:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.config-tab.active {
    background: rgba(255,215,0,0.1);
    color: #FFD700;
}

.config-tab.danger-tab:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.config-panel {
    display: none;
}

.config-panel.active {
    display: block;
}

.channel-config-item,
.member-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #141414;
    border-radius: 8px;
    margin-bottom: 8px;
}

.channel-info,
.member-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-danger {
    padding: 6px 12px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 4px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(239,68,68,0.2);
}

.btn-warning {
    padding: 6px 12px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 4px;
    color: #f59e0b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-warning:hover {
    background: rgba(245,158,11,0.2);
}

.deleted-message-item {
    padding: 12px;
    background: #141414;
    border-radius: 8px;
    margin-bottom: 8px;
}

.deleted-message-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.deleted-message-content {
    color: #666;
    font-size: 14px;
    padding-left: 12px;
    border-left: 2px solid #ef4444;
}

.main-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--black-surface);
    flex-shrink: 0;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-info i { color: var(--text-tertiary); }
.channel-info span { font-weight: 600; }

.header-actions { display: flex; gap: 4px; }
.header-actions button {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.header-actions button:hover { 
    color: var(--gold-primary); 
    background: var(--gold-subtle);
}

/* Voice Bar */
.voice-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(90deg, var(--gold-subtle), transparent);
    border-bottom: 1px solid var(--gold-subtle);
    animation: slideUp 0.3s ease;
}

.voice-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gold-primary);
    font-size: 14px;
    font-weight: 500;
}

.voice-info i {
    animation: pulse 2s ease-in-out infinite;
}

.voice-controls { display: flex; gap: 4px; }
.voice-controls button {
    width: 32px;
    height: 32px;
    background: var(--black-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.voice-controls button:hover { 
    color: var(--gold-primary); 
    background: var(--black-surface);
}

/* ========== Call View – Card flutuante (não cobre o chat) ========== */
.main-content { position: relative; }

.call-view {
    position: fixed;
    right: 8px;
    top: 8px;
    z-index: 20;
    animation: callSlideIn 0.25s ease;
}

.call-view.hidden { display: none; }

@keyframes callSlideIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.call-view-card {
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    background: rgba(14,14,16,0.96);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.15);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.call-view-drag {
    width: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 10px;
    cursor: grab;
    background: rgba(255,255,255,0.03);
    border-right: 1px solid rgba(255,255,255,0.05);
    user-select: none;
}

.call-view-drag:active { cursor: grabbing; }
.call-view-drag:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
}

.call-view-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 6px;
    position: relative;
}

.call-you-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.call-you-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 0, 0.35);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
    font-size: 14px;
    color: var(--black-rich);
}

.call-you-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-you-avatar .avatar-initials {
    font-size: 14px;
}

/* PIP vídeo/tela – cantinho do avatar */
.call-you-video-pip,
.call-you-screen-pip {
    display: none;
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 40px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    background: var(--black-rich);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.call-you-card.with-media .call-you-video-pip,
.call-you-card.with-screen .call-you-screen-pip {
    display: block;
}

.call-you-card.with-screen .call-you-video-pip {
    bottom: 26px;
}

.call-pip-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.call-pip-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1px 3px;
    font-size: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: rgba(255,255,255,0.9);
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
}

.call-view-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    justify-content: center;
}

.call-you-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-view-duration {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-primary);
}

.call-you-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.call-view-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.call-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.call-control-btn i {
    font-size: 14px;
}

.call-control-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.call-control-btn.muted {
    color: var(--error);
    background: rgba(255, 68, 68, 0.12);
}

.call-control-btn.muted:hover {
    background: rgba(255, 68, 68, 0.2);
    color: var(--error);
}

.call-control-end {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error);
}

.call-control-end:hover {
    background: rgba(255, 68, 68, 0.22);
    color: var(--error);
}

.friends-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--black-surface);
}

.friends-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
}

.friends-tabs {
    display: flex;
    gap: 16px;
}

.friends-tabs .tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.friends-tabs .tab:hover {
    color: var(--text-primary);
    background: var(--black-surface);
}

.friends-tabs .tab.active {
    color: var(--gold-primary);
    background: var(--gold-subtle);
}

.friends-search {
    padding: 16px 24px;
}

.friends-search input {
    width: 100%;
    padding: 12px 16px;
    background: var(--black-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--black-surface);
}

.empty-state p {
    margin-bottom: 20px;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--black-card);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    transition: all var(--transition-base);
}

.friend-item:hover {
    background: var(--black-surface);
    transform: translateX(4px);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: var(--black-rich);
    overflow: hidden;
}

.friend-avatar img { width: 100%; height: 100%; object-fit: cover; }

.friend-info { flex: 1; }
.friend-name { font-weight: 600; display: block; }
.friend-status { font-size: 12px; color: var(--text-tertiary); }

.friend-actions { display: flex; gap: 8px; }
.friend-actions button {
    width: 36px;
    height: 36px;
    background: var(--black-surface);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.friend-actions button:hover {
    background: var(--gold-primary);
    color: var(--black-rich);
}

.friend-actions .btn-accept-friend {
    padding: 6px 12px;
    width: auto;
    height: auto;
    font-size: 13px;
    border-radius: var(--radius-md);
    background: var(--gold-primary);
    color: var(--black-rich);
}

.friends-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* Messages */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#chat-messages.hidden {
    display: none;
}

.welcome {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.5s ease;
}

.welcome-icon {
    width: 72px;
    height: 72px;
    background: var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--black-rich);
    animation: pulse 3s ease-in-out infinite, glow 3s ease-in-out infinite;
}

.welcome h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 8px;
}

.welcome p { color: var(--text-secondary); font-size: 16px; }

/* Ranking View */
.ranking-view {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}

.ranking-header {
    text-align: center;
    margin-bottom: 32px;
}

.ranking-icon {
    font-size: 48px;
    color: var(--gold-primary);
    margin-bottom: 12px;
    display: block;
    animation: pulse 3s ease-in-out infinite;
}

.ranking-header h2 {
    font-size: 28px;
    color: var(--gold-primary);
    margin-bottom: 4px;
}

.ranking-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.ranking-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .ranking-tables { grid-template-columns: 1fr; }
}

.ranking-table {
    background: var(--black-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--black-surface);
    padding: 20px;
}

.ranking-table h3 {
    font-size: 16px;
    color: var(--gold-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--black-rich);
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
}

.ranking-item:hover {
    background: var(--black-surface);
}

.ranking-item.current {
    border: 1px solid var(--gold-subtle);
    background: var(--gold-subtle);
}

.ranking-item .rank {
    font-weight: 700;
    color: var(--gold-primary);
    min-width: 32px;
    font-size: 13px;
}

.rank-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

.rank-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rank-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.rank-stat {
    font-size: 11px;
    color: var(--text-tertiary);
}

.ranking-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.ranking-footer {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.message {
    display: flex;
    padding: 8px 0;
    margin-bottom: 8px;
    animation: slideUp 0.3s ease;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    color: var(--black-rich);
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
}

.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-avatar:hover { transform: scale(1.1); box-shadow: 0 0 15px var(--gold-glow); }

.message-body { flex: 1; min-width: 0; }
.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.message-author { font-weight: 600; color: var(--gold-primary); }
.message-time { font-size: 11px; color: var(--text-tertiary); }
.message-text { color: var(--text-primary); line-height: 1.5; word-wrap: break-word; }

.message-translation {
    display: none;
    margin-bottom: 6px;
    padding: 8px 10px;
    background: var(--gold-subtle);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--gold-primary);
}
.message-translation.visible {
    display: block;
}
.translation-label {
    font-size: 10px;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 4px;
}
.translation-label i {
    margin-right: 4px;
}
.translation-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.message-text .message-link {
    color: var(--gold-primary);
    text-decoration: none;
}
.message-text .message-link:hover {
    text-decoration: underline;
}

.message-embed {
    margin-top: 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 100%;
}
.message-embed-youtube {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    background: var(--black-rich);
}
.message-embed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.message-embed-invite {
    max-width: 420px;
    background: var(--black-card);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 16px;
}
.invite-embed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.invite-embed-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--black-rich);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.invite-embed-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.invite-embed-icon-letter {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.invite-embed-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}
.invite-embed-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
}
.invite-embed-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}
.invite-stat-online {
    color: var(--green, #43b581);
    font-size: 6px;
}
.invite-stat-member {
    color: var(--text-tertiary);
    font-size: 6px;
}
.invite-embed-created {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}
.invite-embed-join,
.btn-invite-join {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--green, #43b581);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter var(--transition-base), background var(--transition-base);
}
.invite-embed-join:hover,
.btn-invite-join:hover {
    filter: brightness(1.1);
}

.invite-link-anchor {
    display: inline-block;
    color: var(--discord-link, #00a8fc);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
}
.invite-link-anchor:hover {
    text-decoration: underline;
}
.invite-preview-wrap .invite-link-anchor { margin-bottom: 4px; }
.invite-modal-preview,
.invite-settings-preview {
    margin-top: 12px;
}
.invite-modal-preview .message-embed-invite,
.invite-settings-preview .message-embed-invite {
    max-width: 100%;
}

.invite-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 24px;
    background: var(--bg);
}
.invite-landing-inner {
    width: 100%;
    max-width: 420px;
}
.invite-landing-link {
    display: block;
    color: var(--discord-link, #00a8fc);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 12px;
}
.invite-landing-link:hover {
    text-decoration: underline;
}
.invite-landing-card {
    margin-bottom: 16px;
}
.invite-landing-card .message-embed-invite {
    max-width: 100%;
}
.invite-landing-error,
.invite-landing-login-hint {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 12px 0;
}
.invite-landing-btn {
    width: 100%;
    max-width: 420px;
}
.invite-landing.hidden {
    display: none !important;
}
.invite-landing:not(.hidden) ~ .server-bar,
.invite-landing:not(.hidden) ~ .channel-bar,
.invite-landing:not(.hidden) ~ .main-content {
    display: none !important;
}

.invite-permanent-box {
    margin-bottom: 16px;
}
.invite-label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}
.invite-link-box {
    display: flex;
    gap: 8px;
    align-items: center;
}
.invite-link-box input {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--black-surface);
    background: var(--black-rich);
    color: var(--text-primary);
    font-size: 13px;
}

/* Encryption Bar */
.encryption-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: var(--gold-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}

.encryption-bar i { 
    color: var(--gold-primary); 
    font-size: 12px;
    animation: pulse 2s ease-in-out infinite;
}

.encryption-bar-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Message Input */
.message-input-wrapper {
    padding: 0 16px 16px;
    display: block !important;
}

.message-input-wrapper.visible {
    display: block;
}

.message-char-indicator {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    padding: 4px 4px 2px 0;
    font-size: 11px;
    color: var(--text-tertiary);
    transition: color var(--transition-base);
}

.message-char-indicator.near-limit {
    color: var(--gold-dark);
}

.message-char-indicator.at-limit {
    color: var(--error);
}

.message-attachments-preview {
    display: none;
    padding: 8px 0;
    border-bottom: 1px solid var(--black-surface);
    margin-bottom: 8px;
}

.message-attachments-preview.visible {
    display: block;
}

.attachments-header {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.attachments-header i {
    margin-right: 4px;
}

.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-preview {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--black-surface);
    border-radius: var(--radius-md);
    font-size: 12px;
    max-width: 180px;
}

.attachment-preview img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.attachment-preview i.fa-file {
    color: var(--text-secondary);
}

.attachment-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--error);
    color: white;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity var(--transition-base);
}

.attachment-remove:hover {
    opacity: 1;
}

.subscription-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--black-surface) 0%, var(--black-surface) 100%);
    border: 1px solid var(--gold-subtle);
    border-radius: var(--radius-lg);
}

.subscription-select {
    padding: 10px 14px;
    background: var(--black-rich);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 220px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-base);
}

.subscription-select:hover,
.subscription-select:focus {
    border-color: var(--gold-primary);
}

.subscription-icon {
    color: var(--gold-primary);
    font-size: 24px;
    margin-right: 12px;
}

.subscription-info {
    display: flex;
    align-items: flex-start;
}

.subscription-info strong {
    display: block;
    color: var(--gold-primary);
    margin-bottom: 4px;
}

.subscription-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.msg-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--black-surface);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-base);
}

.msg-attachment:hover {
    background: var(--black-surface);
}

.msg-attachment-image {
    padding: 0;
    overflow: hidden;
}

.msg-attachment-image img {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-md);
    display: block;
}

.msg-attachment-file i {
    color: var(--gold-primary);
}

.message-input {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 8px;
}

.message-input-wrapper.disabled {
    opacity: 0.85;
    pointer-events: none;
}

.message-input-wrapper.disabled textarea,
.message-input-wrapper.disabled button {
    cursor: not-allowed;
}

.message-input textarea {
    flex: 1;
    padding: 14px 16px;
    background: var(--black-card);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-base);
}

.message-input textarea:focus {
    box-shadow: 0 0 0 2px var(--gold-primary);
}

.message-input button {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.message-input button:hover { 
    color: var(--gold-primary); 
    background: var(--gold-subtle);
}

.message-input .send-btn {
    background: var(--gold-primary);
    color: var(--black-rich);
    border-radius: 50%;
}

.message-input .send-btn:hover { 
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--gold-glow);
}

/* Member Bar */
.member-bar {
    width: 240px;
    background: var(--black-card);
    border-left: 1px solid var(--black-surface);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
}

.member-bar.hidden { width: 0; overflow: hidden; }

.member-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--black-surface);
}

.member-group { padding: 8px; }
.group-title {
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.member-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.member-item .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
}

.member-item .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-item.online .avatar { background: var(--gold-primary); color: var(--black-rich); }
.member-item span { font-size: 13px; color: var(--text-secondary); }
.member-item.online span { color: var(--text-primary); }

.member-owner-badge {
    font-size: 11px;
    color: var(--gold-primary);
    margin-left: 4px;
    opacity: 0.95;
}
.member-owner-badge i { vertical-align: middle; }

.member-role-badge {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-left: 4px;
    font-weight: normal;
}

/* MODALS */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal.active { display: flex; }

#modal-verify.active { z-index: 150; }

.modal-content {
    background: var(--black-card);
    padding: 24px;
    border-radius: var(--radius-xl);
    width: 400px;
    border: 1px solid var(--black-surface);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.modal-content input, .modal-content select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--black-rich);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-base);
}

.modal-content input:focus, .modal-content select:focus { 
    border-color: var(--gold-primary); 
}

.server-icon-upload {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--black-rich);
    border: 2px dashed var(--gold-primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gold-primary);
    transition: all var(--transition-base);
    overflow: hidden;
}

.server-icon-upload:hover {
    background: var(--gold-subtle);
}

.server-icon-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-icon-upload i { font-size: 24px; }
.server-icon-upload span { font-size: 12px; margin-top: 4px; }

.channel-types {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.channel-type {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--black-rich);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.channel-type.active { border-color: var(--gold-primary); }
.channel-type input { display: none; }
.channel-type i { color: var(--text-secondary); transition: color var(--transition-base); }
.channel-type.active i { color: var(--gold-primary); }
.channel-type span { font-size: 13px; color: var(--text-secondary); }
.channel-type.active span { color: var(--text-primary); }

/* Modal Criar Canal / Categoria - design melhorado */
.modal-channel-content,
.modal-category-content,
.modal-channel-edit-content {
    width: 100%;
    max-width: 440px;
    padding: 28px 28px 24px;
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    border-radius: 16px;
}
.modal-channel-header {
    text-align: center;
    margin-bottom: 24px;
}
.modal-channel-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #0a0a0a;
}
.modal-category-icon { font-size: 22px; }
.modal-channel-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.modal-channel-header .modal-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 0;
}
.add-channel-category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.add-channel-category-tabs .add-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #141414;
    border: 2px solid #1f1f1f;
    border-radius: 12px;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.add-channel-category-tabs .add-tab:hover {
    border-color: #FFD700;
    color: #fff;
}
.add-channel-category-tabs .add-tab.active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
}
.add-tab-panel {
    display: none;
}
.add-tab-panel.active {
    display: block;
}
.channel-form .form-group {
    margin-bottom: 18px;
}
.channel-form .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.channel-form input,
.channel-form select {
    width: 100%;
    padding: 12px 16px;
    background: #141414;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}
.channel-form input:focus,
.channel-form select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}
.channel-name-hint {
    font-size: 12px;
    color: #888;
    margin: 6px 0 0;
}
.channel-name-hint strong {
    color: #FFD700;
    font-weight: 600;
}
.channel-types-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}
.channel-types-card .channel-type {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
    gap: 8px;
    background: #141414;
    border: 2px solid #1f1f1f;
    border-radius: 12px;
}
.channel-types-card .channel-type:hover {
    border-color: #FFD700;
}
.channel-types-card .channel-type.active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}
.channel-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #888;
    transition: all 0.2s ease;
}
.channel-type.active .channel-type-icon {
    background: #FFD700;
    color: #0a0a0a;
}
.channel-type-label {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    display: block;
}
.channel-type.active .channel-type-label { color: #fff; }
.channel-type-desc {
    font-size: 11px;
    color: #666;
    display: block;
}
.modal-channel-actions {
    margin-top: 24px;
    margin-bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-channel-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #FFD700;
    border: none;
    border-radius: 12px;
    color: #0a0a0a;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal-channel-actions .btn-primary:hover {
    background: #FFA500;
    transform: translateY(-2px);
}
.modal-channel-actions .btn-ghost {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    color: #888;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal-channel-actions .btn-ghost:hover {
    border-color: #FFD700;
    color: #FFD700;
}
.field-hint {
    font-size: 12px;
    color: #888;
    margin: -4px 0 10px;
}

/* Drag and Drop para canais e categorias */
.channel-item.draggable {
    cursor: grab;
}
.channel-item.draggable:active {
    cursor: grabbing;
}
.channel-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}
.channel-item.drag-over {
    border-top: 2px solid #FFD700;
    background: rgba(255, 215, 0, 0.05);
}
.category-header.draggable {
    cursor: grab;
}
.category-header.draggable:active {
    cursor: grabbing;
}
.category-header.dragging {
    opacity: 0.5;
}
.category-header.drag-over {
    background: rgba(255, 215, 0, 0.1);
}
.channel-perms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.channel-perms-list label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    padding: 8px 12px;
    background: var(--black-rich);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    margin: 0;
}
.channel-perms-list label:hover { border-color: var(--text-tertiary); }
.channel-perms-list input[type="checkbox"] { margin: 0; }
.assign-role-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    max-height: 240px;
    overflow-y: auto;
}
.assign-role-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--black-card);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}
.assign-role-option:hover { border-color: var(--text-tertiary); }
.assign-role-option.selected { border-color: var(--gold-primary); background: var(--gold-subtle); }
.assign-role-option .role-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.assign-role-option span { font-size: 14px; color: var(--text-primary); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* Verification Modal */
.verify-modal { max-width: 420px; }
.verify-header {
    text-align: center;
    margin-bottom: 20px;
}
.verify-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: var(--gold-subtle);
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary);
    font-size: 24px;
}
.verify-header h2 { margin-bottom: 4px; }
.verify-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}
.verify-status, .verify-error {
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}
.verify-status.visible {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gold-subtle);
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
}
.verify-status.visible.success {
    background: rgba(0, 255, 100, 0.1);
    border-color: #00ff64;
    color: #00ff64;
}
.verify-error.visible {
    display: block;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: #ff8888;
}
.verify-panels { min-height: 120px; }
.verify-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
}
.verify-panel.active { display: flex; }
.verify-instruction {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 4px;
}
.verify-panel input {
    width: 100%;
    padding: 12px 14px;
    background: var(--black-rich);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
.verify-panel input:focus { border-color: var(--gold-primary); }
.verify-panel input[readonly] {
    background: var(--black-surface);
    color: var(--text-secondary);
}
.verify-btn {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
}
.verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.verify-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--black-surface); }
.verify-phone-options { display: flex; gap: 10px; flex-wrap: wrap; }
.verify-option-btn { flex: 1; min-width: 140px; }
.verify-resend { margin-top: 8px; font-size: 13px; }

.btn-cancel {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-cancel:hover { 
    color: var(--text-primary); 
    background: var(--black-surface);
}

.modal-content button[type="submit"] {
    padding: 10px 24px;
    background: var(--gold-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--black-rich);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-content button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--gold-glow);
}

/* Invite Modal */
.invite-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.invite-link-box input {
    flex: 1;
    margin-bottom: 0;
    font-family: monospace;
}

.invite-link-box button {
    padding: 12px 16px;
    background: var(--gold-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--black-rich);
    cursor: pointer;
    transition: all var(--transition-base);
}

.invite-link-box button:hover {
    transform: scale(1.05);
}

.invite-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.invite-options select {
    flex: 1;
    margin-bottom: 0;
}

/* Settings Modal */
.modal-full { align-items: stretch; }

/* Modal perfil de outro usuário */
.modal-user-profile-content {
    padding: 0;
    overflow: visible;
    max-width: 420px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 32px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08), 0 0 80px rgba(255,255,0,0.06);
    animation: profileModalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: transparent;
}
@keyframes profileModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.user-profile-card {
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(180deg, var(--black-card) 0%, var(--black-elevated) 100%);
    border: 1px solid rgba(255,255,255,0.06);
}

.user-profile-banner {
    height: 140px;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 40%, #0f0f1a 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
.user-profile-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,255,0,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.user-profile-banner .user-profile-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 45%, transparent 100%);
    pointer-events: none;
}
.user-profile-banner .user-profile-banner-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--black-surface) 0%, transparent 50%), linear-gradient(225deg, var(--black-surface) 0%, transparent 50%);
    pointer-events: none;
}
.user-profile-banner .user-profile-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.user-profile-banner .user-profile-banner-img[src] { display: block; }
.user-profile-banner.no-banner { background-image: none; }

.user-profile-body {
    padding: 0 28px 28px;
    position: relative;
    text-align: center;
}

.user-profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-top: -52px;
    margin-bottom: 18px;
}
.user-profile-avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--black-surface);
    z-index: 0;
    box-shadow: none;
}
.user-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--black-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    border: 4px solid var(--black-card);
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 3px rgba(255,255,255,0.06);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}
.user-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-profile-status {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid var(--black-card);
    background: var(--text-tertiary);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.user-profile-status.status-online {
    background: var(--status-online);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.user-profile-status.status-idle {
    background: var(--status-idle);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.user-profile-status.status-dnd {
    background: var(--status-dnd);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.user-profile-status.status-offline {
    background: var(--text-tertiary);
}

.user-profile-name {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.03em;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.user-profile-tag {
    font-size: 15px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.user-profile-desc-wrap {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 20px;
    text-align: left;
}
.user-profile-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
    min-height: 1.65em;
}
.user-profile-desc:empty::before,
.user-profile-desc.empty::before { content: 'Sem descrição'; font-style: italic; color: var(--text-tertiary); }

.user-profile-actions {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.user-profile-actions .btn-profile-chat {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}
.user-profile-actions .btn-profile-chat:hover {
    color: var(--gold-primary);
    background: var(--gold-subtle);
    border-color: rgba(255,255,0,0.25);
    transform: scale(1.08);
}
.user-profile-actions .btn-profile-add-role {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}
.user-profile-actions .btn-profile-add-role:hover {
    color: var(--gold-primary);
    background: var(--gold-subtle);
    border-color: rgba(255,255,0,0.25);
    transform: scale(1.08);
}
.user-profile-actions {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.user-profile-roles-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    min-width: 200px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--black-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 10;
    padding: 8px 0;
}

.user-profile-roles-dropdown.hidden {
    display: none !important;
}
.user-profile-roles-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-profile-roles-dropdown .assign-role-option {
    margin: 0 8px;
    border-radius: var(--radius-md);
}
.user-profile-roles-dropdown-empty {
    margin: 12px 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}
.user-profile-roles-dropdown-empty.hidden {
    display: none !important;
}

.user-profile-roles-wrap {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.user-profile-roles-wrap.visible {
    display: flex;
}
.user-profile-roles-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-right: 0;
    width: auto;
}
.user-profile-roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.user-profile-role-pill {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid;
    font-weight: 500;
}
.user-profile-role-add {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: border-color .2s, color .2s, background .2s, transform .2s;
    flex-shrink: 0;
}
.user-profile-role-add:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: var(--gold-subtle);
    transform: scale(1.05);
}
.user-profile-role-add:active {
    transform: scale(0.98);
}

.modal-user-profile-actions {
    padding: 14px 28px 22px;
    border-top: none;
    justify-content: center;
}
.modal-user-profile-actions .btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: color .2s, background .2s;
}
.modal-user-profile-actions .btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.settings-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--black-rich);
}

.settings-nav {
    width: 220px;
    background: var(--black-card);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.settings-container.settings-scope-player .settings-nav [data-scope="server"] { display: none; }
.settings-container.settings-scope-server .settings-nav [data-scope="player"] { display: none; }

.settings-section {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.settings-item i { width: 16px; text-align: center; }

.settings-item:hover { color: var(--text-primary); }
.settings-item.active {
    color: var(--gold-primary);
    background: var(--gold-subtle);
}

.settings-logout {
    margin-top: auto;
    padding: 16px 20px;
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-base);
}

.settings-logout:hover { background: rgba(255, 68, 68, 0.1); }

.settings-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
}

.settings-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    transition: all var(--transition-base);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.settings-close:hover { 
    color: var(--gold-primary); 
    background: var(--gold-subtle);
}

.settings-panel { display: none; }
.settings-panel.active { display: block; animation: fadeIn 0.3s ease; }

.settings-panel h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 24px;
}

.settings-panel h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.settings-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }

/* Auth methods list */
.auth-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-method-item {
    background: var(--black-card);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: all var(--transition-base);
}
.auth-method-item:hover { border-color: var(--black-surface); }
.auth-method-item .auth-method-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.auth-priority {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 22px;
    height: 22px;
    background: var(--gold-primary);
    color: var(--black-rich);
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-method-item { position: relative; padding-left: 44px; }
.auth-method-item .auth-method-info i {
    font-size: 22px;
    color: var(--gold-primary);
    width: 32px;
    text-align: center;
}
.auth-method-item .auth-method-info strong { display: block; margin-bottom: 2px; }
.auth-method-desc {
    font-size: 12px;
    color: var(--text-secondary);
}
.auth-method-item > .toggle {
    float: right;
    margin-top: -36px;
}
.auth-method-config {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--black-surface);
    display: none;
    flex-direction: column;
    gap: 8px;
}
.auth-method-config.visible { display: flex; }
.auth-method-config input { max-width: 280px; }

.settings-group { margin-bottom: 20px; }
.settings-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.settings-group input, .settings-group textarea, .settings-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--black-card);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-base);
}

.settings-group input:focus, .settings-group textarea:focus, .settings-group select:focus { 
    border-color: var(--gold-primary); 
}

.settings-group textarea { resize: none; height: 80px; }
.settings-group-danger {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.delete-account-verify {
    margin: 16px 0;
}
.delete-account-verify input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    background: var(--black-card);
    color: var(--text-primary);
    font-size: 14px;
}
.delete-account-verify input:focus {
    outline: none;
    border-color: var(--gold-primary);
}
.delete-account-error {
    margin-top: 8px;
    font-size: 13px;
    color: var(--error);
}
.settings-group input[type="range"] {
    padding: 0;
    height: 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-row input { flex: 1; }

.btn-small {
    padding: 12px 20px;
    background: var(--gold-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--black-rich);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--gold-glow);
}

/* Account Card */
.account-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
}

.account-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--black-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 28px;
    color: var(--gold-primary);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 4px solid rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
}

.account-avatar img { width: 100%; height: 100%; object-fit: cover; }

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

.avatar-upload {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
    color: var(--gold-primary);
    font-size: 24px;
}

.account-avatar:hover .avatar-upload { opacity: 1; }

.account-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.btn-avatar-change {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--black-rich);
    background: rgba(0,0,0,0.2);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    align-self: flex-start;
}

.btn-avatar-change:hover {
    background: rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* Avatar Modal */
.avatar-modal-preview {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-modal-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-modal-preview i {
    font-size: 48px;
    color: var(--text-tertiary);
}
.avatar-apply-options {
    margin-bottom: 20px;
}
.avatar-apply-options .toggle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
}
.avatar-apply-options .toggle-item span:last-child {
    font-size: 14px;
    color: var(--text-primary);
}
.avatar-server-select {
    margin-top: 12px;
}
.avatar-server-select.hidden {
    display: none;
}
.avatar-server-select > label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.avatar-server-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.avatar-server-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--black-rich);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-base);
}
.avatar-server-item:hover {
    background: var(--black-surface);
}
.avatar-server-item input {
    margin: 0;
}
.avatar-server-item .server-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--black-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.avatar-server-item .server-icon-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-name { font-size: 20px; font-weight: 700; color: var(--black-rich); }
.account-name span:last-child { opacity: 0.6; font-size: 14px; margin-left: 8px; }

/* Profile Preview */
.profile-preview {
    margin-bottom: 24px;
    position: relative;
}

.profile-banner {
    height: 80px;
    background: var(--black-surface);
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 0;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-base);
}

.profile-banner .profile-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.profile-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-banner:hover {
    opacity: 0.8;
}

.banner-upload {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-base);
    color: var(--gold-primary);
    font-size: 24px;
}
.banner-upload span { font-size: 12px; opacity: 0.9; }

.profile-banner:hover .banner-upload { opacity: 1; }

.profile-avatar-small {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gold-primary);
    border: 4px solid var(--black-rich);
    margin-top: -30px;
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--black-rich);
    overflow: hidden;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: opacity var(--transition-base);
}

.profile-avatar-small:hover { opacity: 0.95; }

.profile-avatar-small .avatar-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--gold-primary);
    font-size: 14px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.profile-avatar-small:hover .avatar-upload-overlay { opacity: 1; }

.profile-avatar-small .avatar-upload-overlay span { font-size: 10px; }

.profile-avatar-small img { width: 100%; height: 100%; object-fit: cover; }

/* Toggle */
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--black-surface);
}

.toggle-info strong { display: block; margin-bottom: 2px; }
.toggle-info small { color: var(--text-tertiary); font-size: 12px; }

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input { display: none; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--text-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform var(--transition-base);
}

.toggle input:checked + .toggle-slider {
    background: var(--gold-primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    background: var(--gold-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--black-rich);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--gold-glow);
}

.btn-outline {
    padding: 12px 24px;
    background: none;
    border: 2px solid var(--gold-primary);
    border-radius: var(--radius-md);
    color: var(--gold-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-outline:hover {
    background: var(--gold-subtle);
}

.btn-danger {
    padding: 12px 24px;
    background: none;
    border: 2px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

/* Fundo do chat (Aparência) */
.appearance-bg-box {
    padding: 14px;
    background: var(--black-card);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}
.appearance-bg-box label { display: block; margin-bottom: 12px; }
.appearance-bg-preview-wrap { display: flex; flex-direction: column; gap: 12px; }
.appearance-bg-preview {
    width: 100%;
    min-height: 120px;
    border-radius: var(--radius-md);
    background: var(--black-rich);
    border: 2px dashed var(--black-surface);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.appearance-bg-preview.has-image { border-style: solid; border-color: var(--black-surface); }
.appearance-bg-preview.has-gradient { border-style: solid; border-color: var(--black-surface); }
.appearance-bg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.appearance-bg-actions .btn-outline,
.appearance-bg-actions .btn-ghost { flex-shrink: 0; }
.appearance-bg-gradient-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--black-surface); }
.appearance-bg-gradient-box label { margin-bottom: 8px; font-size: 12px; color: var(--text-secondary); }
.appearance-gradient .gradient-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.appearance-gradient .gradient-row input[type="color"] { width: 48px; height: 36px; border: none; border-radius: var(--radius-md); cursor: pointer; background: var(--black-surface); }
.appearance-gradient .gradient-row select { padding: 6px 10px; border-radius: var(--radius-md); border: 1px solid var(--black-surface); background: var(--black-card); color: var(--text-primary); }
.appearance-gradient #appearance-bg-gradient-apply { margin-top: 4px; }

/* Theme Options */
.theme-options { display: flex; gap: 12px; }
.theme-opt {
    cursor: pointer;
    text-align: center;
}

.theme-opt input { display: none; }

.theme-preview {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-md);
    border: 2px solid var(--black-surface);
    margin-bottom: 8px;
    transition: all var(--transition-base);
}

.theme-opt.active .theme-preview { border-color: var(--gold-primary); }
.theme-preview.dark, .theme-preview.amoled { background: var(--black-rich); }
.theme-preview.light { background: #fff; }

.theme-opt span { font-size: 12px; color: var(--text-secondary); }

/* Color Options */
.color-options { display: flex; gap: 8px; flex-wrap: wrap; }
.color-opt {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
}

.color-opt:hover { transform: scale(1.15); }
.color-opt.active { border-color: var(--text-primary); box-shadow: 0 0 15px var(--gold-glow); }

/* Profile color: solid vs gradient */
.profile-color-mode { display: flex; gap: 8px; margin-bottom: 12px; }
.profile-color-mode-btn {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--black-surface);
    background: var(--black-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-base);
}
.profile-color-mode-btn:hover { background: var(--black-surface); color: var(--text-primary); }
.profile-color-mode-btn.active { border-color: var(--gold-primary); color: var(--gold-primary); background: rgba(255, 255, 0, 0.08); }
.profile-color-solid.hidden { display: none !important; }
.profile-color-gradient { margin-top: 12px; }
.profile-color-gradient.hidden { display: none !important; }
.profile-color-gradient .gradient-inputs { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.profile-color-gradient .gradient-color-wrap { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.profile-color-gradient .gradient-color-wrap input[type="color"] { width: 48px; height: 36px; border: none; border-radius: var(--radius-md); cursor: pointer; background: var(--black-card); }
.profile-color-gradient .gradient-angle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--text-secondary); }
.profile-color-gradient .gradient-angle-wrap input[type="range"] { flex: 1; max-width: 180px; }
.profile-color-gradient .gradient-angle-value { min-width: 36px; }
.profile-color-preview { height: 48px; border-radius: var(--radius-lg); margin-top: 8px; border: 2px solid var(--black-surface); }

.color-opt-custom { position: relative; padding: 0; display: flex; align-items: center; justify-content: center; }
.color-input-hidden { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.color-opt-custom-preview { width: 28px; height: 28px; border-radius: 50%; pointer-events: none; }
.settings-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; margin-bottom: 8px; }
.gradient-controls { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-top: 8px; }
.gradient-controls label { font-size: 12px; color: var(--text-secondary); }
.gradient-controls input[type="color"] { width: 48px; height: 32px; border: none; border-radius: var(--radius-md); cursor: pointer; background: var(--black-card); }
.gradient-controls input[type="number"], .gradient-controls select { padding: 6px 10px; border-radius: var(--radius-md); border: 1px solid var(--black-surface); background: var(--black-card); color: var(--text-primary); }
.app-bg-row { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.app-bg-row.hidden { display: none !important; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--black-surface); color: var(--text-primary); }

/* Roles */
.roles-editor {
    display: flex;
    gap: 24px;
}

.roles-list-panel {
    width: 200px;
    background: var(--black-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.roles-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.role-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.role-item:hover { background: var(--black-surface); }
.role-item.active { background: var(--gold-subtle); }

.role-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.add-role-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--gold-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-base);
}

.add-role-btn:hover { background: var(--gold-subtle); }

.channels-settings-list {
    margin-bottom: 16px;
}
.channels-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.channels-settings-actions .btn-outline {
    flex: 1;
    min-width: 140px;
}
.channel-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--black-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
.channel-settings-item i { color: var(--text-tertiary); margin-right: 8px; }
.channel-settings-item .channel-settings-name { flex: 1; }
.channel-settings-item .btn-small { margin-left: 8px; }

.role-settings { flex: 1; }

.permissions h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 20px 0 12px;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-base);
}

.perm-item:hover { color: var(--text-primary); }
.perm-item input { accent-color: var(--gold-primary); width: 16px; height: 16px; }

.role-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

/* Emojis */
.emoji-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed var(--gold-primary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 20px;
    transition: all var(--transition-base);
}

.emoji-upload-area:hover {
    background: var(--gold-subtle);
}

.emoji-upload-area i { font-size: 32px; color: var(--gold-primary); margin-bottom: 8px; }

.emoji-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-list .settings-desc {
    grid-column: 1 / -1;
    color: var(--text-tertiary);
    font-size: 13px;
    margin: 0;
}

.server-emoji-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--black-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    grid-column: 1 / -1;
}

.server-emoji-preview {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.server-emoji-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.server-emoji-item .btn-delete-emoji {
    margin-left: auto;
}

.emoji-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.emoji-item:hover { 
    background: var(--black-surface); 
    transform: scale(1.2);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    right: 10px;
    width: 350px;
    max-height: 400px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker.active {
    display: flex;
}

.emoji-picker #emoji-search {
    width: 100%;
    padding: 12px 16px;
    background: #0a0a0a;
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.emoji-picker #emoji-search::placeholder {
    color: #666;
}

.emoji-tabs {
    display: flex;
    background: #0a0a0a;
    border-bottom: 1px solid #333;
    overflow-x: auto;
}

.emoji-tab {
    flex: 1;
    min-width: 50px;
    padding: 10px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.emoji-tab:hover {
    color: #fff;
    background: #1a1a1a;
}

.emoji-tab.active {
    color: #FFD700;
    background: #1a1a1a;
    border-bottom: 2px solid #FFD700;
}

.emoji-grid {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 300px;
}

.emoji-grid .emoji-item {
    width: 36px;
    height: 36px;
    font-size: 24px;
    border-radius: 6px;
}

.emoji-grid .emoji-item:hover {
    background: #333;
    transform: scale(1.1);
}

.emoji-category-title {
    grid-column: 1 / -1;
    color: #FFD700;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 0;
    text-transform: uppercase;
}

/* Security Alert Modal */
.security-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.security-alert-modal.hidden {
    display: none;
}

.security-alert-content {
    background: #1a1a1a;
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.security-alert-icon {
    width: 80px;
    height: 80px;
    background: #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #000;
    font-size: 36px;
}

.security-alert-title {
    color: #FFD700;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px;
}

.security-alert-text {
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 32px;
}

.security-alert-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.security-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.security-feature i {
    color: #FFD700;
    font-size: 18px;
    width: 24px;
}

.security-alert-btn {
    background: #FFD700;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 12px;
    transition: background 0.2s;
}

.security-alert-btn:hover {
    background: #E5C100;
}

.security-alert-skip {
    background: transparent;
    color: #888;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.security-alert-skip:hover {
    color: #FFD700;
}

/* Custom Background */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Suporte específico para GIFs animados */
.app-background.is-gif {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#app {
    position: relative;
}

/* Security Dropdown */
.security-dropdown-container {
    position: relative;
}

.security-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.security-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.security-dropdown-btn.active .security-dropdown-arrow {
    transform: rotate(180deg);
}

.security-dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    overflow: hidden;
}

.security-dropdown-menu.hidden {
    display: none;
}

.security-dropdown-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 13px;
}

.security-dropdown-menu button:hover {
    background: var(--gold-subtle);
    color: var(--gold-primary);
}

.security-dropdown-menu button i {
    width: 16px;
    text-align: center;
}

/* Invite List */
.invite-create {
    margin-bottom: 20px;
}

.invite-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--black-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.invite-item .invite-code {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.invite-item small { color: var(--text-tertiary); flex: 1; }

.invite-item .btn-copy-invite {
    margin-left: auto;
    padding: 6px 10px;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    right: 16px;
    width: 320px;
    background: var(--black-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--black-surface);
    animation: slideUp 0.2s ease;
    z-index: 50;
}

.emoji-picker input {
    width: 100%;
    padding: 12px;
    background: var(--black-rich);
    border: none;
    border-bottom: 1px solid var(--black-surface);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.emoji-tabs {
    display: flex;
    border-bottom: 1px solid var(--black-surface);
}

.emoji-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.emoji-tab.active, .emoji-tab:hover { color: var(--gold-primary); }

.emoji-picker .emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-picker .emoji {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.emoji-picker .emoji:hover { 
    background: var(--black-surface); 
    transform: scale(1.2);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--black-card);
    border-radius: var(--radius-md);
    padding: 4px;
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--black-surface);
    z-index: 200;
    display: none;
    animation: fadeIn 0.15s ease;
}

.context-menu.active { display: block; }

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.ctx-item:hover { background: var(--black-surface); color: var(--text-primary); }
.ctx-item.danger { color: var(--error); }
.ctx-item.danger:hover { background: rgba(255, 68, 68, 0.1); }

.ctx-divider {
    height: 1px;
    background: var(--black-surface);
    margin: 4px 0;
}

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

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--black-card);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--gold-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast.error { border-left-color: var(--error); }
.toast i { color: var(--gold-primary); font-size: 16px; }
.toast.error i { color: var(--error); }
.toast span { font-size: 13px; color: var(--text-primary); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .channel-bar { width: 200px; }
    .member-bar { width: 200px; }
}

@media (max-width: 1200px) {
    .channel-bar { width: 180px; }
    .member-bar { width: 180px; }
    .login-box { width: 340px; padding: 40px 32px; }
}

@media (max-width: 1000px) {
    .member-bar { display: none; }
    .channel-bar { width: 220px; }
    .friends-header { flex-direction: column; gap: 16px; align-items: flex-start; }
    .friends-tabs { flex-wrap: wrap; }
}

@media (max-width: 768px) {
    .app { flex-wrap: wrap; flex-direction: column; }
    .server-bar { 
        width: 100%; 
        flex-direction: row; 
        justify-content: center; 
        padding: 8px;
        order: 0;
        border-left: none;
        border-bottom: 1px solid var(--black-border);
    }
    .server-bar .server-divider { width: 2px; height: 32px; margin: 0 8px; }
    .server-icon::before { display: none; }
    .channel-bar { width: 100%; max-height: 50vh; order: 1; }
    .main-content { min-height: 50vh; order: 2; }
    .login-box { width: 90%; max-width: 360px; padding: 32px 24px; }
    .login-box h1 { font-size: 24px; }
    .header-actions { gap: 2px; }
    .header-actions button { width: 28px; height: 28px; }
    .message-input-wrapper { padding: 0 12px 12px; }
    .message-input textarea { font-size: 14px; }
    .message-input button { width: 36px; height: 36px; }
    .modal-content { width: 90%; max-width: 400px; padding: 24px; }
    .settings-container { flex-direction: column; }
    .settings-main { padding: 60px 20px 20px; }
}

@media (max-width: 700px) {
    .channel-bar { display: none; order: 1; }
    .channel-bar.mobile-open { display: flex; position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; width: 280px; max-height: none; box-shadow: 4px 0 20px rgba(0,0,0,0.5); }
    .settings-nav { display: none; }
    .settings-nav.mobile-open { display: flex; }
    .server-bar { width: 100%; order: 0; border-left: none; border-bottom: 1px solid var(--black-border); }
    .main-content { width: 100%; order: 2; }
    .welcome h2 { font-size: 24px; }
    .welcome-icon { width: 56px; height: 56px; font-size: 24px; }
}

@media (max-width: 500px) {
    .login-box { width: 95%; padding: 24px 20px; }
    .auth-form input { padding: 12px 14px; }
    .server-icon { width: 40px; height: 40px; font-size: 16px; margin-bottom: 4px; }
    .message { padding: 6px 0; width: 100%; }
    .message-avatar { width: 36px; height: 36px; margin-right: 10px; }
    .message-body { width: calc(100% - 46px); }
    .message-text { word-break: break-word; overflow-wrap: anywhere; }
    .message-content { max-width: 90%; }
    .friend-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .friend-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 400px) {
    .login-box h1 { font-size: 20px; }
    .channel-info span { font-size: 14px; }
    .header-actions button { width: 24px; height: 24px; font-size: 12px; }
}

/* Responsive modal */
@media (max-width: 600px) {
    .modal.modal-full .settings-container { flex-direction: column; }
    .modal.modal-full .settings-nav { width: 100%; }
    .modal.modal-full .settings-main { padding: 50px 16px 16px; }
}

/* Touch-friendly */
@media (hover: none) {
    .server-icon:hover, .dm-item:hover, .channel-item:hover { transform: none; }
    .header-actions button, .user-controls button { min-width: 44px; min-height: 44px; }
}

/* Admin Page */
.admin-page {
    position: fixed;
    inset: 0;
    background: var(--black-rich);
    z-index: 50;
    overflow: auto;
    animation: fadeIn 0.3s ease;
}
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}
.admin-header {
    margin-bottom: 24px;
}
.admin-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-base);
}
.admin-back:hover { color: var(--gold-primary); }
.admin-header h1 {
    font-size: 28px;
    color: var(--gold-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.admin-search {
    flex: 1;
    max-width: 320px;
    padding: 12px 16px;
    background: var(--black-card);
    border: 2px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
.admin-search:focus { border-color: var(--gold-primary); }
.admin-count {
    color: var(--text-secondary);
    font-size: 13px;
}
.admin-table-wrap {
    overflow-x: auto;
    background: var(--black-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--black-surface);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--black-surface);
}
.admin-table th {
    background: var(--black-rich);
    color: var(--gold-primary);
    font-weight: 600;
    white-space: nowrap;
}
.admin-table td {
    color: var(--text-secondary);
}
.admin-table tr:hover td {
    background: var(--black-surface);
    color: var(--text-primary);
}
.admin-table .user-cell {
    font-weight: 600;
    color: var(--text-primary);
}
.admin-table .mono {
    font-family: monospace;
    font-size: 12px;
}
.admin-table .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}
.admin-table .badge.yes { background: rgba(0,255,100,0.2); color: #00ff64; }
.admin-table .badge.no { color: var(--text-tertiary); }

/* ===== SISTEMA DE DM - ESTILO DISCORD ===== */

/* Header do Chat de DM */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--black-surface);
    border-bottom: 1px solid var(--black-surface);
    min-height: 56px;
}

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

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: var(--black-rich);
}

.chat-info {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.chat-status {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: lowercase;
}

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

.chat-header-actions button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-actions button:hover {
    background: var(--black-surface);
    color: var(--text-primary);
}

/* Área de mensagens do DM */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--black-elevated);
}

/* Mensagens estilo Discord */
.message {
    display: flex;
    padding: 8px 0;
    animation: fadeIn 0.2s ease;
    position: relative;
}

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

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    position: relative;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Mensagem enviada (direita) */
.message-out {
    justify-content: flex-end;
}

.message-out .message-content {
    align-items: flex-end;
}

.message-out .message-bubble {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--black-rich);
    border-bottom-right-radius: 4px;
}

/* Mensagem recebida (esquerda) */
.message-in {
    justify-content: flex-start;
}

.message-in .message-content {
    align-items: flex-start;
}

.message-in .message-bubble {
    background: var(--black-surface);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Remover background do bubble quando contiver mídia (imagens, vídeos, arquivos) */
.message-bubble:has(img),
.message-bubble:has(video),
.message-bubble:has(audio),
.message-bubble:has(a[download]) {
    background: transparent !important;
}

/* Ações nas mensagens (editar/apagar) */
.message-actions {
    display: none;
    gap: 4px;
    position: absolute;
    top: -30px;
    right: 0;
    background: var(--black-surface);
    border-radius: 6px;
    padding: 4px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.1);
}

.message:hover .message-actions {
    display: flex;
}

.message-content {
    position: relative;
}

.message-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.message-actions button:hover {
    background: var(--black-surface);
    color: var(--gold-primary);
    transform: scale(1.1);
}

.message-actions button:active {
    transform: scale(0.95);
}

/* Timestamp das mensagens */
.message-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Item de amigo ativo na lista */
.dm-item.active {
    background: rgba(255, 255, 0, 0.15);
    border-left: 3px solid var(--gold-primary);
}

.dm-item.active .dm-name {
    color: var(--gold-primary);
    font-weight: 600;
}

.dm-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dm-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-preview {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Welcome screen ajustado */
.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 64px;
    color: var(--gold-primary);
    margin-bottom: 20px;
    opacity: 0.5;
}

.welcome h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome p {
    font-size: 14px;
    max-width: 300px;
}

/* ========== MOBILE RESPONSIVE ENHANCEMENTS ========== */

/* Mobile Backdrop */
.mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 95;
    backdrop-filter: blur(4px);
}

.mobile-backdrop.active {
    display: block;
}

/* Mobile Header Toggle */
.mobile-header-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

/* Server bar mobile - minimized by default */
@media (max-width: 768px) {
    .server-bar {
        position: fixed;
        left: -72px;
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }

    .server-bar.open {
        left: 0;
    }

    .channel-content {
        margin-left: 0 !important;
    }
}

.mobile-header-toggle:hover {
    color: var(--gold-primary);
    background: var(--gold-subtle);
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Large tablets and small laptops */
@media (max-width: 1200px) {
    .channel-bar { width: 220px; }
    .member-bar { width: 200px; }
    .ranking-tables { grid-template-columns: 1fr; }
    .ranking-grid-modern { grid-template-columns: 1fr; }
}

/* Tablets */
@media (max-width: 992px) {
    .member-bar { display: none; }
    .channel-bar { width: 260px; }
    .app { position: relative; }
}

/* Mobile Landscape and Portrait */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        height: 100%;
    }

    .app {
        flex-direction: column;
        height: 100vh;
        position: relative;
    }

    /* Server Bar - Horizontal at top */
    .server-bar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: flex-start;
        padding: 8px 12px;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-shrink: 0;
        position: relative;
        z-index: 10;
        order: 0;
        border-left: none;
        border-bottom: 1px solid var(--black-border);
    }
    
    .server-icon::before { display: none; }

    .server-bar::-webkit-scrollbar {
        height: 4px;
    }

    .server-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .server-icon img {
        width: 100%;
        height: 100%;
    }

    .server-divider {
        width: 2px;
        height: 32px;
        margin: 0 4px;
        flex-shrink: 0;
    }

    #server-list {
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
    }

    /* Channel Bar - Hidden by default, slide in on mobile */
    .channel-bar {
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        width: 280px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .channel-bar.mobile-open {
        transform: translateX(0);
    }

    .channel-header {
        height: 56px;
        padding: 0 12px;
    }

    /* Main Content - Full width */
    .main-content {
        flex: 1;
        min-height: 0;
        position: relative;
    }

    .main-header {
        height: 56px;
        padding: 0 12px;
        position: relative;
    }

    .mobile-header-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        margin-right: 8px;
    }

    /* Messages Area */
    .messages-area {
        padding: 12px;
    }

    .message {
        padding: 6px 0;
        width: 100%;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .message-body {
        width: calc(100% - 46px);
        max-width: 100%;
    }

    .message-text {
        word-break: break-word;
        overflow-wrap: anywhere;
        max-width: 100%;
    }

    /* Mensagens estilo chat (bubbles) no mobile */
    .message-content {
        max-width: 85%;
    }

    .message-out,
    .message-in {
        padding: 4px 0;
    }

    /* Message Input */
    .message-input-wrapper {
        padding: 0 12px 12px;
    }

    .message-input {
        gap: 6px;
    }

    .message-input textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .message-input button {
        width: 40px;
        height: 40px;
    }

    .message-input .send-btn {
        width: 44px;
        height: 44px;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Friends View */
    .friends-view {
        padding: 0;
    }

    .friends-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .friends-header h2 {
        font-size: 18px;
    }

    .friends-tabs {
        gap: 8px;
        flex-wrap: wrap;
    }

    .friends-tabs .tab {
        padding: 6px 12px;
        font-size: 13px;
    }

    .friends-search {
        padding: 12px 16px;
    }

    .friends-list {
        padding: 0 12px;
    }

    .friend-item {
        padding: 10px 12px;
    }

    /* Ranking View */
    .ranking-view {
        padding: 16px;
    }

    .ranking-title h1 {
        font-size: 22px;
    }

    .stats-bar {
        flex-direction: column;
        gap: 8px;
    }

    .stat-box {
        padding: 12px;
    }

    .stat-number {
        font-size: 22px;
    }

    /* Chat Header */
    .chat-header {
        padding: 10px 12px;
        min-height: 52px;
    }

    .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .chat-name {
        font-size: 14px;
    }

    .chat-header-actions button {
        width: 32px;
        height: 32px;
    }

    /* Header Actions */
    .header-actions {
        gap: 2px;
    }

    .header-actions button {
        width: 32px;
        height: 32px;
    }

    /* Voice Bar */
    .voice-bar {
        padding: 8px 12px;
    }

    .voice-controls button {
        width: 32px;
        height: 32px;
    }

    /* Call View - Adjusted for mobile */
    .call-view {
        right: 4px;
        top: 64px;
        left: auto;
        max-width: calc(100% - 8px);
    }

    .call-view-card {
        border-radius: 10px;
    }

    .call-view-inner {
        padding: 4px 6px;
        gap: 6px;
    }

    .call-you-avatar {
        width: 32px;
        height: 32px;
    }

    .call-view-duration {
        font-size: 11px;
    }

    .call-control-btn {
        width: 28px;
        height: 28px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
        margin: 20px;
    }

    .modal-channel-content,
    .modal-category-content,
    .modal-channel-edit-content {
        padding: 20px;
    }

    /* Settings Modal */
    .modal.modal-full .settings-container {
        flex-direction: column;
    }

    .modal.modal-full .settings-nav {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        gap: 8px;
    }

    .modal.modal-full .settings-item {
        white-space: nowrap;
        padding: 8px 12px;
    }

    .modal.modal-full .settings-main {
        padding: 20px;
    }

    .settings-close {
        top: 12px;
        right: 12px;
    }

    /* Admin Page */
    .admin-container {
        padding: 16px;
    }

    .admin-header h1 {
        font-size: 22px;
    }

    .admin-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .admin-search {
        max-width: 100%;
    }

    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 800px;
    }

    /* Search Results */
    .search-results-panel {
        max-height: 300px;
    }

    /* Encryption Bar */
    .encryption-bar {
        padding: 6px;
        font-size: 11px;
    }

    /* User Panel */
    .user-panel {
        padding: 8px 12px;
    }

    .user-controls {
        gap: 2px;
    }

    .user-controls button {
        width: 32px;
        height: 32px;
    }

    /* DM Shortcuts */
    .dm-home-shortcuts {
        padding: 8px;
    }

    .dm-shortcut-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Section Header */
    .section-header {
        padding: 12px 8px 4px;
        font-size: 10px;
    }

    /* Welcome Screen */
    .welcome h2 {
        font-size: 20px;
    }

    .welcome-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .welcome p {
        font-size: 13px;
    }

    /* Toast */
    .toast-container {
        bottom: 80px;
        left: 16px;
        right: 16px;
    }

    .toast {
        padding: 12px 16px;
    }

    /* Auth Check */
    .login-box {
        width: 90%;
        max-width: 340px;
        padding: 32px 24px;
    }

    .login-box h1 {
        font-size: 24px;
    }

    /* Emoji Picker */
    .emoji-picker {
        width: calc(100vw - 32px);
        max-width: 300px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .server-bar {
        height: 56px;
        padding: 6px 10px;
    }

    .server-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .channel-bar {
        width: 260px;
        top: 56px;
    }

    .main-header {
        height: 52px;
    }

    .channel-info span {
        font-size: 14px;
    }

    .header-actions button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .message-input button {
        width: 36px;
        height: 36px;
    }

    .message-input .send-btn {
        width: 40px;
        height: 40px;
    }

    .modal-content {
        padding: 16px;
        margin: 16px;
    }

    .modal-content h2 {
        font-size: 18px;
    }

    .channel-types-card {
        grid-template-columns: 1fr;
    }

    .friends-tabs .tab {
        padding: 5px 10px;
        font-size: 12px;
    }

    .ranking-title h1 {
        font-size: 18px;
    }

    .ranking-column {
        padding: 14px;
    }

    .stat-number {
        font-size: 20px;
    }

    .call-view {
        left: 4px;
        right: 4px;
        max-width: none;
    }

    .call-view-card {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .server-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .message-input {
        gap: 4px;
    }

    .message-input textarea {
        padding: 10px 12px;
    }

    .message-input button {
        width: 32px;
        height: 32px;
    }

    .header-actions {
        gap: 1px;
    }

    .header-actions button {
        width: 26px;
        height: 26px;
    }

    .chat-header-actions button {
        width: 28px;
        height: 28px;
    }
}

/* Landscape Mode Optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .server-bar {
        height: 50px;
    }

    .channel-bar {
        top: 50px;
    }

    .login-box {
        padding: 20px;
    }

    .login-logo img {
        width: 60px;
        height: 60px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .server-icon:hover,
    .dm-item:hover,
    .channel-item:hover,
    .member-item:hover {
        transform: none;
    }

    .server-icon:active,
    .dm-item:active,
    .channel-item:active,
    .member-item:active {
        opacity: 0.7;
    }

    .message-input textarea {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .modal-content input,
    .modal-content select {
        font-size: 16px;
    }

    .search-box input {
        font-size: 16px;
    }

    .friends-search input {
        font-size: 16px;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .server-icon,
    .user-avatar,
    .message-avatar,
    .dm-avatar {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Safe Area for Notched Phones */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .server-bar {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-top: max(8px, env(safe-area-inset-top));
        }

        .message-input-wrapper {
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }

        .mobile-menu-toggle {
            bottom: max(20px, env(safe-area-inset-bottom));
            right: max(20px, env(safe-area-inset-right));
        }

        .toast-container {
            bottom: max(80px, env(safe-area-inset-bottom) + 60px);
        }
    }
}

/* Dark mode preference (already dark, but for system integration) */
@media (prefers-color-scheme: dark) {
    /* Already dark theme - no changes needed */
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .channel-bar {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .server-bar,
    .channel-bar,
    .member-bar,
    .message-input-wrapper,
    .mobile-menu-toggle,
    .header-actions,
    .voice-bar,
    .call-view {
        display: none !important;
    }

    .main-content {
        width: 100%;
        height: auto;
    }

    .messages-area {
        overflow: visible;
        height: auto;
    }
}

/* ============================================
   SERVER SETTINGS MODAL STYLES
   ============================================ */

/* Header Buttons Fix */
.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.header-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

#server-settings-btn:not(.hidden),
#add-member-btn:not(.hidden) {
    display: inline-flex !important;
}

.server-only {
    display: none;
}

.server-only:not(.hidden) {
    display: inline-flex !important;
}

/* Header buttons always visible in server context */
.header-buttons .server-only {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.header-buttons .server-only:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* Fix channel header title */
#server-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.server-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.server-settings-modal.active {
    display: flex;
}

.server-settings-container {
    display: flex;
    width: 900px;
    max-width: 95vw;
    height: 600px;
    max-height: 90vh;
    background: var(--black-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border: 1px solid var(--black-surface);
}

.server-settings-sidebar {
    width: 240px;
    background: var(--black-card);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.server-settings-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--black-surface);
    margin-bottom: 20px;
}

.server-icon-preview {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--black-rich);
}

.server-settings-header h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0 0 4px;
}

.server-settings-header p {
    color: var(--gold-dark);
    font-size: 12px;
    margin: 0;
}

.server-settings-nav {
    flex: 1;
}

.nav-category {
    margin-bottom: 24px;
}

.nav-category-title {
    color: var(--text-tertiary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.server-settings-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-align: left;
}

.server-settings-nav button:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.server-settings-nav button.active {
    background: var(--gold-subtle);
    color: var(--gold-primary);
}

.server-settings-nav button.danger-btn:hover {
    background: rgba(255,68,68,0.15);
    color: var(--error);
}

.close-server-settings {
    margin-top: auto;
    padding: 12px;
    border: 1px solid var(--black-surface);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.close-server-settings:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.server-settings-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.server-settings-main .settings-panel {
    display: none;
}

.server-settings-main .settings-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

.server-settings-main h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-settings-main h2 i {
    color: var(--gold-primary);
}

.server-settings-main .settings-section {
    background: var(--black-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.server-settings-main .settings-section h3 {
    color: var(--text-primary);
    font-size: 14px;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-settings-main .form-group {
    margin-bottom: 16px;
}

.server-settings-main .form-group label {
    display: block;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.server-settings-main .form-group input,
.server-settings-main .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--black-elevated);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-base);
}

.server-settings-main .form-group input:focus,
.server-settings-main .form-group textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.server-settings-main .btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border: none;
    border-radius: var(--radius-md);
    color: var(--black-rich);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.server-settings-main .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--gold-glow);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--black-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card i {
    font-size: 24px;
    color: var(--gold-primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Members List */
.add-member-form .form-group {
    display: flex;
    gap: 12px;
}

.add-member-form input {
    flex: 1;
}

.members-list-header {
    margin-bottom: 12px;
}

.members-list-header input {
    width: 100%;
    padding: 10px 12px;
    background: var(--black-elevated);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

.members-list {
    max-height: 300px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--black-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all var(--transition-base);
}

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

.member-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black-rich);
    font-weight: 600;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
}

.member-avatar:has(img) {
    background: transparent;
}

.member-info {
    flex: 1;
}

.member-name {
    color: var(--text-primary);
    font-weight: 500;
}

.member-role {
    color: var(--text-tertiary);
    font-size: 12px;
}

.member-role.owner {
    color: var(--gold-primary);
}

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

.member-actions button {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-base);
}

.btn-remove {
    background: rgba(239,68,68,0.2);
    color: var(--error);
}

.btn-remove:hover {
    background: var(--error);
    color: var(--text-primary);
}

/* Danger Zone */
.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.danger-card {
    background: var(--black-elevated);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: all var(--transition-base);
}

.danger-card:hover {
    border-color: var(--error);
}

.danger-info h4 {
    color: var(--text-primary);
    margin: 0 0 6px;
}

.danger-info p {
    color: var(--text-tertiary);
    font-size: 13px;
    margin: 0;
}

.text-danger {
    color: var(--error) !important;
}

.btn-warning {
    padding: 10px 16px;
    background: rgba(245,158,11,0.2);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius-md);
    color: #f59e0b;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-warning:hover {
    background: #f59e0b;
    color: var(--black-rich);
}

.btn-danger {
    padding: 10px 16px;
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: var(--error);
    color: var(--text-primary);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Confirm Modals */
.confirm-modal {
    text-align: center;
    max-width: 400px;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.confirm-icon.warning {
    background: rgba(245,158,11,0.2);
    color: #f59e0b;
}

.confirm-icon.danger {
    background: rgba(239,68,68,0.2);
    color: var(--error);
}

.confirm-modal h3 {
    color: var(--text-primary);
    margin: 0 0 12px;
}

.confirm-modal p {
    color: var(--text-secondary);
    margin: 0 0 20px;
}

.confirm-extra {
    background: var(--black-elevated);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.confirm-extra label {
    display: block;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 8px;
    text-align: left;
}

.confirm-extra input {
    width: 100%;
    padding: 10px;
    background: var(--black-surface);
    border: 1px solid var(--black-surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

/* Transfer Member List */
.transfer-member-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 16px 0;
}

.transfer-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--black-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.transfer-member-item:hover {
    background: var(--gold-subtle);
}

.transfer-member-item.selected {
    background: var(--gold-subtle);
    border: 1px solid var(--gold-primary);
}

/* Utility */
.owner-only.hidden,
.member-only.hidden {
    display: none !important;
}

/* Responsive Server Settings */
@media (max-width: 768px) {
    .server-settings-container {
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .server-settings-sidebar {
        width: 100%;
        padding: 16px;
    }

    .server-settings-main {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .danger-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .add-member-form .form-group {
        flex-direction: column;
    }
}

/* ============================================
   USER PROFILE MODAL - FACEBOOK STYLE BANNER
   ============================================ */

.modal-user-profile-content {
    width: 800px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #141414;
    border-radius: 16px;
    border: 1px solid #1f1f1f;
}

.user-profile-card {
    position: relative;
}

.user-profile-banner {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #000 100%);
    overflow: hidden;
}

.user-profile-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}

.user-profile-banner-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,215,0,0.2) 0%, rgba(255,165,0,0.1) 50%, rgba(0,0,0,0.3) 100%);
    z-index: 2;
}

.user-profile-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.user-profile-body {
    position: relative;
    padding: 0 32px 32px;
    margin-top: -80px;
    z-index: 10;
}

.user-profile-avatar-wrap {
    position: relative;
    display: inline-block;
}

.user-profile-avatar-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--black-surface);
    border-radius: 24px;
    z-index: 2;
    background: transparent;
    box-shadow: none;
}

.user-profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: #000;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.user-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-avatar .avatar-initials {
    font-size: 48px;
    font-weight: 700;
    color: #000;
}

.user-profile-status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 4px solid #141414;
    z-index: 3;
}

.user-profile-status.status-online {
    background: #22c55e;
}

.user-profile-status.status-offline {
    background: #666;
}

.user-profile-status.status-away {
    background: #f59e0b;
}

.user-profile-status.status-dnd {
    background: #ef4444;
}

.user-profile-name {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 16px 0 4px;
}

.user-profile-tag {
    color: #FFD700;
    font-size: 14px;
    font-weight: 500;
}

.user-profile-desc-wrap {
    margin: 16px 0 24px;
}

.user-profile-desc {
    color: #888;
    font-size: 14px;
    line-height: 1.6;
    max-width: 600px;
}

.user-profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-profile-chat {
    padding: 12px 24px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-profile-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,215,0,0.3);
}

.btn-profile-add-role {
    padding: 12px 16px;
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-profile-add-role:hover {
    background: #2a2a2a;
    border-color: #FFD700;
}

.modal-user-profile-actions {
    padding: 16px 32px;
    border-top: 1px solid #1f1f1f;
    display: flex;
    justify-content: flex-end;
}

/* Responsive User Profile */
@media (max-width: 768px) {
    .modal-user-profile-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .user-profile-banner {
        height: 200px;
    }

    .user-profile-body {
        padding: 0 20px 20px;
        margin-top: -60px;
    }

    .user-profile-avatar {
        width: 120px;
        height: 120px;
    }

    .user-profile-avatar .avatar-initials {
        font-size: 36px;
    }

    .user-profile-name {
        font-size: 24px;
    }

    .user-profile-actions {
        flex-direction: column;
    }

    .user-profile-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Search Results Panel */
.search-box-wrapper {
    position: relative;
}

.search-results-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: none;
}

.search-results-panel.active {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.search-results-inner {
    padding: 8px;
}

.search-category {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 8px 12px 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: #2a2a2a;
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.search-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-icon i {
    font-size: 14px;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}

.search-empty {
    color: #888;
    font-size: 14px;
    text-align: center;
    padding: 24px;
}

/* ========== MOBILE RESPONSIVE ========== */

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    
    .server-bar {
        width: 60px;
        padding: 8px 0;
    }
    
    .server-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .channel-bar {
        width: 200px;
    }
    
    .member-bar {
        width: 200px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    html, body {
        font-size: 13px;
    }
    
    /* Server bar - horizontal scroll on mobile */
    .app {
        flex-direction: row;
    }
    
    .server-bar {
        width: 56px;
        padding: 6px 0;
    }
    
    .server-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 6px;
        font-size: 14px;
    }
    
    .server-icon.active::before {
        height: 28px;
    }
    
    .server-divider {
        width: 28px;
        margin: 6px 0;
    }
    
    /* Channel bar - collapsible on mobile */
    .channel-bar {
        width: 0;
        overflow: hidden;
        transition: width 0.3s ease;
    }
    
    .channel-bar.mobile-open {
        width: 240px;
        position: absolute;
        left: 56px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        background: #000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    .channel-header {
        height: 44px;
        padding: 0 12px;
    }
    
    .channel-header span {
        font-size: 13px;
    }
    
    .search-box {
        padding: 8px;
    }
    
    .search-box input {
        font-size: 12px;
        padding: 8px 10px 8px 28px;
    }
    
    .channel-content {
        padding: 0 6px;
    }
    
    .dm-item, .channel-item {
        padding: 8px 10px;
    }
    
    .dm-item span, .channel-item span {
        font-size: 13px;
    }
    
    .dm-avatar {
        width: 28px;
        height: 28px;
        margin-right: 10px;
    }
    
    .section-header {
        padding: 12px 6px 4px;
        font-size: 10px;
    }
    
    /* Main content */
    .main-content {
        flex: 1;
    }
    
    .main-header {
        height: 44px;
        padding: 0 12px;
    }
    
    .main-header .channel-info span {
        font-size: 13px;
    }
    
    /* Member bar - collapsible on mobile */
    .member-bar {
        width: 0;
        overflow: hidden;
        transition: width 0.3s ease;
    }
    
    .member-bar.mobile-open {
        width: 220px;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        background: #111;
        box-shadow: -2px 0 10px rgba(0,0,0,0.5);
    }
    
    .member-header {
        height: 44px;
        padding: 0 12px;
        font-size: 13px;
    }
    
    .member-item {
        padding: 6px 10px;
    }
    
    .member-avatar {
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }
    
    .member-name {
        font-size: 13px;
    }
    
    .member-status {
        font-size: 11px;
    }
    
    /* User panel */
    .user-panel {
        padding: 6px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .username {
        font-size: 12px;
    }
    
    .user-tag {
        font-size: 10px;
    }
    
    .user-controls button {
        width: 28px;
        height: 28px;
    }
    
    /* Messages */
    .message {
        padding: 8px 12px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .message-header {
        margin-bottom: 4px;
    }
    
    .message-username {
        font-size: 13px;
    }
    
    .message-timestamp {
        font-size: 10px;
    }
    
    .message-content {
        font-size: 13px;
        line-height: 1.4;
    }
    
    /* Message input */
    .message-input-container {
        padding: 8px 12px;
    }
    
    .message-input {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    /* Voice bar */
    .voice-bar {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .voice-info {
        font-size: 13px;
    }
    
    .voice-controls button {
        width: 28px;
        height: 28px;
    }
    
    /* Call view */
    .call-view {
        right: 4px;
        top: 4px;
    }
    
    .call-view-card {
        border-radius: 8px;
    }
    
    .call-view-inner {
        padding: 4px 6px;
        gap: 6px;
    }
    
    .call-you-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    /* Floating windows */
    .floating-video-window {
        min-width: 150px !important;
        min-height: 100px !important;
        max-width: 80vw !important;
        max-height: 60vh !important;
    }
    
    /* Modals */
    .modal-overlay {
        padding: 16px;
    }
    
    .modal {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 16px;
    }
    
    .modal-footer button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Login page */
    .login-box {
        width: 90%;
        max-width: 340px;
        padding: 32px 24px;
    }
    
    .login-logo img {
        width: 64px;
        height: 64px;
    }
    
    .login-box h1 {
        font-size: 24px;
    }
    
    .auth-form input {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .auth-form button {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Toast notifications */
    .toast {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 8px;
        margin: 4px;
    }
    
    /* Buttons */
    .header-icon-btn {
        width: 28px;
        height: 28px;
    }
    
    .add-btn {
        padding: 6px;
    }
    
    /* Search results */
    .search-results-panel {
        max-height: 50vh;
    }
    
    .search-result-item {
        padding: 8px 10px;
    }
    
    .search-result-icon {
        width: 32px;
        height: 32px;
    }
    
    .search-result-name {
        font-size: 13px;
    }
    
    .search-result-meta {
        font-size: 11px;
    }
    
    /* Scrollbar - smaller on mobile */
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    ::-webkit-scrollbar-thumb {
        border-radius: 2px;
    }
}

/* Small mobile (360px and below) */
@media (max-width: 360px) {
    .server-bar {
        width: 52px;
    }
    
    .server-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .server-icon.active::before {
        height: 24px;
    }
    
    .channel-bar.mobile-open {
        left: 52px;
        width: 200px;
    }
    
    .dm-avatar {
        width: 24px;
        height: 24px;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
    }
    
    .message-content {
        font-size: 12px;
    }
    
    .username {
        font-size: 11px;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
    }
    
    .user-controls button {
        width: 24px;
        height: 24px;
    }
}

/* Overlay for mobile menus */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}
