/*
 * WhatsApp Conversation CTA Component
 *
 * Reusable component for WhatsApp conversation call-to-actions.
 * Used for: Deep Interview, Job Interview Simulation, Storytelling Prep, etc.
 *
 * Usage: <%= render 'shared/whatsapp_conversation_cta', ... %>
 */

/* ========================================================================
   CONTAINER
   ======================================================================== */
.whatsapp-cta-wrapper {
  max-width: var(--container-max-width, 1200px);
  margin: 0 auto;
  padding: var(--spacing-lg, 20px);
}

/* ========================================================================
   MAIN BANNER
   ======================================================================== */
.whatsapp-cta-banner {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  border-radius: var(--radius-2xl, 24px);
  padding: 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
  min-height: 500px;
}

/* Decorative background pattern */
.whatsapp-cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.whatsapp-cta-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ========================================================================
   CONTENT SECTION
   ======================================================================== */
.whatsapp-cta-content {
  position: relative;
  z-index: 2;
}

.whatsapp-cta-title {
  color: white;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--spacing-lg, 20px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.whatsapp-cta-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: var(--spacing-xl, 30px);
}

/* ========================================================================
   CONTEXT INFO CARD
   ======================================================================== */
.whatsapp-context-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg, 16px);
  padding: var(--spacing-lg, 20px);
  margin-bottom: var(--spacing-xl, 30px);
}

.whatsapp-context-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--spacing-2, 8px);
  display: flex;
  align-items: center;
  gap: var(--spacing-2, 8px);
}

.whatsapp-context-label i {
  font-size: 1rem;
}

.whatsapp-context-text {
  color: white;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

/* ========================================================================
   PHONE NOTICE
   ======================================================================== */
.whatsapp-phone-notice {
  background: rgba(252, 211, 77, 0.2);
  border: 1px solid rgba(252, 211, 77, 0.4);
  border-radius: var(--radius-md, 12px);
  padding: var(--spacing-md, 16px);
  margin-bottom: var(--spacing-xl, 30px);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-3, 12px);
}

.whatsapp-phone-notice i {
  color: #fbbf24;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.whatsapp-phone-notice-text {
  color: white;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

.whatsapp-phone-notice-text strong {
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
  color: #fbbf24;
}

/* ========================================================================
   CTA BUTTON
   ======================================================================== */
.whatsapp-cta-button-primary {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  padding: 20px 50px;
  border-radius: 60px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-3, 12px);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.whatsapp-cta-button-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.whatsapp-cta-button-primary:hover::before {
  left: 100%;
}

.whatsapp-cta-button-primary i {
  font-size: 1.5rem;
}

.whatsapp-cta-button-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(37, 211, 102, 0.5);
  text-decoration: none;
  color: white;
}

.whatsapp-cta-button-primary:active {
  transform: translateY(-1px);
}

/* ========================================================================
   VISUAL SECTION (Avatar/Image)
   ======================================================================== */
.whatsapp-cta-visual {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-maia-avatar {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}

/* Decorative circles behind avatar */
.whatsapp-avatar-decoration {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse-avatar 3s ease-in-out infinite;
}

@keyframes pulse-avatar {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.3;
  }
}

.whatsapp-maia-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

/* Fallback avatar (when no image provided) */
.whatsapp-maia-avatar-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 6px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.whatsapp-maia-avatar-fallback i {
  font-size: 8rem;
  color: white;
  opacity: 0.9;
}

/* WhatsApp message bubble decoration */
.whatsapp-message-decoration {
  position: absolute;
  bottom: 20px;
  right: -20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 20px;
  border-radius: 20px 20px 4px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-width: 250px;
  z-index: 3;
}

.whatsapp-message-text {
  color: #1e293b;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

.whatsapp-message-time {
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.whatsapp-message-time i {
  font-size: 1rem;
  color: #25D366;
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */
@media (max-width: 1024px) {
  .whatsapp-cta-banner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 50px 40px;
    min-height: auto;
  }

  .whatsapp-cta-visual {
    order: -1;
  }

  .whatsapp-maia-avatar {
    max-width: 300px;
  }

  .whatsapp-message-decoration {
    bottom: -10px;
    right: 10%;
  }
}

@media (max-width: 768px) {
  .whatsapp-cta-banner {
    padding: 40px 30px;
  }

  .whatsapp-cta-title {
    font-size: 2rem;
  }

  .whatsapp-cta-description {
    font-size: 1rem;
  }

  .whatsapp-cta-button-primary {
    width: 100%;
    justify-content: center;
    padding: 18px 40px;
    font-size: 1rem;
  }

  .whatsapp-maia-avatar {
    max-width: 250px;
  }

  .whatsapp-message-decoration {
    display: none; /* Hide message bubble on mobile */
  }
}

@media (max-width: 480px) {
  .whatsapp-cta-banner {
    padding: 30px 20px;
  }

  .whatsapp-cta-title {
    font-size: 1.75rem;
  }

  .whatsapp-context-card {
    padding: var(--spacing-md, 16px);
  }

  .whatsapp-phone-notice {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ========================================================================
   BACK BUTTON
   ======================================================================== */
.whatsapp-cta-back-section {
  text-align: center;
  margin-top: var(--spacing-2xl, 40px);
  padding-top: var(--spacing-xl, 30px);
  border-top: 1px solid var(--color-border, #e2e8f0);
}
