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

body { background: #111b21; height: 100vh; overflow: hidden; direction: rtl; }

#login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: linear-gradient(135deg, #0b141a, #1f2c33);
}

.login-box {
  background: #1f2c33; padding: 40px; border-radius: 16px;
  text-align: center; width: 340px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.login-logo {
  font-size: 42px; font-weight: 800; color: #00a884;
  letter-spacing: 4px; margin-bottom: 8px;
}

.login-sub { color: #8696a0; font-size: 14px; margin-bottom: 30px; }

.login-box input {
  width: 100%; padding: 14px 18px; border: 2px solid #2a3942;
  border-radius: 10px; background: #2a3942; color: #e9edef;
  font-size: 16px; outline: none; transition: 0.3s;
}

.login-box input:focus { border-color: #00a884; }

.login-box button {
  width: 100%; padding: 14px; margin-top: 16px;
  background: #00a884; color: white; border: none;
  border-radius: 10px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: 0.3s;
}

.login-box button:hover { background: #06cf9e; }

#main-app { display: flex; height: 100vh; }

#sidebar {
  width: 340px; min-width: 340px; background: #111b21;
  border-left: 1px solid #2a3942; display: flex; flex-direction: column;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; background: #1f2c33; border-bottom: 1px solid #2a3942;
}

.sidebar-header h2 { color: #e9edef; font-size: 18px; }

#online-count {
  background: #00a884; color: white; padding: 2px 10px;
  border-radius: 12px; font-size: 13px; font-weight: 600;
}

#users-list { flex: 1; overflow-y: auto; padding: 8px 0; }

#users-list::-webkit-scrollbar { width: 6px; }
#users-list::-webkit-scrollbar-track { background: #111b21; }
#users-list::-webkit-scrollbar-thumb { background: #2a3942; border-radius: 3px; }

.user-item {
  display: flex; align-items: center; padding: 12px 20px;
  cursor: pointer; transition: 0.2s; border-bottom: 1px solid #1f2c33;
}

.user-item:hover { background: #1f2c33; }
.user-item.active { background: #2a3942; }

.user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #00a884; color: white; display: flex;
  align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; margin-left: 14px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { color: #e9edef; font-size: 15px; font-weight: 500; }
.user-distance { color: #8696a0; font-size: 12px; margin-top: 2px; }

.online-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #00a884; flex-shrink: 0; margin-right: 4px;
  box-shadow: 0 0 6px rgba(0,168,132,0.5);
}

#main-content { flex: 1; display: flex; background: #222e35; }

#chat-area {
  flex: 1; display: flex; flex-direction: column; position: relative;
}

#chat-header {
  padding: 16px 24px; background: #1f2c33; border-bottom: 1px solid #2a3942;
  color: #e9edef; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}

#video-call-btn {
  background: none; border: 2px solid #00a884; color: #00a884;
  font-size: 22px; border-radius: 50%; width: 44px; height: 44px;
  cursor: pointer; transition: 0.2s; display: flex;
  align-items: center; justify-content: center;
}

#video-call-btn:hover { background: #00a884; color: white; }

#video-container {
  background: #0b141a; padding: 12px; border-bottom: 1px solid #2a3942;
}

.video-wrapper {
  display: flex; gap: 8px; justify-content: center;
}

.video-box {
  position: relative; width: 48%; max-width: 400px;
  background: #1f2c33; border-radius: 12px; overflow: hidden;
  aspect-ratio: 4/3;
}

.video-box video { width: 100%; height: 100%; object-fit: cover; }

.video-label {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7); color: #e9edef;
  padding: 4px 12px; border-radius: 6px; font-size: 12px;
}

.video-controls {
  display: flex; justify-content: center; gap: 16px;
  padding: 10px 0 4px;
}

.vc-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: #2a3942; color: #e9edef; font-size: 18px;
  cursor: pointer; transition: 0.2s; display: flex;
  align-items: center; justify-content: center;
}

.vc-btn:hover { background: #3b4a54; }
.vc-btn.danger { background: #ef4444; }
.vc-btn.danger:hover { background: #dc2626; }

.video-filter-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 6px 0 4px; color: #8696a0; font-size: 13px;
}

.video-filter-row select {
  padding: 6px 10px; border-radius: 6px; border: 1px solid #2a3942;
  background: #2a3942; color: #e9edef; font-size: 13px; outline: none; cursor: pointer;
}

#messages {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  background: #0b141a;
}

#messages::-webkit-scrollbar { width: 6px; }
#messages::-webkit-scrollbar-track { background: #0b141a; }
#messages::-webkit-scrollbar-thumb { background: #2a3942; border-radius: 3px; }

.message {
  margin-bottom: 8px; display: flex; flex-direction: column;
}

.message.sent { align-items: flex-end; }
.message.received { align-items: flex-start; }

.message-bubble {
  max-width: 70%; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; line-height: 1.5; word-wrap: break-word;
}

.message.sent .message-bubble {
  background: #005c4b; color: #e9edef;
  border-bottom-left-radius: 4px;
}

.message.received .message-bubble {
  background: #1f2c33; color: #e9edef;
  border-bottom-right-radius: 4px;
}

.message-sender { font-size: 12px; color: #00a884; font-weight: 600; margin-bottom: 2px; }
.message-time { font-size: 11px; color: #8696a0; margin-top: 4px; text-align: left; }

#chat-input-area {
  display: flex; padding: 12px 20px; background: #1f2c33;
  border-top: 1px solid #2a3942; gap: 10px;
}

#msg-input {
  flex: 1; padding: 12px 18px; border: none; border-radius: 10px;
  background: #2a3942; color: #e9edef; font-size: 14px; outline: none;
}

#send-btn {
  padding: 12px 24px; background: #00a884; color: white;
  border: none; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: 0.3s;
}

#send-btn:hover { background: #06cf9e; }

@media (max-width: 768px) {
  #sidebar { width: 100%; min-width: unset; }
  #main-content { display: none; }
  .video-wrapper { flex-direction: column; align-items: center; }
  .video-box { width: 100%; }
}
