:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
}

.glass-container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.controls {
    display: block;
    width: 100%;
}

.actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn.primary { background: var(--primary); }
.btn.success { background: var(--success); }
.btn.warning { background: var(--warning); }
.btn.danger { background: var(--danger); }
.btn.full-width { width: 100%; margin-top: 1rem; }

.upload-section {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="file"] {
    color: var(--text-muted);
}

.logs-container {
    height: 300px;
    overflow-y: auto;
    background: #000;
    padding: 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
}

.log-item { margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid #222; }
.log-info { color: var(--text-main); }
.log-success { color: var(--success); }
.log-warning { color: #f59e0b; }
.log-error { color: #ef4444; }

/* Tabs Navigation */
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1rem; }
.tabs { display: flex; gap: 1rem; }
.tab-btn { background: transparent; border: none; color: #94a3b8; font-size: 1.1rem; padding: 0.5rem 1rem; cursor: pointer; transition: 0.3s; border-bottom: 2px solid transparent; }
.tab-btn:hover { color: white; }
.tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; }

/* Inbox Layout */
.inbox-container { display: flex; height: 75vh; background: rgba(30, 41, 59, 0.5); border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); overflow: hidden; }
.inbox-sidebar { width: 300px; border-left: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; background: rgba(15, 23, 42, 0.8); }
.search-box { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.search-box input { width: 100%; padding: 0.8rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: white; outline: none; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: 0.2s; }
.chat-item:hover { background: rgba(255,255,255,0.05); }
.chat-item.active { background: rgba(59, 130, 246, 0.2); border-right: 4px solid #3b82f6; }
.chat-phone { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.3rem; }
.chat-preview { color: #94a3b8; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.inbox-main { flex: 1; display: flex; flex-direction: column; background: #0f172a; }
.chat-header { padding: 1rem 1.5rem; background: rgba(30, 41, 59, 0.8); border-bottom: 1px solid rgba(255,255,255,0.1); }
.chat-history { flex: 1; padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.msg-bubble { max-width: 70%; padding: 0.8rem 1.2rem; border-radius: 12px; line-height: 1.4; position: relative; }
.msg-bubble.sent { background: #3b82f6; color: white; align-self: flex-start; border-top-right-radius: 2px; }
.msg-bubble.received { background: #334155; color: white; align-self: flex-end; border-top-left-radius: 2px; }
.msg-time { font-size: 0.7rem; color: rgba(255,255,255,0.6); margin-top: 0.5rem; text-align: left; }
.msg-sender-tag { position: absolute; top: -18px; right: 0; font-size: 0.7rem; color: #94a3b8; background: #1e293b; padding: 2px 6px; border-radius: 4px; }

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.session-card {
    text-align: center;
}

.session-status {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.status-qr { background: var(--warning); color: #000; }
.status-ready { background: var(--success); }
.status-disconnected { background: var(--danger); }
.status-initializing { background: var(--primary); }

.qr-box img {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    background: white;
    padding: 10px;
    margin: 0 auto;
    display: block;
}
