/* ===============================================
   MOLTSSENGER - Red Crab Messenger Theme
   =============================================== */

:root {
    /* Red Theme Colors - Inspired by the Moltssenger Crab */
    --primary: #DC2626;
    --primary-light: #EF4444;
    --primary-dark: #B91C1C;
    --primary-gradient: linear-gradient(135deg, #DC2626 0%, #EF4444 50%, #F87171 100%);
    --primary-gradient-hover: linear-gradient(135deg, #B91C1C 0%, #DC2626 50%, #EF4444 100%);
    
    /* Secondary Colors */
    --secondary: #F59E0B;
    --secondary-light: #FBBF24;
    --secondary-dark: #D97706;
    
    /* Twitter/X Black */
    --twitter-blue: #000000;
    --twitter-dark: #1a1a1a;
    
    /* Neutral Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FEF2F2;
    --bg-tertiary: #FEE2E2;
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A6A;
    --text-muted: #8888A0;
    --border-color: #FECACA;
    
    /* Status Colors */
    --online: #22C55E;
    --away: #F59E0B;
    --busy: #EF4444;
    --offline: #9E9E9E;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(220, 38, 38, 0.1);
    --shadow-md: 0 4px 16px rgba(220, 38, 38, 0.15);
    --shadow-lg: 0 8px 32px rgba(220, 38, 38, 0.2);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    
    /* Sizes */
    --sidebar-width: 320px;
    --header-height: 70px;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-primary: #1A1A2E;
    --bg-secondary: #2D1F1F;
    --bg-tertiary: #3D2929;
    --text-primary: #FFFFFF;
    --text-secondary: #D4B8B8;
    --text-muted: #A07878;
    --border-color: #4A3333;
}

/* ===============================================
   BASE STYLES
   =============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===============================================
   SOCIAL FLOAT BUTTON
   =============================================== */

.social-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #000000;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transition: all 0.3s ease;
}

.social-float:hover {
    transform: scale(1.1) rotate(-5deg);
    background: #1a1a1a;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.social-float i {
    transition: transform 0.3s ease;
}

.social-float:hover i {
    transform: scale(1.1);
}

/* Hide on mobile when keyboard might be open */
@media (max-height: 500px) {
    .social-float {
        display: none;
    }
}

/* Adjust position when toast is visible */
.toast:not(.hidden) ~ .social-float {
    bottom: 100px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* ===============================================
   LOGIN SCREEN
   =============================================== */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-container {
    background: var(--bg-primary);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

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

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

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(220, 38, 38, 0.3));
    animation: float 3s ease-in-out infinite;
}

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

.app-title {
    font-size: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===============================================
   WALLET CONNECTION STYLES
   =============================================== */

.wallet-section {
    text-align: center;
    margin-bottom: 24px;
}

.wallet-section h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.wallet-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-wallet {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-wallet:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-phantom:hover {
    border-color: #AB9FF2;
    background: rgba(171, 159, 242, 0.1);
}

.wallet-icon {
    width: 32px;
    height: 32px;
}

.wallet-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    color: var(--text-muted);
    font-size: 14px;
}

.demo-section {
    text-align: center;
}

.btn-demo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--primary);
    border-radius: 12px;
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-demo:hover {
    background: var(--primary);
    color: white;
}

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

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
}

.input-group input:focus + i,
.input-group:focus-within i {
    color: var(--primary);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-login {
    margin-top: 8px;
}

.social-login {
    text-align: center;
    margin-top: 24px;
}

.social-login p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 80px;
    height: 1px;
    background: var(--border-color);
}

.social-login p::before { left: 0; }
.social-login p::after { right: 0; }

.social-buttons {
    display: flex;
    gap: 12px;
}

.btn-social {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.btn-social:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.btn-twitter {
    color: var(--twitter-blue);
}

.btn-twitter:hover {
    background: var(--twitter-blue);
    color: white;
    border-color: var(--twitter-blue);
}

.signup-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.signup-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.signup-link a:hover {
    text-decoration: underline;
}

.language-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===============================================
   MAIN APP LAYOUT
   =============================================== */

.main-app {
    display: flex;
    height: 100vh;
    background: var(--bg-secondary);
}

/* ===============================================
   SIDEBAR
   =============================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 40px;
    height: auto;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    margin: 12px;
    border-radius: 16px;
}

.user-avatar {
    position: relative;
    width: 50px;
    height: 50px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
}

.status-indicator.online { background: var(--online); }
.status-indicator.away { background: var(--away); }
.status-indicator.busy { background: var(--busy); }
.status-indicator.offline { background: var(--offline); }

.user-info {
    flex: 1;
}

.user-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.nickname-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-edit-nickname {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 11px;
    opacity: 0;
    transition: var(--transition-fast);
}

.user-profile:hover .btn-edit-nickname {
    opacity: 1;
}

.btn-edit-nickname:hover {
    color: var(--primary);
}

.wallet-address {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
}

.status-select {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
}

/* Edit Nickname Box */
.edit-nickname-box {
    display: flex;
    gap: 8px;
    padding: 12px;
    margin: 0 12px 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.edit-nickname-box input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.edit-nickname-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.nickname-actions {
    display: flex;
    gap: 4px;
}

.btn-save-nickname,
.btn-cancel-nickname {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-save-nickname {
    background: var(--primary);
    color: white;
}

.btn-save-nickname:hover {
    background: var(--primary-dark);
}

.btn-cancel-nickname {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.btn-cancel-nickname:hover {
    background: var(--border-color);
}

/* Online Users Mini */
.online-users-mini {
    padding: 12px;
    flex: 1;
    overflow: hidden;
}

.online-users-mini h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.users-list-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 200px;
}

.user-mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-mini-item:hover {
    background: var(--bg-secondary);
}

.user-mini-avatar {
    position: relative;
    width: 32px;
    height: 32px;
}

.user-mini-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.user-mini-avatar .status-indicator {
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.user-mini-name {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Network Info */
.network-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.network-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--online);
}

/* Network Badge */
.network-badge {
    padding: 4px 12px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.search-box {
    margin: 0 12px 12px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
}

.sidebar-nav {
    display: flex;
    gap: 4px;
    padding: 0 12px 12px;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 12px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
    position: relative;
}

.nav-btn i {
    font-size: 18px;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: white;
}

.nav-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

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

.contact-item.active {
    background: var(--primary-gradient);
    color: white;
}

.contact-item.active .contact-status,
.contact-item.active .contact-time {
    color: rgba(255,255,255,0.8);
}

.contact-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.contact-avatar .status-indicator {
    border-color: var(--bg-primary);
}

.contact-item.active .contact-avatar .status-indicator {
    border-color: rgba(255,255,255,0.3);
}

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

.contact-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.contact-status {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-meta {
    text-align: right;
}

.contact-time {
    font-size: 11px;
    color: var(--text-muted);
}

.contact-unread {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

/* ===============================================
   MAIN CONTENT
   =============================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

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

.content-section.active {
    display: flex;
}

/* ===============================================
   CHAT SECTION
   =============================================== */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    margin: 12px;
    margin-left: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-header {
    padding: 20px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-room-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.online-count {
    font-size: 12px;
    color: var(--text-muted);
}

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

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.chat-user-info h3 {
    font-size: 16px;
    font-weight: 600;
}

.typing-indicator {
    font-size: 12px;
    color: var(--primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}

.welcome-logo {
    width: 120px;
    margin-bottom: 24px;
    opacity: 0.7;
}

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

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

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

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

.message.sent .message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 8px;
}

.message.sent .message-time {
    text-align: right;
}

.chat-input-area {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.input-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.message-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.message-input-wrapper input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.message-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-send {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition-normal);
}

.btn-send:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* ===============================================
   CONTACTS SECTION
   =============================================== */

.section-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    margin: 12px;
    margin-left: 0;
    border-radius: 16px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-add-contact {
    padding: 12px 20px;
    font-size: 14px;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 0 24px 24px 0;
    overflow-y: auto;
}

.contact-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.contact-card .contact-avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.contact-card .contact-avatar img {
    border: 3px solid var(--primary);
}

.contact-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

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

.contact-card-actions button {
    padding: 8px 16px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.contact-card-actions button:hover {
    background: var(--primary);
    color: white;
}

.contact-card-actions button.primary {
    background: var(--primary);
    color: white;
}

.contact-card-actions button.primary:hover {
    background: var(--primary-dark);
}

/* ===============================================
   USERS GRID
   =============================================== */

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 0 24px 24px 0;
    overflow-y: auto;
}

.user-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.user-card.is-you {
    border: 2px solid var(--primary);
}

.user-card .you-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
}

.user-card-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--primary);
}

.user-card-avatar .status-indicator {
    width: 16px;
    height: 16px;
    border-width: 3px;
    bottom: 2px;
    right: 2px;
}

.user-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-card .user-wallet {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    margin-bottom: 8px;
}

.user-card .user-status-text {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
}

/* ===============================================
   PROFILE SETTINGS
   =============================================== */

.profile-edit {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary);
}

.profile-details {
    flex: 1;
}

.setting-input-group {
    display: flex;
    gap: 8px;
}

.setting-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.setting-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-save-setting {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-save-setting:hover {
    background: var(--primary-dark);
}

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

.wallet-display code {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-copy {
    width: 42px;
    height: 42px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-copy:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.about-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* Chat button on user cards */
.btn-chat-user {
    margin-top: 12px;
    padding: 8px 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-chat-user:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Status badge */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
}

.status-badge.demo {
    background: rgba(220, 38, 38, 0.2);
    color: #DC2626;
}

/* Full width empty state */
.empty-state.full-width {
    grid-column: 1 / -1;
}

/* Private chat header */
.chat-room-icon.private {
    background: var(--secondary);
}

/* User filter */
.user-filter {
    flex: 1;
    max-width: 300px;
}

.user-filter input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.user-filter input:focus {
    outline: none;
    border-color: var(--primary);
}

/* GIF styles */
.gif-picker {
    position: fixed;
    bottom: 100px;
    left: 360px;
    width: 350px;
    max-height: 400px;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.gif-search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.gif-search input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.gif-search input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.gif-grid img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.gif-grid img:hover {
    transform: scale(1.05);
}

/* GIF in chat */
.message-bubble.gif-message {
    padding: 4px;
    background: transparent !important;
}

.chat-gif {
    max-width: 200px;
    max-height: 150px;
    border-radius: 12px;
}

/* Notification prompt */
.notification-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.notification-content {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}

.notification-content i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.notification-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.notification-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.notification-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.notification-buttons .btn-primary {
    padding: 12px 24px;
    font-size: 14px;
}

.notification-buttons .btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.notification-buttons .btn-secondary:hover {
    background: var(--border-color);
}

/* Emoji categories */
.emoji-categories {
    display: flex;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    gap: 4px;
}

.emoji-cat {
    padding: 8px 12px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.emoji-cat:hover {
    background: var(--bg-secondary);
}

.emoji-cat.active {
    background: var(--primary);
}

/* Improved emoji picker */
.emoji-picker {
    position: fixed;
    bottom: 100px;
    left: 360px;
    width: 320px;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

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

.emoji-grid span {
    font-size: 22px;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
}

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

/* ===============================================
   SETTINGS SECTION
   =============================================== */

.settings-container {
    padding: 0 24px 24px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-group {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
}

.settings-group h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.language-options {
    display: flex;
    gap: 12px;
}

.lang-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.lang-option:hover {
    border-color: var(--primary);
}

.lang-option.active {
    border-color: var(--primary);
    background: var(--primary-gradient);
    color: white;
}

.lang-flag {
    font-size: 24px;
}

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

.setting-item:last-child {
    border-bottom: none;
}

.setting-item.clickable {
    cursor: pointer;
    transition: var(--transition-fast);
    margin: 0 -16px;
    padding: 16px;
    border-radius: 8px;
    border-bottom: none;
}

.setting-item.clickable:hover {
    background: var(--bg-secondary);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition-fast);
    border-radius: 28px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

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

.about-info {
    text-align: center;
    padding: 20px 0;
}

.about-logo {
    width: 80px;
    margin-bottom: 16px;
}

.about-info p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.copyright {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: #DC2626;
    color: white;
}

/* ===============================================
   TOAST NOTIFICATION
   =============================================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-content i {
    color: var(--online);
    font-size: 20px;
}

/* ===============================================
   EMOJI PICKER
   =============================================== */

.emoji-picker {
    position: fixed;
    bottom: 120px;
    left: calc(var(--sidebar-width) + 40px);
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

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

.emoji-grid span {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    text-align: center;
}

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

/* ===============================================
   SCROLLBAR STYLES
   =============================================== */

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
    .main-app {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
    
    .main-content {
        flex: 1;
    }
    
    .chat-container {
        margin: 8px;
        border-radius: 16px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
        padding: 0 12px 12px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .sidebar-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .nav-btn {
        min-width: 60px;
    }
}

/* ===============================================
   LOADING OVERLAY
   =============================================== */

.loading-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: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content p {
    font-size: 16px;
    font-weight: 500;
}

/* ===============================================
   GLOBAL CHAT MESSAGE STYLES
   =============================================== */

.message-with-sender {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.message-with-sender.sent {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-with-sender.received {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.message-with-sender.sent .message-sender {
    text-align: right;
    color: var(--text-muted);
}

.message-wallet {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

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

.message-with-sender.sent .message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-with-sender.received .message-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.message-with-sender.sent .message-meta {
    justify-content: flex-end;
}

/* System Messages */
.system-message {
    text-align: center;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.system-message span {
    background: var(--bg-tertiary);
    padding: 6px 16px;
    border-radius: 20px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}
