/* WhatsApp Theme & Chat Layout Styles */
.chat-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--wa-chat-bg);
  z-index: 100;
}

/* =========================================================
   1. WHATSAPP HEADER
   ========================================================= */
.whatsapp-header {
  height: 60px;
  background-color: var(--wa-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 200;
  user-select: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.header-stealth-back {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.15s;
}

.header-stealth-back:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-stealth-back svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #128c7e;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.partner-name {
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.partner-subtitle {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.status-online {
  color: #bbf7d0 !important;
}

.status-background {
  color: #fed7aa !important;
  font-style: italic;
}

.status-offline {
  color: rgba(255, 255, 255, 0.7) !important;
}

.status-typing {
  color: #86efac !important;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-action-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.2s, transform 0.15s;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-action-btn:active {
  transform: scale(0.92);
}

.header-action-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Video Call Button Disabled state (e.g. partner in background or offline) */
.btn-call-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
}

.btn-call-disabled:hover {
  background: none !important;
}

/* =========================================================
   2. OFFLINE BANNER
   ========================================================= */
.offline-banner {
  background-color: #ffd279;
  color: #4b3600;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 150;
  transition: all 0.25s ease;
}

.offline-banner.banner-hidden {
  display: none;
}

.offline-banner svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* =========================================================
   3. CHAT MESSAGES AREA (with WhatsApp doodle pattern)
   ========================================================= */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background-color: var(--wa-chat-bg);
  background-image: url('/assets/whatsapp-bg.svg');
  background-repeat: repeat;
  background-size: 380px;
  scroll-behavior: smooth;
}

/* Message Bubble Base */
.chat-bubble {
  max-width: 78%;
  padding: 0.45rem 0.65rem 0.35rem 0.7rem;
  border-radius: 8px;
  position: relative;
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
  display: flex;
  flex-direction: column;
  animation: bubbleAppear 0.15s ease-out;
}

@keyframes bubbleAppear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Outgoing (My Message) */
.bubble-mine {
  align-self: flex-end;
  background-color: var(--wa-outgoing);
  border-top-right-radius: 0;
}

.bubble-mine::after {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 10px 8px;
  border-color: transparent transparent transparent var(--wa-outgoing);
}

/* Incoming (Partner Message) */
.bubble-partner {
  align-self: flex-start;
  background-color: var(--wa-incoming);
  border-top-left-radius: 0;
}

.bubble-partner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 10px 0;
  border-color: transparent var(--wa-incoming) transparent transparent;
}

.bubble-text {
  color: #111b21;
}

/* Bubble Meta (Time & Status checkmarks) */
.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.15rem;
  margin-left: 0.75rem;
  align-self: flex-end;
  user-select: none;
}

.bubble-time {
  font-size: 0.68rem;
  color: #667781;
}

.bubble-ticks {
  display: flex;
  align-items: center;
}

.tick-icon {
  width: 15px;
  height: 15px;
  display: inline-block;
}

.tick-pending {
  color: #8696a0;
}

.tick-sent, .tick-delivered {
  color: #8696a0;
}

/* Double blue ticks */
.tick-read {
  color: var(--wa-blue-ticks);
}

/* Image Bubbles */
.bubble-image-wrapper {
  margin-bottom: 0.3rem;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}

.bubble-image {
  max-width: 100%;
  max-height: 280px;
  display: block;
  object-fit: cover;
  transition: transform 0.2s;
}

.bubble-image:hover {
  transform: scale(1.01);
}

/* Voice Note Bubbles */
.bubble-audio-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.2rem 0;
  min-width: 180px;
}

.audio-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--wa-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.audio-play-btn:hover {
  background: var(--wa-teal-dark);
}

.audio-play-btn svg {
  width: 18px;
  height: 18px;
}

.play-hidden {
  display: none !important;
}

.audio-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.audio-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--wa-teal);
  transition: width 0.1s linear;
}

/* =========================================================
   4. WHATSAPP BOTTOM INPUT BAR
   ========================================================= */
.whatsapp-input-bar {
  min-height: 58px;
  background-color: #f0f2f5;
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 200;
}

.input-icon-btn {
  background: none;
  border: none;
  color: #54656f;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.input-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111b21;
}

.input-icon-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.chat-input-wrapper {
  flex: 1;
  background-color: #ffffff;
  border-radius: 20px;
  padding: 0.5rem 0.95rem;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chat-input-text {
  width: 100%;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: #111b21;
  background: transparent;
  font-family: inherit;
}

.chat-input-text::placeholder {
  color: #8696a0;
}

/* Action Button: Mic vs Send */
.chat-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: var(--wa-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.chat-action-btn:hover {
  background-color: var(--wa-teal-dark);
}

.chat-action-btn:active {
  transform: scale(0.92);
}

.chat-action-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.btn-hidden {
  display: none !important;
}

/* =========================================================
   5. VOICE RECORDING OVERLAY
   ========================================================= */
.recording-overlay {
  position: absolute;
  inset: 0;
  background-color: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 250;
  animation: slideUp 0.15s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.recording-hidden {
  display: none !important;
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.recording-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ea4335;
  animation: blinkRec 1s infinite alternate;
}

@keyframes blinkRec {
  from { opacity: 1; transform: scale(1.1); }
  to { opacity: 0.2; transform: scale(0.8); }
}

.recording-timer {
  font-size: 0.95rem;
  font-weight: 500;
  color: #111b21;
}

.recording-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-rec-cancel {
  background: none;
  border: none;
  color: #ea4335;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
}

.btn-rec-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: var(--wa-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-rec-send svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* =========================================================
   6. ATTACHMENT MENU DRAWER
   ========================================================= */
.attachment-menu {
  position: absolute;
  bottom: 70px;
  left: 12px;
  background: #ffffff;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  z-index: 300;
  animation: attachPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes attachPop {
  from { opacity: 0; transform: translateY(15px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.menu-hidden {
  display: none !important;
}

.attachment-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: #54656f;
  font-size: 0.75rem;
  font-family: inherit;
  transition: transform 0.15s;
}

.attachment-item:active {
  transform: scale(0.92);
}

.attachment-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.attachment-icon-circle svg {
  width: 22px;
  height: 22px;
}

.icon-doc {
  background: linear-gradient(135deg, #7f66ff 0%, #5d3df5 100%);
}

.icon-media {
  background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%);
}

.icon-audio {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

/* =========================================================
   7. STICKER DRAWER PANEL
   ========================================================= */
.sticker-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 260px;
  background: #f0f2f5;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 280;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  animation: slideDrawer 0.2s ease-out;
}

@keyframes slideDrawer {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.panel-hidden {
  display: none !important;
}

.sticker-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  background: #e9edef;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sticker-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
}

.sticker-tab-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.65rem;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #54656f;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.sticker-tab-btn.active {
  background: var(--wa-teal);
  color: #ffffff;
}

.sticker-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #54656f;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.sticker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.75rem;
  align-content: start;
}

.sticker-item {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px;
  transition: transform 0.15s, background 0.15s;
}

.sticker-item:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.sticker-item:active {
  transform: scale(0.95);
}

.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =========================================================
   8. STICKER & DOCUMENT BUBBLES
   ========================================================= */
/* Sticker Bubble: Transparent, NO background, authentic WhatsApp look */
.bubble-sticker {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.bubble-sticker::after,
.bubble-sticker::before {
  display: none !important;
}

.sticker-content {
  position: relative;
  display: inline-block;
}

.bubble-sticker-img {
  width: 135px;
  height: 135px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  animation: stickerBounce 0.25s ease-out;
}

@keyframes stickerBounce {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.sticker-meta {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sticker-meta .bubble-time {
  color: #ffffff !important;
  font-size: 0.65rem;
}

/* Document Bubble */
.bubble-document-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  min-width: 220px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.2rem;
  transition: background 0.15s;
}

.bubble-document-wrapper:hover {
  background: rgba(0, 0, 0, 0.08);
}

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #7f66ff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-icon svg {
  width: 20px;
  height: 20px;
}

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

.doc-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: #111b21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-size {
  font-size: 0.72rem;
  color: #667781;
}

.doc-download-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-teal);
}

.doc-download-icon svg {
  width: 18px;
  height: 18px;
}

/* Video Bubble */
.bubble-video {
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  display: block;
}

/* =========================================================
   9. VOICE CALL FULLSCREEN OVERLAY
   ========================================================= */
.voice-call-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #111b21;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  animation: fadeIn 0.25s ease;
}

.voice-call-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.voice-avatar-large {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  font-size: 3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.voice-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(0, 168, 132, 0.6);
  animation: pulseVoice 2s infinite;
}

@keyframes pulseVoice {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

.voice-partner-name {
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.voice-call-badge {
  font-size: 0.88rem;
  color: #8696a0;
  margin-bottom: 0.8rem;
}

.voice-call-timer {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.1rem;
  color: #bbf7d0;
  margin-bottom: 3.5rem;
}

.voice-call-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
}

