/* PrivateChat - Tema Empresarial Dark & Gold */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

:root {
    /* Cores principais - Tema Dark & Gold Empresarial */
    --bg-primary: #1a1a1a;
    --bg-secondary: #141414;
    --bg-tertiary: #0d0d0d;
    --bg-accent: #252525;
    --bg-card: #1e1e1e;
    
    /* Cores de texto */
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-link: #d4af37;
    
    /* Cores de destaque - Dourado */
    --accent-primary: #d4af37;
    --accent-primary-hover: #c9a227;
    --accent-primary-light: rgba(212, 175, 55, 0.15);
    --accent-success: #28a745;
    --accent-warning: #ffc107;
    --accent-danger: #dc3545;
    --accent-online: #28a745;
    --accent-away: #ffc107;
    --accent-offline: #6c757d;
    
    /* Bordas e sombras */
    --border-color: #2a2a2a;
    --border-light: #333333;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
    
    /* Dimensões */
    --sidebar-width: 280px;
    --members-width: 260px;
    --header-height: 60px;
    --input-height: 72px;
    
    /* Transições */
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Tipografia */
    --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* ===== Page Loader ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #141414 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loader-logo {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-icon {
    font-size: 40px;
    color: var(--accent-primary);
    z-index: 2;
    animation: loaderPulse 2s ease-in-out infinite;
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-right-color: var(--accent-primary);
    border-radius: 50%;
    animation: loaderSpin 1.2s linear infinite;
}

.loader-ring::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 2px solid transparent;
    border-bottom-color: rgba(212, 175, 55, 0.3);
    border-left-color: rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    animation: loaderSpin 2s linear infinite reverse;
}

.loader-ring::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 50%;
}

.loader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loader-brand {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: loaderShine 3s linear infinite;
}

.loader-tagline {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.8;
}

.loader-progress {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    border-radius: 2px;
    animation: loaderProgress 1.5s ease-in-out infinite;
}

@keyframes loaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loaderPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes loaderShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes loaderProgress {
    0% { 
        left: -30%;
        width: 30%;
    }
    50% {
        width: 50%;
    }
    100% { 
        left: 100%;
        width: 30%;
    }
}

/* Scrollbar personalizada elegante */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Layout principal */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar de canais */
.channels-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h1 i {
    color: var(--accent-primary);
    font-size: 22px;
}

.channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.channel-category {
    margin-bottom: 24px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
}

.category-header:hover {
    color: var(--text-secondary);
}

.category-header i {
    font-size: 14px;
    margin-right: 8px;
    color: var(--accent-primary);
}

.category-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: var(--transition);
}

.category-header button:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.channel-item:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.channel-item.active {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.channel-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.channel-item.active .channel-icon {
    color: var(--accent-primary);
}

.channel-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-unread {
    background: var(--accent-primary);
    color: var(--bg-tertiary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Área do usuário */
.user-area {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
    border: 2px solid var(--accent-primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 14px;
}

.user-avatar:hover .avatar-edit-overlay {
    opacity: 1;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-tertiary);
}

.status-online {
    background: var(--accent-online);
}

.status-away {
    background: var(--accent-away);
}

.status-offline {
    background: var(--accent-offline);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status {
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 4px;
}

.user-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 16px;
}

.user-actions button:hover {
    background: var(--bg-accent);
    color: var(--accent-primary);
}

/* Área principal de chat */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.chat-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    gap: 12px;
}

.chat-header-icon {
    font-size: 20px;
    color: var(--accent-primary);
}

.chat-header-name {
    font-size: 16px;
    font-weight: 600;
}

.chat-header-description {
    margin-left: 16px;
    color: var(--text-muted);
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-header-actions button {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 16px;
}

.chat-header-actions button:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Lista de mensagens */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.messages-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.message {
    display: flex;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.message:hover {
    background: var(--bg-card);
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--bg-tertiary);
    margin-right: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.message-author {
    font-weight: 600;
    color: var(--accent-primary);
}

.message-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}

.message-edited {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}

.message-text {
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
}

.message-text a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.message-text a:hover {
    border-bottom-color: var(--accent-primary);
}

/* Mensagens de arquivo */
.message-file {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 10px;
    max-width: min(400px, 100%);
    width: 100%;
    border: 1px solid var(--border-color);
}

.file-icon {
    font-size: 28px;
    color: var(--accent-primary);
}

.file-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-download {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: var(--transition);
    background: var(--bg-accent);
}

.file-download:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

/* Imagens */
.message-image {
    max-width: min(400px, 100%);
    max-height: 300px;
    border-radius: 10px;
    margin-top: 10px;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.message-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    display: block;
}

/* Custom Video Player */
.pc-video-player {
    position: relative;
    max-width: min(500px, 100%);
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pc-video-player:fullscreen {
    max-width: 100%;
    border-radius: 0;
}

.pc-video-player:fullscreen .pc-video {
    max-height: 100vh;
}

.pc-video {
    width: 100%;
    max-height: 350px;
    display: block;
    background: #000;
}

.pc-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.pc-video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.pc-video-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.pc-video-play-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border: none;
    color: var(--bg-tertiary);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.pc-video-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.5);
}

.pc-video-play-btn i {
    margin-left: 4px;
}

.pc-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    opacity: 1;
    transition: var(--transition);
}

.pc-video-player:not(:hover) .pc-video-controls {
    opacity: 0.7;
}

.pc-video-player:fullscreen .pc-video-controls {
    padding: 20px 30px;
}

.pc-video-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-video-btn:hover {
    color: var(--accent-primary);
    background: rgba(255,255,255,0.1);
}

.pc-video-progress {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pc-video-progress:hover {
    height: 7px;
}

.pc-video-progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    transition: width 0.1s;
}

.pc-video-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border-radius: 3px;
    z-index: 1;
    transition: width 0.1s;
}

.pc-video-time {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    min-width: 85px;
    text-align: center;
    font-family: monospace;
}

.pc-video-volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pc-video-volume-slider {
    width: 0;
    opacity: 0;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
}

.pc-video-volume:hover .pc-video-volume-slider {
    width: 60px;
    opacity: 1;
}

.pc-video-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.pc-video-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* PDF Viewer */
.pc-pdf-viewer {
    max-width: min(400px, 100%);
    width: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pc-pdf-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border-color);
}

.pc-pdf-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.pc-pdf-info {
    flex: 1;
    min-width: 0;
}

.pc-pdf-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-pdf-size {
    font-size: 11px;
    color: var(--text-muted);
}

.pc-pdf-preview {
    position: relative;
    background: #2a2a2a;
    min-height: 250px;
    max-height: 350px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-pdf-canvas {
    max-width: 100%;
    display: block;
}

.pc-pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.pc-pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--accent-danger);
    padding: 40px;
}

.pc-pdf-error i {
    font-size: 32px;
}

.pc-pdf-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

.pc-pdf-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-pdf-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pc-pdf-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.pc-pdf-page,
.pc-pdf-zoom {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    font-family: monospace;
}

.pc-pdf-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* PDF Fullscreen Modal */
.pc-modal-fullscreen {
    max-width: 95vw !important;
    width: 95vw !important;
    max-height: 95vh !important;
}

.pc-pdf-fullscreen-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.pc-pdf-fullscreen-container {
    flex: 1;
    overflow: auto;
    background: #1a1a1a;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.pc-pdf-fullcanvas {
    max-width: 100%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.pc-pdf-fullscreen-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pc-pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* PDF Responsive */
@media (max-width: 480px) {
    .pc-pdf-viewer {
        max-width: 100%;
    }
    
    .pc-pdf-preview {
        min-height: 200px;
        max-height: 280px;
    }
    
    .pc-pdf-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pc-pdf-actions {
        flex-wrap: wrap;
    }
    
    .pc-pdf-fullscreen-controls {
        gap: 10px;
        padding: 12px;
    }
    
    .pc-modal-fullscreen {
        max-width: 100vw !important;
        width: 100vw !important;
        border-radius: 0 !important;
    }
}

/* ===== TXT Viewer ===== */
.pc-txt-viewer {
    max-width: min(450px, 100%);
    width: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pc-txt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border-color);
}

.pc-txt-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.pc-txt-info {
    flex: 1;
    min-width: 0;
}

.pc-txt-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-txt-size {
    font-size: 11px;
    color: var(--text-muted);
}

.pc-txt-content {
    background: #1e1e1e;
    max-height: 300px;
    min-height: 100px;
    overflow: auto;
    position: relative;
}

.pc-txt-content.loaded {
    padding: 0;
}

.pc-txt-pre {
    margin: 0;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 4;
}

.pc-txt-loading,
.pc-txt-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.pc-txt-error {
    color: var(--accent-danger);
}

.pc-txt-error i {
    font-size: 28px;
}

.pc-txt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.pc-txt-lines {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.pc-txt-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pc-txt-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pc-txt-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

/* TXT Viewer Responsive */
@media (max-width: 480px) {
    .pc-txt-viewer {
        max-width: 100%;
    }
    
    .pc-txt-content {
        max-height: 250px;
    }
    
    .pc-txt-pre {
        font-size: 11px;
    }
}

/* Vídeos antigos (fallback) */
.message-video {
    max-width: min(450px, 100%);
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.message-video video {
    max-width: 100%;
    border-radius: 10px;
    display: block;
}

/* Custom Audio Player */
.message-audio {
    margin-top: 10px;
}

.pc-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    padding: 12px 16px;
    border-radius: 16px;
    max-width: min(380px, 100%);
    width: 100%;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pc-audio-player audio {
    display: none;
}

.pc-audio-play-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border: none;
    color: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.pc-audio-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.pc-audio-play-btn i {
    margin-left: 2px;
}

.pc-audio-visualizer {
    flex: 1;
    position: relative;
    height: 48px;
    min-width: 150px;
}

.pc-audio-canvas {
    width: 100%;
    height: 40px;
    border-radius: 8px;
}

.pc-audio-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.pc-audio-progress-container:hover {
    height: 6px;
}

.pc-audio-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.pc-audio-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 45px;
}

.pc-audio-time {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: monospace;
}

.pc-audio-duration {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
}

.pc-audio-speed-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 20px;
    transition: var(--transition);
    min-width: 38px;
    font-family: monospace;
}

.pc-audio-speed-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.pc-audio-speed-btn.active {
    background: var(--accent-primary);
    color: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

/* Audio Player Responsive */
@media (max-width: 480px) {
    .pc-audio-player {
        max-width: 100%;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .pc-audio-play-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 16px;
    }
    
    .pc-audio-visualizer {
        min-width: 100px;
        height: 40px;
    }
    
    .pc-audio-canvas {
        height: 32px;
    }
    
    .pc-audio-info {
        min-width: 40px;
    }
    
    .pc-audio-time {
        font-size: 11px;
    }
    
    .pc-audio-speed-btn {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 32px;
    }
}

/* Legacy voice player (fallback) */
.voice-player {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    padding: 14px 20px;
    border-radius: 30px;
    max-width: min(320px, 100%);
    width: 100%;
    border: 1px solid var(--border-color);
}

.voice-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border: none;
    color: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}

.voice-play-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-gold);
}

.voice-waveform {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.voice-bar {
    width: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.voice-duration {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 44px;
    text-align: right;
    font-weight: 500;
}

/* Reações */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.reaction {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.reaction:hover {
    border-color: var(--accent-primary);
}

.reaction.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.reaction-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Ações da mensagem */
.message-actions {
    display: none;
    position: absolute;
    right: 12px;
    top: -12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.message:hover .message-actions {
    display: flex;
}

.message-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    transition: var(--transition);
}

.message-action:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

/* Área de input */
.chat-input-container {
    padding: 16px 24px 24px;
}

.chat-input-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.input-actions {
    display: flex;
    padding: 8px 0;
}

.input-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    font-size: 18px;
    transition: var(--transition);
}

.input-action:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.input-action.recording {
    color: var(--accent-danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 10px 12px;
    resize: none;
    max-height: 200px;
    min-height: 44px;
    line-height: 1.5;
    font-family: var(--font-family);
}

.message-input::placeholder {
    color: var(--text-muted);
}

.message-input:focus {
    outline: none;
}

/* Sidebar de membros */
.members-sidebar {
    width: var(--members-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.members-header {
    padding: 18px 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.members-header i {
    color: var(--accent-primary);
}

.members-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.member-category {
    margin-bottom: 20px;
}

.member-category-title {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.member-item:hover {
    background: var(--bg-accent);
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--bg-tertiary);
    margin-right: 12px;
    position: relative;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-item:hover .member-name {
    color: var(--text-primary);
}

.member-role {
    font-size: 10px;
    color: var(--accent-primary);
    background: var(--accent-primary-light);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Modais Customizados */
.pc-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.pc-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pc-modal {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-slow);
    border: 1px solid var(--border-color);
}

.pc-modal.pc-modal-lg {
    max-width: 800px;
}

.pc-modal-overlay.active .pc-modal {
    transform: scale(1) translateY(0);
}

.pc-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pc-modal-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pc-modal-title i {
    color: var(--accent-primary);
}

.pc-modal-close {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    line-height: 1;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-modal-close:hover {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.pc-modal-body {
    padding: 24px;
}

.pc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Dialog Styles */
.dialog-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.dialog-input {
    width: 100%;
    margin-top: 8px;
}

.dialog-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

/* Icon Picker */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-height: 180px;
    overflow-y: auto;
}

.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    color: var(--text-muted);
    transition: var(--transition);
}

.icon-option:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
    border-color: var(--accent-primary-light);
}

.icon-option.selected {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.icon-option i {
    font-size: 18px;
}

/* Channel Settings Modal */
.channel-info-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.channel-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.channel-info-header > i {
    font-size: 32px;
    color: var(--accent-primary);
    background: var(--accent-primary-light);
    padding: 12px;
    border-radius: 12px;
}

.channel-info-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.channel-info-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.channel-info-details {
    display: flex;
    gap: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.danger-zone {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
    border-radius: 12px;
    padding: 20px;
}

.danger-zone h4 {
    color: var(--accent-danger);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-zone p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.info-notice {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.info-notice i {
    font-size: 20px;
    color: var(--accent-primary);
}

.text-danger {
    color: var(--accent-danger) !important;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input, .form-select, .form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-family);
    transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Botões */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    color: var(--bg-tertiary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-success {
    background: var(--accent-success);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 20px;
    color: var(--accent-primary);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.empty-state-description {
    font-size: 14px;
    max-width: min(320px, 100%);
    line-height: 1.6;
}

/* Toasts/Notificações */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    max-width: min(380px, calc(100% - 20px));
    width: 100%;
    border: 1px solid var(--border-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--accent-success);
}

.toast-error {
    border-left: 4px solid var(--accent-danger);
}

.toast-info {
    border-left: 4px solid var(--accent-primary);
}

/* Dropdown menus */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 200px;
    padding: 8px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 6px;
}

.dropdown-item:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Utilitários */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--accent-primary) !important;
}

.text-success {
    color: var(--accent-success);
}

.text-danger {
    color: var(--accent-danger);
}

/* Responsivo */

/* Overlay para fechar sidebar no mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1200px) {
    .members-sidebar {
        display: none;
    }
    
    .members-sidebar.active {
        display: flex;
        position: fixed;
        right: 0;
        top: 0;
        height: 100%;
        z-index: 100;
        box-shadow: var(--shadow);
        width: 280px;
        animation: slideInRight 0.3s ease;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 85%;
        --header-height: 56px;
    }
    
    /* Garantir que não haja overflow horizontal */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Safe area para dispositivos com notch */
    .app-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .main-content {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .channels-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 100;
        transition: transform 0.3s ease, opacity 0.3s ease;
        box-shadow: var(--shadow);
        transform: translateX(-100%);
        max-width: 320px;
        width: 85%;
    }
    
    .channels-sidebar.active {
        transform: translateX(0);
        animation: slideInLeft 0.3s ease;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .chat-header {
        padding: 0 12px;
        gap: 8px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .chat-header-name {
        font-size: 15px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .chat-header-description {
        display: none;
    }
    
    .chat-header-actions {
        flex-shrink: 0;
        gap: 4px;
    }
    
    .chat-header-actions button {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .chat-header-icon {
        flex-shrink: 0;
    }
    
    #menuBtn {
        display: flex !important;
        min-width: 40px;
        min-height: 40px;
        flex-shrink: 0;
    }
    
    .chat-input-container {
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
        max-width: 100%;
        overflow: hidden;
    }
    
    .chat-input-wrapper {
        padding: 6px 12px;
        max-width: 100%;
    }
    
    .message-input {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 8px 10px;
        max-width: 100%;
    }
    
    .input-action {
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
    }
    
    .messages-container {
        padding: 10px 8px;
    }
    
    /* Containment para mensagens */
    .messages-list {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .message-content {
        max-width: calc(100% - 48px);
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    /* Mensagens adaptadas */
    .message {
        padding: 10px 12px;
        max-width: 100%;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        margin-right: 12px;
        font-size: 14px;
    }
    
    .message-author {
        font-size: 14px;
    }
    
    .message-text {
        font-size: 15px;
    }
    
    .message-timestamp {
        font-size: 10px;
    }
    
    /* Arquivos e mídia adaptados */
    .message-file {
        max-width: 100%;
        padding: 12px 14px;
    }
    
    .message-image {
        max-width: 100%;
    }
    
    .message-image img {
        max-width: 100%;
    }
    
    /* Video Player Mobile */
    .pc-video-player {
        max-width: 100%;
        width: 100%;
    }
    
    /* Todos os players de mídia */
    .pc-audio-player,
    .pc-pdf-viewer,
    .pc-txt-viewer,
    .voice-player {
        max-width: 100%;
        width: 100%;
    }
    
    .pc-video {
        max-height: 220px;
    }
    
    .pc-video-play-btn {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
    
    .pc-video-controls {
        padding: 8px 10px;
        gap: 6px;
    }
    
    .pc-video-time {
        font-size: 10px;
        min-width: 65px;
    }
    
    .pc-video-volume-slider {
        display: none !important;
    }
    
    /* Ações de mensagem mobile */
    .message-actions {
        position: static;
        margin-top: 8px;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .message:hover .message-actions,
    .message.touched .message-actions {
        display: flex;
    }
    
    .message-action {
        padding: 10px 14px;
    }
    
    /* Área do usuário */
    .user-area {
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .user-actions button {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Canais */
    .channel-item {
        padding: 12px 14px;
        min-height: 48px;
    }
    
    .category-header button {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Resposta a mensagem */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-left: 3px solid var(--accent-primary);
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
}

.reply-preview-content {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 14px;
}

.reply-preview-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.reply-preview-close:hover {
    color: var(--accent-danger);
}

/* File upload preview */
.upload-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.upload-preview-icon {
    font-size: 28px;
    color: var(--accent-primary);
}

.upload-preview-info {
    flex: 1;
}

.upload-preview-name {
    font-weight: 500;
}

.upload-preview-size {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-preview-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.upload-preview-remove:hover {
    color: var(--accent-danger);
    background: rgba(220, 53, 69, 0.1);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Admin Panel Styles */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 4px;
}

.admin-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.admin-tab:hover {
    color: var(--text-primary);
}

.admin-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.admin-user-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.admin-user-info {
    flex: 1;
    margin-left: 12px;
}

.admin-user-name {
    font-weight: 600;
}

.admin-user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-user-actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(40, 167, 69, 0.15);
    color: var(--accent-success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: var(--accent-warning);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: var(--accent-danger);
}

.badge-primary {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--bg-accent);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    color: var(--accent-primary);
}

.card-body {
    padding: 20px;
}

/* Settings specific */
.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section-title i {
    color: var(--accent-primary);
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: var(--bg-tertiary);
    border: 3px solid var(--accent-primary);
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Invite code display */
.invite-code-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-family: monospace;
    font-size: 15px;
    border: 1px solid var(--border-color);
}

.invite-code-display code {
    flex: 1;
    color: var(--accent-primary);
    word-break: break-all;
}

.invite-code-display button {
    padding: 8px 12px;
}

/* ===== Performance Optimizations ===== */
/* GPU Acceleration for smooth animations */
.messages-container,
.channels-list,
.members-list,
.pc-modal-container {
    will-change: scroll-position;
    -webkit-overflow-scrolling: touch;
}

.message-item,
.channel-item,
.member-item {
    will-change: transform, opacity;
    transform: translateZ(0);
}

.pc-modal-backdrop {
    will-change: opacity;
}

.pc-modal {
    will-change: transform, opacity;
}

/* Optimize images */
.message-image img,
.avatar img {
    image-rendering: -webkit-optimize-contrast;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Reduce paint areas */
.sidebar-header,
.chat-header,
.members-header {
    contain: layout style;
}

.message-item {
    contain: content;
}

/* Optimize font rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce reflows on scroll */
.messages-container {
    overflow-anchor: auto;
}

/* Optimize hover states */
@media (hover: hover) {
    .channel-item:hover,
    .member-item:hover,
    .message-action:hover {
        transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    }
}

/* Touch optimization */
@media (hover: none) {
    .channel-item,
    .member-item,
    .message-action {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Print styles */
@media print {
    .channels-sidebar,
    .members-sidebar,
    .chat-input-container,
    .message-actions {
        display: none !important;
    }
    
    .main-chat {
        margin: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Avatar Editor */
.avatar-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.avatar-editor-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow);
}

.avatar-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.avatar-editor-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-editor-header h3 i {
    color: var(--accent-primary);
}

.avatar-editor-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: var(--transition);
}

.avatar-editor-close:hover {
    color: var(--accent-danger);
}

.avatar-editor-canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-editor-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.avatar-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.avatar-crop-circle {
    position: absolute;
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
}

.avatar-editor-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.avatar-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-control-group label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 60px;
}

.avatar-control-group input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.avatar-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.avatar-control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-primary);
}

.avatar-control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.avatar-editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.avatar-editor-actions .btn {
    padding: 10px 24px;
    font-size: 0.95rem;
}

.avatar-preview-small {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    object-fit: cover;
}

/* ===== Mobile Responsiveness Enhancements ===== */

/* Breakpoint 480px - Smartphones pequenos */
@media (max-width: 480px) {
    :root {
        --header-height: 52px;
    }
    
    /* Forçar contenção de overflow */
    .messages-list,
    .message-content,
    .message-text {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    /* Limitar largura de mídia */
    .message-file,
    .message-image,
    .message-video,
    .pc-video-player,
    .pc-audio-player,
    .pc-pdf-viewer,
    .pc-txt-viewer,
    .voice-player {
        max-width: 100% !important;
        width: 100%;
    }
    
    .message-image img,
    .message-video video {
        max-width: 100% !important;
        height: auto;
    }
    
    .sidebar-header {
        padding: 0 14px;
    }
    
    .sidebar-header h1 {
        font-size: 16px;
    }
    
    .sidebar-header h1 i {
        font-size: 18px;
    }
    
    .channels-list {
        padding: 12px 8px;
    }
    
    .channel-item {
        padding: 10px 12px;
    }
    
    .channel-name {
        font-size: 13px;
    }
    
    .category-header {
        font-size: 10px;
        padding: 6px 10px;
    }
    
    .chat-header {
        padding: 0 10px;
    }
    
    .chat-header-name {
        font-size: 14px;
    }
    
    .chat-header-actions button {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .messages-container {
        padding: 8px 6px;
    }
    
    .message {
        padding: 8px 10px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        margin-right: 10px;
        font-size: 12px;
    }
    
    .message-header {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .message-author {
        font-size: 13px;
    }
    
    .message-text {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .chat-input-container {
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    }
    
    .chat-input-wrapper {
        padding: 4px 8px;
        border-radius: 10px;
    }
    
    .message-input {
        padding: 6px 8px;
        min-height: 40px;
    }
    
    .input-action {
        font-size: 18px;
        min-width: 40px;
        min-height: 40px;
    }
    
    /* User area */
    .user-area {
        padding: 8px 12px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-status {
        font-size: 11px;
    }
    
    /* Audio player */
    .pc-audio-player {
        padding: 8px 10px;
        gap: 8px;
        max-width: 100%;
    }
    
    .pc-audio-play-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 14px;
    }
    
    .pc-audio-visualizer {
        min-width: 80px;
        height: 36px;
    }
    
    .pc-audio-canvas {
        height: 28px;
    }
    
    .pc-audio-time {
        font-size: 10px;
    }
    
    .pc-audio-speed-btn {
        display: none;
    }
    
    /* Video player */
    .pc-video {
        max-height: 180px;
    }
    
    .pc-video-play-btn {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    
    .pc-video-controls {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .pc-video-btn {
        font-size: 16px;
        padding: 4px;
    }
    
    .pc-video-time {
        font-size: 9px;
        min-width: 55px;
    }
    
    /* Botões */
    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Avatar Editor Mobile */
    .avatar-editor-overlay {
        padding: 10px;
    }
    
    .avatar-editor-container {
        padding: 16px;
        max-width: 100%;
    }
    
    .avatar-editor-header h3 {
        font-size: 1rem;
    }
    
    .avatar-editor-actions {
        flex-direction: column;
    }
    
    .avatar-editor-actions .btn {
        width: 100%;
    }
}

/* ===== Modal Mobile Optimizations ===== */
@media (max-width: 768px) {
    .pc-modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }
    
    .pc-modal {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        margin-bottom: 0;
    }
    
    .pc-modal-overlay.active .pc-modal {
        transform: translateY(0);
    }
    
    .pc-modal-header {
        padding: 16px 18px;
    }
    
    .pc-modal-title {
        font-size: 17px;
    }
    
    .pc-modal-body {
        padding: 18px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .pc-modal-footer {
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
        flex-wrap: wrap;
    }
    
    .pc-modal-footer .btn {
        flex: 1;
        min-width: 45%;
    }
    
    /* Formulários em modal */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-input, .form-select, .form-control {
        padding: 14px 12px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .form-label {
        font-size: 12px;
    }
    
    /* Icon picker */
    .icon-picker {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
    
    .icon-option {
        width: 44px;
        height: 44px;
    }
    
    /* Channel info */
    .channel-info-details {
        flex-direction: column;
        gap: 12px;
    }
    
    .danger-zone {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .pc-modal-overlay {
        padding: 0;
    }
    
    .pc-modal {
        border-radius: 14px 14px 0 0;
        max-height: 85vh;
    }
    
    .pc-modal-header {
        padding: 14px 16px;
    }
    
    .pc-modal-title {
        font-size: 16px;
        gap: 8px;
    }
    
    .pc-modal-close {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .pc-modal-body {
        padding: 16px;
    }
    
    .icon-picker {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .channel-info-header {
        flex-direction: column;
        text-align: center;
    }
    
    .channel-info-header > i {
        font-size: 28px;
        padding: 10px;
    }
}

/* ===== Empty State Mobile ===== */
@media (max-width: 768px) {
    .empty-state {
        padding: 30px 20px;
    }
    
    .empty-state-icon {
        font-size: 48px;
    }
    
    .empty-state-title {
        font-size: 18px;
    }
    
    .empty-state-description {
        font-size: 13px;
    }
}

/* ===== Touch Improvements ===== */
@media (pointer: coarse) {
    /* Aumentar área de toque */
    .channel-item,
    .member-item {
        min-height: 48px;
    }
    
    .input-action,
    .message-action,
    .user-actions button,
    .chat-header-actions button {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remover delays de toque */
    * {
        touch-action: manipulation;
    }
    
    /* Feedback visual de toque */
    .channel-item:active,
    .member-item:active,
    .btn:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    /* Scroll mais suave */
    .channels-list,
    .members-list,
    .messages-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ===== Landscape Mobile ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-header {
        height: 48px;
    }
    
    .chat-input-container {
        padding: 6px 12px;
    }
    
    .message-input {
        min-height: 36px;
    }
    
    .pc-modal {
        max-height: 95vh;
    }
    
    .pc-modal-body {
        max-height: 50vh;
    }
}

/* ===== Reply Preview Mobile ===== */
@media (max-width: 768px) {
    .reply-preview {
        padding: 8px 12px;
        margin: 0 -6px;
    }
    
    .reply-preview-content {
        font-size: 13px;
    }
}

/* ===== Toast Mobile ===== */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    .toast {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== PWA Styles ===== */
@media (display-mode: standalone) {
    .app-container {
        padding-top: env(safe-area-inset-top);
    }
    
    .chat-input-container {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* ===== High DPI Screens ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .message-avatar,
    .user-avatar,
    .member-avatar {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===== Sortable Channel List (Admin) ===== */
.sortable-channel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sortable-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.sortable-channel-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.sortable-channel-item.dragging {
    opacity: 0.5;
    background: var(--accent-primary-light);
    border-color: var(--accent-primary);
    cursor: grabbing;
}

.sortable-channel-item.drag-over {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-light);
}

.sortable-channel-item .drag-handle {
    color: var(--text-muted);
    font-size: 18px;
    cursor: grab;
}

.sortable-channel-item .drag-handle:hover {
    color: var(--accent-primary);
}

.sortable-channel-item .channel-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.sortable-channel-item .channel-meta {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .sortable-channel-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .sortable-channel-item .channel-meta {
        display: none;
    }
}