/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-align: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-white);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-white {
  background: var(--bg-white);
  color: var(--primary);
}

.btn-white:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.badge.badge-blue {
  background: var(--secondary-light);
  color: var(--secondary);
}

/* Form Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Checklists */
.checklist { margin-top: 1.5rem; }
.checklist li {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--dark);
  font-weight: 500;
}
.checklist li::before {
  content: '✓';
  color: var(--primary);
  font-weight: bold;
  margin-right: 0.75rem;
}

/* MODAL WHATSAPP */
.wa-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.wa-modal-card {
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.15);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.wa-modal-overlay.active .wa-modal-card {
  transform: scale(1) translateY(0);
}

.wa-modal-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
}

/* GRID PATTERN BACKGROUNDS */
.bg-grid-pattern {
  position: relative;
}
.bg-grid-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(0,0,0,0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}
.bg-grid-pattern-dark {
  position: relative;
}
.bg-grid-pattern-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}

/* Ensure content overlays above grid */
.bg-grid-pattern > *, .bg-grid-pattern-dark > * {
  position: relative;
  z-index: 1;
}

/* MODERN IPHONE CSS MOCKUP */
.iphone-mockup {
  position: relative;
  width: 320px;
  aspect-ratio: 9/16;
  background: #f1f5f9;
  border-radius: 44px;
  border: 8px solid #cbd5e1;
  box-shadow: inset 0 0 0 2px #fff, 0 32px 64px rgba(0,0,0,0.15), 0 12px 24px rgba(0,0,0,0.08);
  overflow: hidden;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Hardware details */
.iphone-mockup::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 30px;
  background: #cbd5e1;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 20;
}
.iphone-mockup::after {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 6px;
  background: #000;
  border-radius: 10px;
  z-index: 21;
}

/* Chat Header */
.wa-chat-header {
  background: #075e54;
  color: white;
  padding: 40px 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
}
.wa-chat-header img {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  object-fit: contain;
}

/* Long Chat Animations */









.wa-bubble {
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  font-size: 0.8rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  max-width: 85%;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(15px) scale(0.95);
}

.wa-time {
  display: block;
  text-align: right;
  font-size: 0.6rem;
  color: rgba(0,0,0,0.4);
  margin-top: 4px;
}

/* Image Attachment in Chat */
.wa-attachment {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
  border: 1px solid rgba(0,0,0,0.05);
}


/* MODERN IPHONE CSS MOCKUP (DARK/OLIVE THEME) */
.iphone-mockup {
  position: relative;
  width: 320px;
  aspect-ratio: 9/16;
  background: #3d4945; /* Dark carcase */
  border-radius: 44px;
  border: 10px solid #2f3835;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.1), 0 32px 64px rgba(0,0,0,0.25), 0 12px 24px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Notch */
.iphone-mockup::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 30px;
  background: #2f3835;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 20;
}
.iphone-mockup::after {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 6px;
  background: #111;
  border-radius: 10px;
  z-index: 21;
}

/* Chat Header Custom */
.wa-chat-header {
  background: #3c4844; /* Dark gray match */
  color: #ffffff;
  padding: 40px 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.wa-chat-header img {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  object-fit: contain;
}

/* Custom Olive Green Messages */
.wa-sent {
  background: #E8F2D0; /* Very light olive based on #759226 */
  align-self: flex-end;
  border-top-right-radius: 2px;
  border: 1px solid rgba(117, 146, 38, 0.2);
  color: #1a1a1a;
}

.wa-received {
  background: #ffffff;
  align-self: flex-start;
  border-top-left-radius: 2px;
  border: 1px solid rgba(0,0,0,0.05);
  color: #1a1a1a;
}

@keyframes smoothSlideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Image Attachment in Chat */
.wa-attachment {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
  border: 1px solid rgba(0,0,0,0.05);
}

/* Cursor Animation */
.animated-cursor {
  position: absolute;
  width: 28px;
  height: 28px;
  z-index: 99;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  pointer-events: none;
  animation: cursorMove 8s infinite ease-in-out;
}

@keyframes cursorMove {
  0% { transform: translate(150px, 400px); opacity: 0; }
  10% { opacity: 1; transform: translate(150px, 400px); }
  30% { transform: translate(-30px, 200px) scale(0.9); }
  35% { transform: translate(-30px, 200px) scale(1); } /* Click effect */
  60% { transform: translate(100px, 100px); }
  80% { transform: translate(20px, 500px); opacity: 1; }
  100% { transform: translate(20px, 500px); opacity: 0; }
}

/* Floating Ê-Bot Icon */
.floating-ebot {
  position: absolute;
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  animation: floatIcon 6s infinite ease-in-out;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

/* PDF Document Bubble */
.wa-pdf-doc {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0,0,0,0.04);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.05);
}
.wa-pdf-icon {
  width: 36px; height: 36px;
  background: #e74c3c;
  color: white;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.7rem; letter-spacing: 0.5px;
}
.wa-pdf-details { flex: 1; }
.wa-pdf-name { font-weight: 600; font-size: 0.8rem; color: #111; }
.wa-pdf-size { font-size: 0.65rem; color: #777; }

/* MODERN WHATSAPP CHAT LOGIC - LOOP REWRITE */

/* The actual screen area */
.wa-chat-body {
  flex: 1;
  background: #F4F6F5; 
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: auto; scroll-behavior: smooth;
  scrollbar-width: none;
  position: relative;
}

/* The precise lifecycle of a bubble */
@keyframes bubblePopIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); } 
  10%, 100% { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; } 
}

/* Delay Logic (+3s gap average for reading) */
/* 42s Loop */



 /* PDF */
 /* Image */
 /* Map */
 /* Question */
 /* User: Sim */
 /* End Bot */

/* Button Flash */
@keyframes clickFlash {
  0%, 90% { background: transparent; color: #759226; }
  92% { background: rgba(117,146,38,0.2); transform: scale(0.95); }
  94%, 100% { background: transparent; color: #759226; transform: scale(1); }
}
.auto-click { /* Handled via JS */ }

.typing-indicator {
  display: none;
  gap: 4px;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: white;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  width: fit-content;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  opacity: 0;
  pointer-events: none;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #3d4945;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes showTyping { 
  0% { opacity: 0; transform: translateY(10px); } 
  2%, 98% { opacity: 1; transform: translateY(0); } 
  100% { opacity: 1; transform: translateY(0); } 
}
@keyframes hideTyping { 
  0% { opacity: 1; display: flex; }
  100% { opacity: 0; display: none; margin: 0; padding: 0; height: 0; } 
}
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.wa-typing-user {
  align-self: flex-end;
  background: transparent;
  padding: 0;
  margin-right: 0.5rem;
  box-shadow: none;
}
.wa-typing-bot {
  align-self: flex-start;
  background: transparent;
  padding: 0;
  margin-left: 0.5rem;
  box-shadow: none;
}

.wa-chat-body::-webkit-scrollbar {
  display: none;
}

.show-bubble {
  animation: smoothPopIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
  pointer-events: auto !important;
  display: block !important;
  opacity: 1 !important;
}
.show-typing-anim {
  animation: showTypingAnim 0.3s forwards !important;
  display: flex !important;
  opacity: 1 !important;
}
.hide-typing-anim {
  animation: hideTypingAnim 0.3s forwards !important;
}

@keyframes showTypingAnim { 
  0% { opacity: 0; transform: translateY(10px); } 
  100% { opacity: 1; transform: translateY(0); } 
}
@keyframes hideTypingAnim { 
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); } 
}

/* Reset .wa-message-wrapper to just be a flex container */
.wa-message-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  transition: opacity 0.5s ease;
}

@keyframes smoothPopIn { 
  0% { opacity: 0; transform: translateY(15px) scale(0.95); } 
  100% { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; } 
}
