/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-tertiary: #2f2f2f;
    --bg-input: #333333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --accent-primary: #007bff;
    --accent-secondary: #28a745;
    --border-color: #3d3d3d;
    --hover-color: #343434;
    --online-color: #28a745;
    --offline-color: #6c757d;
    --unread-color: #dc3545;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

#container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Enhanced Header Styles */
#header {
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.2rem;
}

.logo .tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Header Centser Section */
.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    font-size: 0.6rem;
    color: var(--online-color);
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.connection-quality {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.latency {
    font-weight: 600;
    color: var(--online-color);
}

.activity-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-item i {
    color: var(--accent-primary);
    font-size: 0.9rem;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: var(--hover-color);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Admin button styles */
.admin-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #dc3545;
    color: white;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    border-color: #c82333;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Moderator button styles */
.moderator-btn {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border-color: #ffc107;
    color: #212529;
}

.moderator-btn:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    border-color: #e0a800;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Registration Banner Styles */
.registration-banner {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 1rem 0;
    border-bottom: 2px solid #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    animation: slideDown 0.5s ease-out;
}

.banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.banner-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    animation: pulse 2s infinite;
}

.banner-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: white;
}

.banner-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.banner-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.banner-actions .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.banner-actions .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.banner-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.banner-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.banner-actions .btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.banner-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive design for banner */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .banner-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .banner-actions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .registration-banner {
        padding: 0.75rem 0;
    }
    
    .banner-content {
        padding: 0 1rem;
    }
    
    .banner-text h3 {
        font-size: 1rem;
    }
    
    .banner-text p {
        font-size: 0.8rem;
    }
    
    .banner-actions {
        gap: 0.5rem;
    }
    
    .banner-actions .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--unread-color);
    color: white;
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    animation: pulse 2s infinite;
}

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.username {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.user-status-text {
    font-size: 0.75rem;
    color: var(--online-color);
    font-weight: 500;
}

.user-avatar {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.user-avatar:hover img {
    border-color: var(--accent-primary);
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.status-indicator.online {
    background-color: var(--online-color);
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background-color: var(--offline-color);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    z-index: 1000;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background: var(--hover-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

/* Main Content */
#main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.new-chat-btn {
    background: var(--accent-primary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.search-container {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: var(--hover-color);
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

.conversation-list::-webkit-scrollbar {
    width: 6px;
}

.conversation-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.conversation-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.conversation-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.conversation-item:hover {
    background-color: var(--hover-color);
}

.conversation-item.active {
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.conversation-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.conversation-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.unread-indicator {
    background: var(--unread-color);
    color: white;
    border-radius: 10px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Media Controls */
.media-controls {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.media-btn {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.media-btn:hover {
    background: var(--hover-color);
    border-color: var(--accent-primary);
}

.media-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.media-btn.active:hover {
    background: #0056b3;
}

.media-btn i {
    width: 16px;
    text-align: center;
}

/* Active Streams */
.active-streams {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.active-streams h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.streams-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stream-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stream-item:hover {
    background: var(--hover-color);
    border-color: var(--accent-primary);
}

.stream-user {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stream-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.no-streams {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem;
    font-style: italic;
}

/* Online Users */
.online-users-section {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.online-users-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-item {
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-item:hover {
    background: var(--hover-color);
    border-color: var(--border-color);
}

.user-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.user-item .user-info {
    flex: 1;
}

.user-item .user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-item .user-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Current user styling in online users list */
.user-item.current-user {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0056b3 100%);
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.user-item.current-user:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.user-item.current-user .user-name {
    color: white;
    font-weight: 600;
}

.user-item.current-user .user-status {
    color: rgba(255, 255, 255, 0.8);
}

.room-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Media Display Area */
.media-display {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    min-height: 200px;
    max-height: 40vh;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    height: 100%;
}

.media-stream {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.media-stream video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-stream .stream-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 1rem 0.75rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.media-controls-overlay {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.media-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.media-control-btn.active {
    background: var(--accent-primary);
}

.media-control-btn.danger {
    background: #dc3545;
}

.media-control-btn.danger:hover {
    background: #c82333;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.chat-header {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.chat-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-input);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.mobile-toggle {
    display: none;
}

/* Messages Container */
.messages-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.messages-list {
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-primary);
}

.messages-list::-webkit-scrollbar {
    width: 6px;
}

.messages-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.messages-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    position: relative;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: default;
    transition: all 0.2s ease;
}

.message-author.moddable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.message-author.moddable:hover {
    background: var(--bg-secondary);
    color: var(--accent-secondary);
}

.message-author.moddable:active {
    transform: scale(0.95);
}

.mod-indicator {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.message-author.moddable:hover .mod-indicator {
    opacity: 1;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-bubble::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.message-text {
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Own messages (right side) */
.message.own {
    flex-direction: row-reverse;
}

.message.own .message-content {
    text-align: right;
}

.message.own .message-bubble {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.message.own .message-bubble::before {
    right: -8px;
    border-right-color: var(--bg-secondary);
}

.message.own .message-text {
    color: var(--text-secondary);
}

/* Received messages (left side) */
.message:not(.own) .message-bubble::before {
    left: -8px;
    border-right-color: var(--bg-secondary);
}

.message:not(.own) .message-bubble {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Hover effects */
.message-bubble:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Message animations */
.message {
    animation: fadeIn 0.3s ease;
    transition: all 0.2s ease;
}

.message:hover {
    transform: translateY(-1px);
}

.message.own:hover {
    transform: translateY(-1px);
}

/* Message bubble animations */
.message-bubble {
    animation: slideIn 0.3s ease;
}

.message.own .message-bubble {
    animation: slideInRight 0.3s ease;
}

.message:not(.own) .message-bubble {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.scroll-to-bottom {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.scroll-to-bottom:hover {
    transform: scale(1.1);
}

.scroll-to-bottom.show {
    display: flex;
}

/* Message Input Area */
.message-input-area {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.typing-indicator.show {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 0.2rem;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
}

.attachment-btn,
.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-btn {
    background: none;
    color: var(--text-muted);
}

.attachment-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.send-btn {
    background: var(--accent-primary);
    color: white;
}

.send-btn:hover {
    background: #0056b3;
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

#message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    padding: 0.5rem;
    font-family: inherit;
    line-height: 1.4;
}

#message-input:focus {
    outline: none;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.character-count {
    font-weight: 500;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    font-size: 0.9rem;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-success {
    border-left: 4px solid #28a745;
}

.toast.toast-error {
    border-left: 4px solid #dc3545;
}

.toast.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast.toast-info {
    border-left: 4px solid var(--accent-primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 10% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.setting-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-center {
        gap: 0.25rem;
    }
    
    .activity-stats {
        gap: 1rem;
    }
    
    .stat-item {
        font-size: 0.8rem;
    }
    
    .server-status {
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: flex !important;
    }

    .header-content {
        padding: 0;
        gap: 1rem;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .header-center {
        display: none;
    }

    .action-buttons {
        gap: 0.25rem;
    }

    .header-btn {
        width: 32px;
        height: 32px;
    }

    .user-details {
        display: none;
    }

    .stat-item {
        font-size: 0.8rem;
    }

    #main-content {
        width: 100%;
    }

    .chat-area {
        width: 100%;
    }

    .input-shortcuts {
        display: none;
    }
}

@media (max-width: 480px) {
    #header {
        padding: 0.5rem 1rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .user-avatar img {
        width: 32px;
        height: 32px;
    }

    .status-indicator {
        width: 10px;
        height: 10px;
    }

    .chat-header {
        padding: 0.75rem 1rem;
    }

    .message-input-area {
        padding: 0.75rem;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* Theme Variations */
body[data-theme="darker"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-input: #2a2a2a;
}

body[data-theme="black"] {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-input: #222222;
}

/* Enhanced Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    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 shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--accent-primary);
    }
    50% {
        box-shadow: 0 0 15px var(--accent-primary), 0 0 25px var(--accent-primary);
    }
}

.message {
    animation: fadeIn 0.3s ease;
    transition: all 0.2s ease;
}

.message:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0 -0.5rem 1rem -0.5rem;
}

.conversation-item {
    animation: slideIn 0.2s ease;
    transition: all 0.2s ease;
}

.new-chat-btn:active {
    animation: pulse 0.3s ease;
}

.send-btn:active {
    animation: pulse 0.2s ease;
}

.unread-indicator {
    animation: pulse 2s infinite;
}

/* Message Reactions */
.message-reactions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.reaction {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reaction:hover {
    background: var(--hover-color);
    transform: scale(1.05);
}

.reaction.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Message Actions */
.message:hover .message-actions {
    opacity: 1;
    visibility: visible;
}

.message-actions {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.message-action {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.message-action:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

/* Enhanced Message Content */
.message-content {
    position: relative;
}

.message-text {
    line-height: 1.5;
    word-wrap: break-word;
}

.message-text a {
    color: var(--accent-primary);
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-text code {
    background: var(--bg-tertiary);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.message-text pre {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.message-text .mention {
    background: rgba(0, 123, 255, 0.1);
    color: var(--accent-primary);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.message-text strong {
    font-weight: 700;
    color: var(--text-primary);
}

.message-text em {
    font-style: italic;
    color: var(--text-secondary);
}

/* User Status in Messages */
.message-author {
    position: relative;
}

.user-status-dot {
    position: absolute;
    top: 0;
    right: -8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--online-color);
}

/* Enhanced Typing Indicator */
.typing-indicator {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Message Timestamps */
.message-time {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message:hover .message-time {
    opacity: 1;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--accent-primary) !important;
}

.text-success {
    color: var(--accent-secondary) !important;
}

.text-danger {
    color: var(--unread-color) !important;
}

/* Login/Register Form Styles */
.auth-container {
  max-width: 400px;
  margin: 60px auto;
  background: #23272f;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
  padding: 2.5rem 2rem 2rem 2rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
}
.auth-container h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.auth-form label {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: #bfc9d1;
}
.auth-form input[type="text"],
.auth-form input[type="password"] {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  border: 1px solid #353b45;
  background: #181a20;
  color: #fff;
  font-size: 1rem;
  transition: border 0.2s;
}
.auth-form input:focus {
  border-color: #4f8cff;
  outline: none;
}
.auth-form .auth-btn {
  background: linear-gradient(90deg, #4f8cff 0%, #3358ff 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.8rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-form .auth-btn:hover {
  background: linear-gradient(90deg, #3358ff 0%, #4f8cff 100%);
}
.auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  color: #bfc9d1;
  font-size: 0.97rem;
}
.auth-footer a {
  color: #4f8cff;
  text-decoration: none;
  margin-left: 0.3rem;
}
.auth-footer a:hover {
  text-decoration: underline;
}
.auth-error {
  color: #ff4f4f;
  background: #2a1818;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.7rem;
  text-align: center;
  font-size: 0.98rem;
}

.auth-success {
  color: #28a745;
  background: #1a2e1a;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.7rem;
  text-align: center;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-success i {
  font-size: 1.1rem;
}

/* Input validation styling */
.auth-form input:invalid {
  border-color: #dc3545;
}

.auth-form input:valid {
  border-color: #28a745;
}

.auth-form small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #bfc9d1;
}

/* Read-only mode styling */
.read-only-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.prompt-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.prompt-content i {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.prompt-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.prompt-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.prompt-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.prompt-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.prompt-buttons .btn-primary {
    background: var(--accent-primary);
    color: white;
}

.prompt-buttons .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.prompt-buttons .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.prompt-buttons .btn-secondary:hover {
    background: var(--hover-color);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Moderation Menu */
.mod-menu {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    min-width: 180px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.mod-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.mod-menu-item:hover {
    background: var(--bg-secondary);
}

.mod-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

/* Button styles for modals */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 