/* ============================================
   SOULVD - WHATSAPP CHAT SCROLL ANIMATION
   For Bahrain/GCC Market
   ============================================ */

/* ===== SCRAMBLE TEXT EFFECT ===== */
.scramble-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 6rem);
  line-height: 1.1;
  color: white;
  position: relative;
}

.scramble-char {
  display: inline-block;
  transition: all 0.1s ease;
  min-width: 0.3em;
}

.scramble-char.revealed {
  color: #25D366;
}

.scramble-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #25D366;
  animation: cursor-blink 0.8s infinite;
  margin-left: 2px;
  vertical-align: middle;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== WHATSAPP CHAT SECTION ===== */
.whatsapp-section {
  position: relative;
  min-height: 300vh; /* Long scroll for chat reveal */
  background: linear-gradient(180deg, #0a0f1c 0%, #050810 100%);
}

.whatsapp-container {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

/* Phone Frame */
.phone-frame {
  width: 100%;
  max-width: 400px;
  height: 700px;
  background: #1a1a1a;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 
    0 50px 100px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #0b141a;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* WhatsApp Header */
.whatsapp-header {
  background: #1f2c34;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.whatsapp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 14px;
  position: relative;
}

.whatsapp-avatar.online::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #25D366;
  border: 2px solid #1f2c34;
  border-radius: 50%;
}

.whatsapp-header-info {
  flex: 1;
}

.whatsapp-header-name {
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.whatsapp-header-status {
  color: #8696a0;
  font-size: 13px;
}

/* Chat Area */
.chat-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0b141a;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%2325D366' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Message Bubbles */
.message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

.message-incoming {
  background: #202c33;
  color: #e9edef;
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.message-outgoing {
  background: #005c4b;
  color: white;
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.message-time {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.message-status {
  width: 16px;
  height: 16px;
}

/* Typing Indicator */
.typing-indicator {
  background: #202c33;
  padding: 16px 20px;
  border-radius: 20px;
  border-top-left-radius: 2px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.typing-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #8696a0;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Date Separator */
.chat-date {
  text-align: center;
  color: #8696a0;
  font-size: 12px;
  margin: 16px 0;
  position: relative;
}

.chat-date::before,
.chat-date::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(134, 150, 160, 0.2);
}

.chat-date::before { left: 0; }
.chat-date::after { right: 0; }

/* Quick Replies */
.quick-replies {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.quick-reply {
  background: #1f2c34;
  color: #00a884;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid #00a884;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-reply:hover {
  background: #00a884;
  color: white;
}

/* Input Area */
.chat-input-area {
  background: #1f2c34;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  color: white;
  font-size: 15px;
  outline: none;
}

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

.chat-send-btn {
  width: 40px;
  height: 40px;
  background: #00a884;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

.chat-send-btn:hover {
  transform: scale(1.1);
}

/* Scroll Progress Indicator */
.chat-progress {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s;
  cursor: pointer;
}

.chat-progress-dot.active {
  background: #25D366;
  transform: scale(1.3);
}

/* Floating WhatsApp CTA */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s;
  animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7), 0 0 0 10px rgba(37, 211, 102, 0.1); }
}

.whatsapp-float-tooltip {
  position: absolute;
  right: 70px;
  background: white;
  color: #333;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s;
  pointer-events: none;
}

.whatsapp-float:hover .whatsapp-float-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Section Labels */
.chat-label {
  position: absolute;
  left: -200px;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  opacity: 0;
  transition: all 0.5s;
}

.chat-label.visible {
  opacity: 1;
  left: -220px;
}

.chat-label h3 {
  color: #25D366;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.chat-label p {
  color: #8696a0;
  font-size: 16px;
  max-width: 180px;
}

/* Product Cards in Chat */
.product-card {
  background: #202c33;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
  max-width: 250px;
}

.product-card-image {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.product-card-info {
  padding: 12px;
}

.product-card-title {
  color: white;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-card-price {
  color: #25D366;
  font-size: 18px;
  font-weight: 700;
}

.product-card-button {
  background: #00a884;
  color: white;
  text-align: center;
  padding: 10px;
  margin: 0 12px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .phone-frame {
    max-width: 100%;
    height: 600px;
    border-radius: 30px;
  }
  
  .chat-label {
    display: none;
  }
  
  .chat-progress {
    right: 10px;
  }
}
