/* NeferWa Sovereign Live Chat Widget Styles */

/* 1. زر المحادثة بالترويسة العلوية */
.chat-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 10px;
  color: #34d399;
  font-family: var(--font-body, 'Cairo', sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}
.chat-header-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(16, 185, 129, 0.15));
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
  color: #fff;
}
.chat-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

/* 2. الزر العائم في زاوية الشاشة */
.neferwa-chat-launcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  color: #ffffff;
  font-family: var(--font-body, 'Cairo', sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(16, 185, 129, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.neferwa-chat-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(16, 185, 129, 0.65);
}
.neferwa-chat-launcher:active {
  transform: translateY(-1px) scale(0.98);
}
.neferwa-chat-launcher-icon {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.neferwa-chat-launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a7f3d0;
  box-shadow: 0 0 10px #34d399;
  animation: pulse-dot 1.8s infinite;
}
.neferwa-chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff6600;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #050507;
  box-shadow: 0 0 12px rgba(255, 102, 0, 0.8);
  animation: bounce-badge 1s infinite alternate;
}
@keyframes bounce-badge {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* 3. نافذة المحادثة المباشرة */
.neferwa-chat-box {
  position: fixed;
  bottom: 84px;
  left: 24px;
  z-index: 99999;
  width: 480px;
  max-width: calc(100vw - 28px);
  height: 670px;
  max-height: calc(100vh - 96px);
  background: rgba(10, 14, 23, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 45px rgba(16, 185, 129, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  font-family: var(--font-body, 'Cairo', sans-serif);
}
.neferwa-chat-box.open {
  display: flex;
}
@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ترويسة نافذة المحادثة */
.neferwa-chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(10, 14, 23, 0.8) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #047857);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.chat-title-group h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}
.chat-status-text {
  margin: 2px 0 0 0;
  font-size: 0.74rem;
  color: #34d399;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-status-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.chat-header-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-admin-btn {
  background: rgba(255, 102, 0, 0.12);
  border: 1px solid rgba(255, 102, 0, 0.35);
  color: #ff8533;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-admin-btn:hover {
  background: rgba(255, 102, 0, 0.25);
  color: #fff;
}
.chat-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
}

/* منطقة الرسائل */
.neferwa-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
}
.neferwa-chat-body::-webkit-scrollbar {
  width: 5px;
}
.neferwa-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
}

/* فقاعات الرسائل */
.chat-bubble {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
  animation: bubblePop 0.2s ease-out;
}
@keyframes bubblePop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.bubble-admin {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-right-radius: 4px;
  color: #f1f5f9;
}
.bubble-client {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff6600 0%, #e65c00 100%);
  border-bottom-left-radius: 4px;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.25);
}
.bubble-author {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.bubble-client .bubble-author {
  color: #fed7aa;
}
.bubble-time {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 5px;
  text-align: left;
}
.bubble-client .bubble-time {
  color: rgba(255, 255, 255, 0.75);
}

/* كارت تسجيل ودراسة فكرة المشروع (Lead Capture Card) */
.chat-project-lead-card {
  align-self: stretch;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 29, 0.98) 100%);
  border: 2px solid #10b981;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 25px rgba(16, 185, 129, 0.25);
  margin-top: 6px;
  direction: rtl;
  text-align: right;
}
.lead-card-header {
  font-weight: 800;
  font-size: 1.02rem;
  color: #34d399;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 10px;
}
.lead-field {
  margin-bottom: 12px;
}
.lead-field label {
  display: block;
  font-size: 0.86rem;
  color: #e2e8f0;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: right;
}
.lead-field input, .lead-field textarea, .lead-field select {
  width: 100%;
  padding: 13px 16px;
  background: #090e17 !important;
  border: 1.8px solid rgba(16, 185, 129, 0.4) !important;
  border-radius: 12px;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 0.98rem !important;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.lead-field select option {
  background: #0d1527;
  color: #ffffff;
  padding: 10px;
  font-size: 0.95rem;
}
.lead-field textarea {
  min-height: 85px;
  line-height: 1.6;
  resize: vertical;
}
.lead-field input::placeholder, .lead-field textarea::placeholder {
  color: #64748b !important;
  font-size: 0.9rem;
  font-weight: normal;
  opacity: 1;
}
.lead-field input:focus, .lead-field textarea:focus {
  border-color: #10b981 !important;
  background: #111a2e !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5) !important;
}
.btn-submit-lead-chat, .btn-send-lead-whatsapp {
  width: 100%;
  padding: 15px 18px;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
  transition: all 0.25s;
  margin-top: 14px;
}
.btn-submit-lead-chat:hover, .btn-send-lead-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.65);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}
.lead-submitted-success {
  text-align: center;
  padding: 16px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  border-radius: 14px;
  animation: bubblePop 0.3s ease-out;
}

/* شاشة لوحة الأدمن داخل الشات (Admin Live Hub View) */
.neferwa-chat-admin-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  background: #0a0f19;
  overflow: hidden;
}
.neferwa-chat-admin-panel.active {
  display: flex;
}
.admin-sessions-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: #ff8533;
}
.admin-sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-session-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-session-item:hover, .admin-session-item.selected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
}
.session-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.session-client-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}
.session-time {
  font-size: 0.7rem;
  color: #64748b;
}
.session-snippet {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* منطقة الإدخال */
.neferwa-chat-footer {
  padding: 12px 14px;
  background: rgba(10, 14, 23, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-input-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-text-input {
  flex: 1;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-text-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.chat-send-btn {
  padding: 12px 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}
.chat-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}
.chat-send-btn:active {
  transform: translateY(0);
}
