/* ==================== VARIABLES - LIGHT THEME ==================== */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --secondary-color: #64748b;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --online-color: #22c55e;
    --message-sent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --message-received: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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 70%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, 30px) rotate(180deg); }
}

.login-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

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

.login-header i {
    font-size: 56px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    display: inline-block;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.login-form input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input::placeholder {
    color: var(--text-muted);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    margin-top: 20px;
    padding: 14px 18px;
    background: #fef2f2;
    color: var(--danger-color);
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    border: 1px solid #fecaca;
}

.error-message:empty {
    display: none;
}

/* ==================== CHAT APP LAYOUT ==================== */
.chat-app {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-primary);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 380px;
    min-width: 380px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: var(--shadow);
}

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

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

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 2px solid var(--border-color);
}

.user-details {
    display: flex;
    flex-direction: column;
}

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

.user-role {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

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

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

/* Search Box */
.search-box {
    padding: 16px 20px;
    position: relative;
}

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

.search-box input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Tabs */
.tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

.tab {
    flex: 1;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.badge {
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

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

/* Conversations & Users Lists */
.conversations-list,
.users-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item,
.user-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    gap: 14px;
    border-radius: var(--radius);
    margin-bottom: 4px;
}

.conversation-item:hover,
.user-item:hover {
    background: var(--bg-tertiary);
}

.conversation-item.active {
    background: var(--primary-light);
}

.conversation-item.unread {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-left: 3px solid var(--primary-color);
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--online-color);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.conversation-info,
.user-item-info {
    flex: 1;
    min-width: 0;
}

.conversation-name,
.user-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: var(--danger-color);
}

.role-badge.seller {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--success-color);
}

.role-badge.buyer {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: var(--primary-color);
}

.conversation-preview,
.user-item-email {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.unread-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

/* Online Section */
.online-section {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    max-height: 160px;
}

.online-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-dot {
    color: var(--online-color);
    font-size: 10px;
    animation: pulse 2s ease-in-out infinite;
}

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

.online-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    max-height: 90px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: white;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.online-user:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.online-user img {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
}

.online-user span {
    font-size: 13px;
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

/* ==================== CHAT MAIN ==================== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

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

.empty-state i {
    font-size: 100px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.empty-state p {
    color: var(--text-secondary);
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.chat-partner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.partner-avatar-wrapper {
    position: relative;
}

.partner-avatar-wrapper .avatar {
    width: 48px;
    height: 48px;
}

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

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

.partner-status {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.partner-status.online {
    color: var(--online-color);
}

.partner-status.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--online-color);
    border-radius: var(--radius-full);
    display: inline-block;
}

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

/* Messages Area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #f1f5f9 100%);
}

.messages-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Message Styles */
.message {
    display: flex;
    gap: 10px;
    max-width: 70%;
    animation: fadeIn 0.3s ease;
}

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

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

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

.message .avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    align-self: flex-end;
}

.message.sent .avatar {
    display: none;
}

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

.message-bubble {
    padding: 12px 18px;
    border-radius: var(--radius-xl);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

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

.message.received .message-bubble {
    background: var(--message-received);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-color);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 6px;
}

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

.message-status i {
    font-size: 12px;
}

.message-status.read {
    color: var(--primary-color);
}

/* Message with attachments */
.message-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.attachment-item {
    border-radius: var(--radius);
    overflow: hidden;
}

.attachment-item.image img {
    max-width: 280px;
    max-height: 320px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius);
}

.attachment-item.image img:hover {
    opacity: 0.9;
    transform: scale(1.01);
}

.attachment-item.file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.attachment-item.file i {
    font-size: 28px;
    color: var(--primary-color);
}

.attachment-item.file .file-info {
    flex: 1;
}

.attachment-item.file .file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.attachment-item.file a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* System Message */
.message.system {
    align-self: center;
    max-width: 100%;
}

.message.system .message-bubble {
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 20px;
    box-shadow: none;
}

/* Date Separator */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.date-separator span {
    background: white;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Message Input Area */
.message-input-area {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

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

.input-container {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.input-container:focus-within {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-container textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px 0;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
}

.input-container textarea::placeholder {
    color: var(--text-muted);
}

.input-container textarea:focus {
    outline: none;
}

.input-container .btn-icon {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
}

.input-container .btn-icon:hover {
    color: var(--primary-color);
}

.btn-send {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    font-size: 18px;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-send:active {
    transform: scale(0.98);
}

.btn-send:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: var(--text-muted);
}

/* Attachments Preview */
.attachments-preview {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.attachment-preview-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
}

.attachment-preview-item img {
    width: 88px;
    height: 88px;
    object-fit: cover;
}

.attachment-preview-item .file-preview {
    width: 88px;
    height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.attachment-preview-item .file-preview i {
    font-size: 28px;
    color: var(--primary-color);
}

.attachment-preview-item .file-preview span {
    font-size: 10px;
    text-align: center;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    color: var(--text-secondary);
}

.attachment-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.attachment-preview-item .remove-btn:hover {
    background: #dc2626;
}

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    border: none;
    background: white;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

/* ==================== TOAST ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1001;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    border: 1px solid var(--border-color);
}

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

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.info { border-left: 4px solid var(--primary-color); }

.toast i {
    font-size: 22px;
}

.toast.success i { color: var(--success-color); }
.toast.error i { color: var(--danger-color); }
.toast.info i { color: var(--primary-color); }

.toast-content {
    flex: 1;
}

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

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

.loading i {
    color: var(--primary-color);
}

/* ==================== SCROLLBAR ==================== */
::-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(--text-muted);
}

/* ==================== MOBILE RESPONSIVE ==================== */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        min-width: 100%;
        z-index: 100;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.hidden-mobile {
        transform: translateX(-100%);
    }

    .chat-main {
        width: 100%;
    }

    .mobile-only {
        display: flex;
    }

    .message {
        max-width: 85%;
    }

    .chat-header {
        padding: 14px 16px;
    }

    .messages-area {
        padding: 16px;
    }

    .message-input-area {
        padding: 14px 16px;
    }

    .online-section {
        display: none;
    }

    .login-container {
        margin: 16px;
        padding: 32px 24px;
    }
}

/* ==================== UTILITIES ==================== */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== EMBEDDED MODE ==================== */
body.embedded-mode .sidebar-header {
    padding: 12px 16px;
}

body.embedded-mode #btnLogout {
    display: none;
}

body.embedded-mode .online-section {
    display: none;
}

body.embedded-mode .login-screen {
    display: none !important;
}

/* ==================== ANIMATIONS ==================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

/* ==================== HOVER EFFECTS ==================== */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==================== NOTIFICATION DOT ==================== */
.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}
