/* style.css - Blu Office Pro Theme v2.0 */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@200;300;400;500;600;700;800&display=swap');

:root {
    /* رنگ‌بندی اصلی */
    --bg-main: #04060f;         /* پس‌زمینه اصلی تیره */
    --surface: #0f1016;         /* سطح لایه‌ها */
    --surface-light: #1a1b26;   /* سطح روشن‌تر برای اینپوت‌ها */
    --border: rgba(255, 255, 255, 0.08);
    
    /* رنگ‌های برند */
    --primary: #3b82f6;         /* آبی بلو */
    --primary-glow: rgba(59, 130, 246, 0.4);
    --accent: #8b5cf6;          /* بنفش */
    --success: #10b981;         /* سبز موفقیت */
    
    /* متن */
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    
    /* حباب‌های پیام */
    --msg-own: linear-gradient(135deg, #2563eb, #1d4ed8);
    --msg-other: #1e293b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Vazirmatn', sans-serif; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 10%, rgba(59,130,246,0.1) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(139,92,246,0.1) 0px, transparent 50%);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    direction: rtl;
}

/* ================== Login Screen ================== */
#login-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(4, 6, 15, 0.95);
    backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center;
}

.login-card {
    background: #11131b; border: 1px solid var(--border);
    padding: 40px; border-radius: 30px; text-align: center; width: 90%; max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: floatUp 0.6s ease-out;
}

@keyframes floatUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes shake { 0%, 100% {transform: translateX(0);} 25% {transform: translateX(-5px);} 75% {transform: translateX(5px);} }

.login-btn {
    width: 100%; padding: 16px; margin-top: 12px;
    background: #1a1d26; color: var(--text);
    border: 1px solid var(--border); border-radius: 16px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center; gap: 12px;
}

.login-btn:hover {
    background: var(--primary); border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-glow); transform: translateY(-3px);
    color: white;
}

/* ================== Main Layout ================== */
.app-container {
    width: 100%; height: 100%; max-width: 1920px;
    display: flex; gap: 1px; background: var(--border); /* خطوط جداکننده پنل‌ها */
}

/* --- Sidebars --- */
.sidebar {
    width: 320px; background: rgba(10, 12, 18, 0.95);
    display: flex; flex-direction: column;
    backdrop-filter: blur(20px); z-index: 10; transition: 0.3s;
}

.sidebar-header {
    padding: 25px; text-align: center; border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.01);
}

.avatar {
    width: 90px; height: 90px; margin: 0 auto 15px;
    border-radius: 50%; background: #1a1d26;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; position: relative;
    border: 2px solid var(--border); transition: 0.3s;
    cursor: default;
}
.avatar.active-pulse { 
    border-color: var(--success); 
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); 
}

.user-title { font-size: 18px; font-weight: 800; margin-bottom: 5px; }
.user-status { font-size: 13px; color: var(--primary); font-weight: 500; background: rgba(59,130,246,0.1); padding: 2px 10px; border-radius: 20px; display: inline-block; }

/* --- Status List --- */
.status-list { padding: 20px; overflow-y: auto; display: grid; gap: 10px; align-content: start; flex: 1; }

.status-card {
    background: #151821; padding: 12px; border-radius: 14px;
    border: 1px solid transparent; cursor: pointer;
    display: flex; align-items: center; gap: 15px;
    transition: all 0.2s;
}

.status-card:hover { background: #1e2230; transform: translateX(-3px); border-color: rgba(255,255,255,0.05); }
.status-card.active {
    background: rgba(59, 130, 246, 0.1); border-color: var(--primary);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}
.status-card.active .status-emoji { transform: scale(1.2) rotate(10deg); }

.status-emoji { font-size: 24px; transition: 0.3s; width: 35px; text-align: center; }
.status-info { display: flex; flex-direction: column; }
.status-label { font-size: 14px; font-weight: 600; }
.status-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ================== Main Chat Area ================== */
.main-chat {
    flex: 1; background: var(--bg-main);
    display: flex; flex-direction: column;
    position: relative;
}

/* --- Chat Header --- */
.chat-topbar {
    height: 75px; padding: 0 30px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(10, 12, 18, 0.8); backdrop-filter: blur(10px);
}

.online-badge { 
    width: 8px; height: 8px; background: var(--success); border-radius: 50%; 
    box-shadow: 0 0 10px var(--success); display: inline-block; 
}

/* --- Messages Area --- */
.messages-wrapper {
    flex: 1; padding: 20px 8%; overflow-y: auto;
    display: flex; flex-direction: column; gap: 15px;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 30px 30px; /* پترن نقطه‌ای پس‌زمینه */
}

.msg-row { display: flex; width: 100%; margin-bottom: 5px; }
.msg-row.own { justify-content: flex-end; }

.msg-bubble {
    max-width: 70%; padding: 14px 18px; border-radius: 18px;
    position: relative; font-size: 14px; line-height: 1.7;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.msg-bubble.deleted { 
    background: #1a1a1a !important; color: #666; border: 1px dashed #444; 
    font-style: italic; padding: 10px 15px;
}

@keyframes popIn { from { transform: scale(0.9) translateY(10px); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.msg-row.own .msg-bubble {
    background: var(--msg-own); color: white;
    border-bottom-left-radius: 4px;
}
.msg-row.other .msg-bubble {
    background: var(--msg-other);
    border-bottom-right-radius: 4px; border: 1px solid var(--border);
}

.msg-footer {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 6px; margin-top: 6px; font-size: 11px; opacity: 0.8;
}

/* --- Reply Preview Context in Message --- */
.reply-context {
    background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 8px;
    margin-bottom: 8px; font-size: 12px; border-right: 3px solid rgba(255,255,255,0.5);
    cursor: pointer; opacity: 0.9; transition: 0.2s;
}
.reply-context:hover { background: rgba(0,0,0,0.3); }

/* --- Input Area --- */
.chat-input-box {
    padding: 20px; background: #0a0c12;
    border-top: 1px solid var(--border);
}

.input-container {
    background: #161922; border-radius: 16px;
    border: 1px solid var(--border); padding: 8px;
    display: flex; gap: 10px; align-items: flex-end;
    transition: 0.3s;
}
.input-container:focus-within { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1); 
}

.text-field {
    flex: 1; background: transparent; border: none;
    color: white; padding: 12px; min-height: 44px; max-height: 150px;
    resize: none; font-size: 15px;
}

.action-btn {
    width: 44px; height: 44px; border-radius: 12px; border: none;
    background: transparent; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 18px; transition: 0.2s;
}
.action-btn:hover { background: rgba(255,255,255,0.08); color: white; }

.send-btn { background: var(--primary); color: white; }
.send-btn:hover { background: #2563eb; transform: scale(1.05); box-shadow: 0 0 15px var(--primary-glow); }

/* ================== Overlays ================== */
.overlay-glass {
    position: absolute; inset: 0; background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(25px); z-index: 50;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.4s;
}
.overlay-glass.active { opacity: 1; pointer-events: all; }

.glass-card {
    background: rgba(255,255,255,0.03); padding: 40px 60px;
    border-radius: 30px; border: 1px solid var(--border);
    text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-width: 500px; width: 90%;
}

/* ================== Context Menu ================== */
.ctx-item {
    padding: 10px 15px; cursor: pointer; font-size: 13px; color: #ddd; 
    display: flex; align-items: center; gap: 10px;
    transition: 0.2s; border-radius: 8px;
}
.ctx-item:hover { background: rgba(255,255,255,0.1); }

/* ================== Scrollbar ================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ================== Responsive Design ================== */
@media (max-width: 1024px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; flex-direction: row; overflow-x: auto; flex-shrink: 0; border-bottom: 1px solid var(--border); }
    .sidebar-header { width: 220px; border-bottom: none; border-left: 1px solid var(--border); padding: 15px; flex-shrink: 0; }
    .status-list { display: flex; overflow-x: auto; padding: 15px; align-items: center; }
    .status-card { min-width: 160px; height: 100%; }
    .messages-wrapper { padding: 15px 3%; }
    .msg-bubble { max-width: 85%; }
}

@media (max-width: 768px) {
    /* موبایل: ساده‌تر شدن لایوت */
    .sidebar { display: none; } /* فعلا سایدبارها را در موبایل مخفی می‌کنیم تا چت دیده شود */
    /* برای نسخه کامل موبایل باید دکمه منو اضافه شود */
    
    .chat-topbar { padding: 0 15px; height: 60px; }
    .chat-input-box { padding: 10px; }
    .glass-card { padding: 30px 20px; }
    
    .msg-bubble { 
        max-width: 88%; padding: 12px 14px; font-size: 13px; 
    }
    
    /* برای نمایش لیست استاتوس در موبایل باید دکمه تاگل اضافه شود، فعلا ساده نگه میداریم */
}
