@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --bg-base: #030305;
    --glass-bg: rgba(20, 20, 28, 0.45);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --primary-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #cbd5e1;
    
    --bubble-incoming: rgba(30, 30, 40, 0.6);
    --online-color: #10b981;
    --online-glow: rgba(16, 185, 129, 0.4);
    
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    
    --shadow-glass: 0 30px 60px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ---------------- Auth Pages ---------------- */
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    position: relative;
    z-index: 10;
}
.auth-box {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    padding: 3.5rem 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    text-align: center;
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-box h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.auth-box p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 400;
    font-size: 0.95rem;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.auth-form input {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.auth-form input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}
.auth-form input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1), inset 0 2px 4px rgba(0,0,0,0.2);
}
.auth-form button {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px -6px rgba(168, 85, 247, 0.5);
    margin-top: 0.5rem;
}
.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(168, 85, 247, 0.7);
    filter: brightness(1.1);
}
.auth-form button:active {
    transform: translateY(0);
}
.auth-links {
    margin-top: 2.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-links a {
    color: #d8b4fe;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}
.auth-links a:hover {
    color: #f3e8ff;
    border-bottom-color: #f3e8ff;
}
.error-msg {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(4px);
}

/* ---------------- Chat Layout ---------------- */
.app-container {
    display: flex;
    width: 96%;
    max-width: 1400px;
    height: 92vh;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

/* Global Corner Setting Button */
.global-profile-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 100;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}
.global-profile-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(30deg) scale(1.05);
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: 340px;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 5;
}
.sidebar-header {
    padding: 1.75rem 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.search-box-container {
    width: 100%;
    position: relative;
}
.search-box-container::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.5;
    pointer-events: none;
}
.search-box-container input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.search-box-container input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}
.search-box-container input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1), inset 0 2px 4px rgba(0,0,0,0.1);
}

.user-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 0.75rem;
}
.user-list li {
    padding: 1rem 1.25rem;
    margin-bottom: 0.35rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-dark);
    font-weight: 500;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.user-list li:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
    color: var(--text-main);
}
.user-list li.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border-color: rgba(168, 85, 247, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}


.online-dot {
    width: 10px;
    height: 10px;
    background-color: var(--online-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--online-glow);
    margin-left: auto;
    animation: pulse 2.5s infinite;
    border: 2px solid var(--bg-base);
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.03);
    background: rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.logged-in-user {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logged-in-user strong {
    color: #f8fafc;
    font-weight: 600;
}
.logout-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}
.logout-link:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* ---------------- Main Chat Area ---------------- */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
    min-width: 0;
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}
.header-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
#chat-title {
    font-size: 1.35rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.3px;
    margin-bottom: 0.15rem;
}
.status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.status.connected {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.status.disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
}
.empty-state::before {
    content: '💬';
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
    filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.3));
    animation: float 6s ease-in-out infinite;
}
.empty-state p {
    font-size: 1.1rem;
    font-weight: 400;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
    min-width: 0;
}

/* ---------------- Message Bubbles ---------------- */
.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: messageSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(15px);
}
.message-wrapper.incoming {
    align-self: flex-start;
}
.message-wrapper.outgoing {
    align-self: flex-end;
    align-items: flex-end;
}
.sender-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    padding: 0 0.25rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.message-avatar {
    display: none;
}
.message {
    padding: 1rem 1.35rem;
    line-height: 1.6;
    font-size: 0.85rem; /* Decreased font size on user request */
    word-break: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}
.incoming .message {
    background: var(--bubble-incoming);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px 20px 20px 4px;
    color: var(--text-main);
    backdrop-filter: blur(10px);
}
.outgoing .message {
    background: var(--primary-gradient);
    border-radius: 20px 20px 4px 20px;
    color: white;
    box-shadow: 0 8px 20px -6px rgba(168, 85, 247, 0.4);
}
.message-image {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.message-image:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}
.message-system {
    align-self: center;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.06);
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-out;
}
/* Meta Data & Read Receipts */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 0px;
    font-size: 0.65rem;
    opacity: 0.75;
}
.outgoing .message-meta {
    color: rgba(255, 255, 255, 0.9);
}
.incoming .message-meta {
    color: var(--text-muted);
}
.receipt {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: -2px;
    margin-right: 2px;
}
.receipt.seen {
    color: #38bdf8;
    text-shadow: 0 0 5px rgba(56, 189, 248, 0.4);
}
.msg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    opacity: 0.8;
}
.msg-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}
.msg-actions button:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}
.message-wrapper.is-edited .message::after {
    content: " (edited)";
    font-size: 0.75rem;
    opacity: 0.6;
    font-style: italic;
    margin-left: 5px;
}

/* ---------------- Chat Input ---------------- */
.chat-input-area {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    display: none;
    gap: 1rem;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.image-upload-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-muted);
    flex-shrink: 0;
}
.image-upload-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: rotate(10deg) scale(1.05);
    border-color: rgba(255, 255, 255, 0.15);
}
#message-input {
    flex: 1;
    min-width: 0;
    padding: 1.1rem 1.5rem;
    border-radius: 28px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
#message-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}
#message-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1), inset 0 2px 5px rgba(0,0,0,0.1);
}
#send-btn {
    padding: 1.1rem 2rem;
    border-radius: 28px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 20px -6px rgba(168, 85, 247, 0.5);
    flex-shrink: 0;
}
#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -6px rgba(168, 85, 247, 0.7);
    filter: brightness(1.1);
}
#send-btn:active {
    transform: translateY(0);
}

/* ---------------- Animations ---------------- */
@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes messageSlideUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--online-glow); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

#back-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
#back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-2px);
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}
.modal-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: messageSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-box h2 {
    color: #ef4444;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}
.modal-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.modal-box input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.modal-box input:focus {
    outline: none;
    border-color: #ef4444;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
.modal-actions {
    display: flex;
    gap: 1rem;
}
.modal-actions button {
    flex: 1;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border) !important;
}
.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.danger-btn {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}
.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ---------------- Mobile Responsive ---------------- */
@media (max-width: 800px) {
    html, body {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        margin: 0;
        padding: 0;
        overflow: hidden;
        display: block;
    }
    .app-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        max-width: none;
        position: absolute;
        top: 0;
        left: 0;
    }
    .sidebar {
        width: 100%;
        position: absolute;
        height: 100%;
        z-index: 20;
        background: var(--bg-base);
        border-right: none;
    }
    body.chat-active .sidebar {
        transform: translateX(-100%);
    }
    .mobile-only {
        display: flex !important;
    }
    .message-wrapper {
        max-width: 88%;
    }
    .chat-header {
        padding: 1rem 1.25rem;
    }
    .header-info {
        gap: 0.75rem;
    }
    #chat-title {
        font-size: 1.15rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 180px;
    }
    .status {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .message-image {
        max-height: 200px;
    }
    .chat-messages {
        padding: 1.25rem 1rem;
    }
    .chat-input-area {
        padding: 1rem 0.75rem;
        gap: 0.5rem;
    }
    #message-input {
        padding: 0.85rem 1rem;
    }
    #send-btn {
        padding: 0.85rem 1.25rem;
    }
    .image-upload-btn {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
}

@media (max-width: 800px) { .global-profile-btn { top: 1rem; right: 1.25rem; width: 38px; height: 38px; font-size: 1.1rem; } }

@media (max-width: 800px) { .global-profile-btn { display: flex !important; } .sidebar-footer { display: none !important; } }

.unread-badge { background: #ef4444; color: white; border-radius: 12px; padding: 2px 6px; font-size: 0.7rem; font-weight: 700; min-width: 20px; text-align: center; box-shadow: 0 2px 5px rgba(239,68,68,0.4); display: none; }

.date-divider-wrapper { display: flex; justify-content: center; width: 100%; margin: 20px 0; }
.date-divider { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); padding: 5px 14px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.2); z-index: 10; }
