/* ================================================================
   V40 — WHATSAPP SLIDE PANELS & WELCOME SCREEN (NO POPUPS)
   1. In-place Sliding Panels Architecture for Sidebar
   2. Settings Panel matching Screenshot 1 (Avatar hero, Thought bubble, Item list)
   3. 2-Step New Group Creation Flow (Zero prompts, zero popups)
   4. Profile & Admin In-Place Panels
   5. WhatsApp Welcome Screen Hero matching Screenshot 1 & 2
   ================================================================ */

/* --- 1. SIDEBAR CONTAINER & SLIDE PANELS --- */
.sidebar-menu {
  position: relative !important;
  overflow: hidden !important;
  contain: layout paint;
}

.wa-slide-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--wa-bg-panel, #111b21);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1), opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.wa-slide-panel.active {
  transform: translateX(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 20;
}

/* Main chat list panel defaults to position 0 */
#panelChatList {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  z-index: 15;
}

#panelChatList.pushed-left {
  transform: translateX(-24%) !important;
  opacity: 0.8 !important;
  pointer-events: none;
}

/* --- SIDEBAR HEADER (Screenshot 2) --- */
.wa-sidebar-header {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--wa-bg-header, #202c33);
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  box-sizing: border-box;
  flex-shrink: 0;
}

.wa-sidebar-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--wa-green, #00a884);
  letter-spacing: -0.2px;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.wa-header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--wa-text-primary, #e9edef);
}

.wa-header-icon-btn.wa-btn-new-group {
  background: rgba(0, 168, 132, 0.18);
  color: var(--wa-green, #00a884);
}

.wa-header-icon-btn.wa-btn-new-group:hover {
  background: var(--wa-green, #00a884);
  color: #111b21;
}

/* WhatsApp Dropdown Menu */
.wa-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: var(--wa-bg-header, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.2));
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: waMenuIn 0.16s ease-out;
}

.wa-dropdown-menu.show {
  display: flex;
}

@keyframes waMenuIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--wa-text-primary, #e9edef);
  cursor: pointer;
  transition: background 0.15s ease;
}

.wa-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wa-menu-item.wa-menu-danger {
  color: #ef4444;
}

.wa-menu-item.wa-menu-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.wa-menu-divider {
  height: 1px;
  background: var(--wa-border, rgba(134, 150, 160, 0.15));
  margin: 4px 6px;
}

/* --- WHATSAPP FILTER PILLS (Screenshot 2) --- */
.wa-filter-pills {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
  background: transparent !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  flex-shrink: 0 !important;
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.1));
}

.wa-filter-pills::-webkit-scrollbar {
  display: none !important;
}

.wa-filter-pills .filter-tab {
  height: 32px !important;
  padding: 0 14px !important;
  border-radius: 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--wa-text-secondary, #8696a0) !important;
  border: 1px solid transparent !important;
  transition: all 0.18s ease !important;
}

.wa-filter-pills .filter-tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--wa-text-primary, #e9edef) !important;
}

.wa-filter-pills .filter-tab.active {
  background: var(--wa-green, #00a884) !important;
  color: #111b21 !important;
  font-weight: 600 !important;
}

:root[data-theme="light"] .wa-filter-pills .filter-tab {
  background: #f0f2f5 !important;
  color: #54656f !important;
}

:root[data-theme="light"] .wa-filter-pills .filter-tab.active {
  background: #008069 !important;
  color: #ffffff !important;
}

.wa-filter-add-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 1px dashed var(--wa-border, rgba(134, 150, 160, 0.3));
  background: transparent;
  color: var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wa-filter-add-btn:hover {
  border-color: var(--wa-green, #00a884);
  color: var(--wa-green, #00a884);
  background: rgba(0, 168, 132, 0.08);
}

/* --- NOTIFICATION BANNER (Screenshot 2) --- */
.wa-notification-banner {
  margin: 8px 12px;
  padding: 10px 14px;
  background: rgba(0, 168, 132, 0.12);
  border: 1px solid rgba(0, 168, 132, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--wa-text-primary, #e9edef);
  flex-shrink: 0;
}

.wa-notif-icon {
  color: var(--wa-green, #00a884);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-notif-text {
  flex: 1;
  line-height: 1.35;
}

.wa-notif-action {
  color: var(--wa-green, #00a884);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 2px;
}

.wa-notif-close {
  border: 0;
  background: transparent;
  color: var(--wa-text-secondary, #8696a0);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
}

.wa-notif-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--wa-text-primary, #e9edef);
}

/* --- SIDEBAR ENCRYPTION FOOTER --- */
.wa-sidebar-encryption-footer {
  padding: 14px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-top: 1px solid var(--wa-border, rgba(134, 150, 160, 0.1));
  flex-shrink: 0;
}

.wa-sidebar-encryption-footer a {
  color: var(--wa-green, #00a884);
  text-decoration: none;
}

.wa-sidebar-encryption-footer a:hover {
  text-decoration: underline;
}

/* --- 2. UNIVERSAL SLIDE PANEL HEADER --- */
.wa-panel-header {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--wa-bg-header, #202c33);
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  box-sizing: border-box;
  flex-shrink: 0;
}

.wa-panel-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.wa-panel-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--wa-text-primary, #e9edef);
}

.wa-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--wa-text-primary, #e9edef);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 24px;
}

/* --- 3. SETTINGS PANEL (MATCHING SCREENSHOT 1) --- */
.wa-settings-search-wrap {
  padding: 4px 2px 14px;
}

.wa-search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--wa-bg-input, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.2));
  border-radius: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wa-search-pill:focus-within {
  border-color: var(--wa-green, #00a884);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}

.wa-search-pill input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--wa-text-primary, #e9edef);
  font-size: 14px;
  outline: none;
}

/* Large Avatar Hero & "Share a thought" Bubble */
.wa-settings-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 20px;
  position: relative;
  cursor: pointer;
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.12));
  margin-bottom: 8px;
}

/* Thought Bubble matching Screenshot 1 */
.wa-thought-bubble {
  position: relative;
  background: #ffffff;
  color: #111b21;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  margin-bottom: 8px;
  animation: waFloat 2.8s ease-in-out infinite alternate;
}

.wa-thought-bubble::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
}

@keyframes waFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.wa-hero-avatar-wrap {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 10px;
}

.wa-hero-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884, #005c4b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 32px;
  font-weight: 700;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.wa-settings-profile-hero:hover .wa-hero-avatar {
  transform: scale(1.04);
}

.wa-hero-avatar-camera {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--wa-green, #00a884);
  color: #111b21;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.wa-hero-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--wa-text-primary, #e9edef);
  margin-top: 2px;
}

.wa-hero-sub {
  font-size: 13px;
  color: var(--wa-text-secondary, #8696a0);
  margin-top: 2px;
}

/* Settings List Items */
.wa-settings-list {
  display: flex;
  flex-direction: column;
}

.wa-setting-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wa-setting-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] .wa-setting-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.wa-setting-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-text-secondary, #8696a0);
  flex-shrink: 0;
}

.wa-setting-info {
  flex: 1;
  min-width: 0;
}

.wa-setting-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--wa-text-primary, #e9edef);
}

.wa-setting-desc {
  font-size: 12.5px;
  color: var(--wa-text-secondary, #8696a0);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-setting-item.wa-item-danger .wa-setting-icon {
  color: #ef4444;
}

/* --- 4. NEW GROUP PANEL (2-STEP FLOW) --- */
.wa-group-step {
  display: none;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.wa-group-step.active {
  display: flex;
}

.wa-selected-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  background: var(--wa-bg-panel, #111b21);
  flex-shrink: 0;
  scrollbar-width: none;
}

.wa-selected-chips-bar::-webkit-scrollbar {
  display: none;
}

.wa-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(0, 168, 132, 0.16);
  color: var(--wa-text-primary, #e9edef);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: waChipIn 0.2s ease;
}

@keyframes waChipIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.wa-chip-remove {
  cursor: pointer;
  color: var(--wa-text-secondary, #8696a0);
  font-size: 14px;
  line-height: 1;
}

.wa-chip-remove:hover {
  color: #ef4444;
}

.wa-group-search-wrap {
  padding: 10px 14px;
  flex-shrink: 0;
}

.wa-members-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 80px;
}

.wa-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wa-member-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.wa-member-row.selected {
  background: rgba(0, 168, 132, 0.12);
}

.wa-member-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.wa-member-row.selected .wa-member-checkbox {
  background: var(--wa-green, #00a884);
  border-color: var(--wa-green, #00a884);
}

.wa-member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2a3942;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.wa-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-member-details {
  flex: 1;
  min-width: 0;
}

.wa-member-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--wa-text-primary, #e9edef);
}

.wa-member-code {
  font-size: 12px;
  color: var(--wa-text-secondary, #8696a0);
}

/* Floating Action Button (FAB) */
.wa-floating-fab {
  position: absolute;
  bottom: 22px;
  right: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--wa-green, #00a884);
  color: #111b21;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 168, 132, 0.45);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
}

.wa-floating-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(0, 168, 132, 0.6);
}

.wa-floating-fab:active {
  transform: scale(0.96);
}

/* Step 2: Group name & avatar picker */
.wa-group-step2-content {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wa-group-avatar-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 24px;
}

.wa-group-avatar-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #2a3942;
  color: #8696a0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(134, 150, 160, 0.4);
  transition: all 0.2s ease;
  overflow: hidden;
}

.wa-group-avatar-preview:hover {
  border-color: var(--wa-green, #00a884);
  color: var(--wa-green, #00a884);
}

.wa-group-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-avatar-picker-hint {
  font-size: 12px;
  color: var(--wa-text-secondary, #8696a0);
}

.wa-group-input-wrap {
  width: 100%;
  margin-bottom: 20px;
}

.wa-text-underline-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--wa-green, #00a884);
  background: transparent;
  color: var(--wa-text-primary, #e9edef);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 4px;
  outline: none;
  box-sizing: border-box;
}

.wa-group-member-summary {
  width: 100%;
  font-size: 13px;
  color: var(--wa-text-secondary, #8696a0);
  margin-bottom: 12px;
}

.wa-group-chips-grid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

/* --- 5. PROFILE IN-PLACE PANEL --- */
.wa-profile-avatar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0 24px;
  position: relative;
}

.wa-profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884, #005c4b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 42px;
  font-weight: 700;
  object-fit: cover;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.wa-avatar-change-badge {
  position: absolute;
  bottom: 0;
  right: calc(50% - 60px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wa-green, #00a884);
  color: #111b21;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
}

.wa-profile-field-block {
  background: var(--wa-bg-input, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.wa-field-label {
  font-size: 12px;
  color: var(--wa-green, #00a884);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wa-field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-editable-field {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.3));
  color: var(--wa-text-primary, #e9edef);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  outline: none;
}

.wa-editable-field:focus {
  border-bottom-color: var(--wa-green, #00a884);
}

.wa-field-action-btn {
  border: 0;
  border-radius: 8px;
  background: var(--wa-green, #00a884);
  color: #111b21;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.wa-field-hint {
  font-size: 11.5px;
  color: var(--wa-text-secondary, #8696a0);
  margin-top: 8px;
  line-height: 1.4;
}

.wa-field-readonly {
  font-size: 15px;
  color: var(--wa-text-primary, #e9edef);
  padding: 4px 0;
  font-weight: 500;
}

.wa-status-msg {
  font-size: 13px;
  text-align: center;
  padding: 4px;
}
.wa-status-msg.ok { color: #22c55e; }
.wa-status-msg.err { color: #ef4444; }

.wa-btn-primary {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 10px;
  background: var(--wa-green, #00a884);
  color: #111b21;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.wa-btn-primary:hover {
  opacity: 0.9;
}

/* --- 6. ADMIN IN-PLACE PANEL --- */
.wa-admin-view {
  display: none;
}
.wa-admin-view.active {
  display: block;
}

.wa-admin-add-box {
  background: var(--wa-bg-input, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.wa-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wa-text-primary, #e9edef);
  margin-bottom: 8px;
}

.wa-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--wa-bg-input, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.1));
  border-radius: 10px;
  margin-bottom: 8px;
}

.wa-user-card-meta strong {
  display: block;
  font-size: 14px;
  color: var(--wa-text-primary, #e9edef);
}

.wa-user-card-meta small {
  font-size: 12px;
  color: var(--wa-text-secondary, #8696a0);
}

.wa-user-card-actions {
  display: flex;
  gap: 6px;
}

.wa-action-pill {
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: var(--wa-text-primary, #e9edef);
}

.wa-action-pill.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* --- 7. WHATSAPP WELCOME SCREEN HERO (MATCHING SCREENSHOT 1 & 2) --- */
.wa-welcome-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--wa-bg-deep, #0b141a);
  z-index: 25;
  padding: 24px;
  box-sizing: border-box;
  overflow-y: auto;
}

.wa-welcome-card {
  width: min(520px, 94%);
  background: var(--wa-bg-panel, #111b21);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  border-radius: 28px;
  padding: 38px 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  animation: waWelcomeIn 0.35s cubic-bezier(0.2, 0, 0, 1);
}

:root[data-theme="light"] .wa-welcome-card {
  background: #ffffff;
  border-color: rgba(11, 20, 26, 0.08);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

@keyframes waWelcomeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-welcome-illustration {
  margin-bottom: 20px;
}

.wa-welcome-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--wa-text-primary, #e9edef);
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}

.wa-welcome-subtitle {
  font-size: 14px;
  color: var(--wa-text-secondary, #8696a0);
  line-height: 1.5;
  margin: 0 0 24px;
  max-width: 380px;
}

.wa-welcome-action-btn {
  height: 44px;
  padding: 0 32px;
  border-radius: 22px;
  border: 0;
  background: var(--wa-green, #00a884);
  color: #111b21;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 168, 132, 0.35);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.wa-welcome-action-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* 4 Quick-Action Shortcut Buttons below the card (Screenshot 1 & 2) */
.wa-welcome-shortcuts {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  margin-top: 32px;
  width: min(520px, 94%);
}

.wa-shortcut-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--wa-text-secondary, #8696a0);
  cursor: pointer;
  padding: 6px;
  transition: transform 0.18s ease, color 0.18s ease;
}

.wa-shortcut-btn:hover {
  transform: translateY(-3px);
  color: var(--wa-text-primary, #e9edef);
}

.wa-shortcut-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--wa-bg-panel, #111b21);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.2));
  color: var(--wa-text-primary, #e9edef);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

:root[data-theme="light"] .wa-shortcut-icon {
  background: #ffffff;
  border-color: rgba(11, 20, 26, 0.1);
  color: #111b21;
}

.wa-shortcut-btn:hover .wa-shortcut-icon {
  background: var(--wa-bg-header, #202c33);
  border-color: var(--wa-green, #00a884);
  color: var(--wa-green, #00a884);
}

.wa-shortcut-icon.wa-shortcut-ai {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(59, 130, 246, 0.18));
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.wa-shortcut-btn:hover .wa-shortcut-icon.wa-shortcut-ai {
  background: linear-gradient(135deg, #a855f7, #3b82f6);
  color: #ffffff;
}

.wa-shortcut-btn span {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.wa-welcome-footer {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--wa-text-secondary, #8696a0);
}

.wa-welcome-footer a {
  color: var(--wa-green, #00a884);
  text-decoration: none;
}

.wa-welcome-footer a:hover {
  text-decoration: underline;
}

/* Hide chat elements when Welcome Screen is active */
#chatMainContainer.show-welcome .chat-header,
#chatMainContainer.show-welcome .chat-window,
#chatMainContainer.show-welcome .chat-input-zone {
  display: none !important;
}

#chatMainContainer:not(.show-welcome) .wa-welcome-screen {
  display: none !important;
}

/* Hide initial no-permission message completely in welcome mode */
#chatMainContainer.show-welcome #v2415NoChatPermission {
  display: none !important;
}

/* --- 8. MOBILE RESPONSIVENESS (< 768px) --- */
@media (max-width: 767px) {
  .wa-sidebar-header {
    height: 52px;
    min-height: 52px;
    padding: 0 12px;
  }
  
  .wa-panel-header {
    height: 52px;
    min-height: 52px;
    padding: 0 12px;
  }
  
  .wa-welcome-card {
    padding: 24px 16px;
    border-radius: 20px;
  }
  
  .wa-welcome-title {
    font-size: 20px;
  }
  
  .wa-welcome-shortcuts {
    gap: 14px;
    margin-top: 22px;
  }
  
  .wa-shortcut-icon {
    width: 42px;
    height: 42px;
  }
  
  .wa-shortcut-btn span {
    font-size: 11px;
  }
  
  /* On mobile, when a panel opens, ensure it occupies 100% of the screen */
  .wa-slide-panel {
    width: 100vw !important;
  }
}
