/* ==========================================================================
   GOOGLE STITCH - PREMIUM 3D & MATERIAL DESIGN SYSTEM
   ========================================================================== */

:root {
  --stitch-gold: #c9a84c;
  --stitch-gold-glow: rgba(201, 168, 76, 0.35);
  --stitch-maroon: #6b1c23;
  --stitch-maroon-dark: #3d0e14;
  --stitch-shadow-sm: 0 4px 15px rgba(61, 14, 20, 0.05);
  --stitch-shadow-md: 0 15px 40px rgba(61, 14, 20, 0.08);
  --stitch-shadow-3d: 0 20px 45px rgba(61, 14, 20, 0.12), 0 8px 20px rgba(201, 168, 76, 0.06);
}

/* 1. Global 3D Perspective and Elevation on Cards */
.card, 
.service-card, 
.feature-card, 
.project-card, 
.blog-card, 
.secure-embed-container, 
.product-showcase-card,
.step-card {
  perspective: 1200px;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s ease, 
              border-color 0.4s ease, 
              background-color 0.4s ease !important;
}

.card:hover, 
.service-card:hover, 
.feature-card:hover, 
.project-card:hover, 
.blog-card:hover, 
.secure-embed-container:hover, 
.product-showcase-card:hover,
.step-card:hover {
  transform: translateY(-8px) rotateX(1.5deg) rotateY(-1.5deg) !important;
  box-shadow: var(--stitch-shadow-3d) !important;
  border-color: rgba(201, 168, 76, 0.3) !important;
}

/* 2. Global Interactive 3D Tactile Buttons */
.btn, 
.btn-primary, 
.btn-secondary,
.cta-btn, 
.product-cta-btn, 
.lead-btn-primary {
  position: relative !important;
  top: 0;
  box-shadow: 0 4px 0px rgba(0, 0, 0, 0.15), 0 6px 15px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.15s ease !important;
}

.btn:hover, 
.btn-primary:hover, 
.btn-secondary:hover,
.cta-btn:hover, 
.product-cta-btn:hover, 
.lead-btn-primary:hover {
  top: 2px !important;
  box-shadow: 0 2px 0px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08) !important;
}

.btn:active, 
.btn-primary:active, 
.btn-secondary:active,
.cta-btn:active, 
.product-cta-btn:active, 
.lead-btn-primary:active {
  top: 4px !important;
  box-shadow: 0 0px 0px rgba(0,0,0,0), 0 2px 5px rgba(0,0,0,0.05) !important;
}

/* 3. Global Glassmorphism panels */
.glass-panel,
.lead-modal-content,
.search-modal-content {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(201, 168, 76, 0.25) !important;
}

/* 4. Elegant Focus Highlight on Inputs */
input:focus, 
textarea:focus, 
select:focus {
  border-color: var(--stitch-gold) !important;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18) !important;
  outline: none !important;
}

/* 5. Google Material Symbols Global Alignment */
.material-symbols-outlined {
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
}

/* 6. Subtle Pulse Micro-animations */
.icon-pulse {
  animation: stitchPulse 2.5s infinite ease-in-out;
}

@keyframes stitchPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   ANSHUMAN AI CHATBOT WIDGET STYLES
   ========================================================================== */

#chatbot-widget-container {
  position: fixed;
  bottom: 24px;
  left: 24px; /* default bottom-left to prevent overlapping WhatsApp/Review floats on bottom-right */
  right: auto;
  z-index: 100000;
  font-family: 'DM Sans', sans-serif;
}

/* Chat bubble toggle button */
#chatbot-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--stitch-maroon-dark) 0%, var(--stitch-maroon) 100%);
  border: 2px solid var(--stitch-gold);
  color: var(--white, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(61,14,20,0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}
#chatbot-bubble:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(61,14,20,0.4);
}
#chatbot-bubble .material-symbols-outlined {
  font-size: 28px;
  color: #fff;
}
#chatbot-bubble .chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #25D366;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: stitchPulse 2s infinite;
}

/* Chatbox Window */
#chatbot-window {
  position: absolute;
  bottom: 80px;
  left: 0; /* default open side */
  right: auto;
  width: 360px;
  max-width: 90vw;
  height: 500px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(61,14,20,0.22);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(201, 168, 76, 0.25);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom left;
}
#chatbot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--stitch-maroon-dark) 0%, var(--stitch-maroon) 100%);
  padding: 16px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--stitch-gold);
}
.chatbot-brand-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chatbot-avatar {
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--stitch-maroon);
  border: 1px solid var(--stitch-gold);
  font-size: 16px;
}
.chatbot-header-text h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'DM Sans', sans-serif;
  color: #fff;
}
.chatbot-header-text span {
  font-size: 10px;
  color: #25D366;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.chatbot-header-text span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #25D366;
  border-radius: 50%;
}
.chatbot-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}
.chatbot-close-btn:hover {
  color: #fff;
}

/* Chat Messages */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #faf8f5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chatbot-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: chatbotFadeIn 0.3s ease both;
}
.chatbot-msg-bubble.ai {
  background: #fff;
  color: #2b0b0e;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(61,14,20,0.03);
  border: 1px solid rgba(107,28,35,0.05);
}
.chatbot-msg-bubble.user {
  background: var(--stitch-maroon);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(61,14,20,0.1);
}

.chatbot-msg-bubble a {
  color: var(--stitch-gold);
  text-decoration: underline;
  font-weight: 600;
}
.chatbot-msg-bubble a:hover {
  color: #e8c96a;
}

/* Suggestions Row */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  background: #faf8f5;
  border-top: 1px solid rgba(61,14,20,0.03);
}
.chatbot-suggest-btn {
  background: #fff;
  border: 1px solid rgba(107, 28, 35, 0.15);
  color: var(--stitch-maroon);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.chatbot-suggest-btn:hover {
  background: var(--stitch-maroon);
  color: #fff;
  border-color: var(--stitch-maroon);
}

/* Typing Indicator */
.chatbot-typing {
  align-self: flex-start;
  background: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(61,14,20,0.03);
  border: 1px solid rgba(107,28,35,0.05);
  display: none;
}
.chatbot-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--stitch-maroon);
  border-radius: 50%;
  animation: chatbotTypingDot 1.4s infinite both;
  margin: 0 2px;
}
.chatbot-typing span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing span:nth-child(3) { animation-delay: .4s; }

/* Input Footer */
.chatbot-input-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0e6d2;
  background: #fff;
  display: flex;
  gap: 10px;
  align-items: center;
}
.chatbot-input-footer input {
  flex: 1;
  border: 1px solid rgba(107,28,35,0.18);
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  color: #3d0e14;
}
.chatbot-input-footer input:focus {
  border-color: var(--stitch-gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--stitch-maroon);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(61,14,20,0.15);
  transition: all 0.2s;
}
.chatbot-send-btn:hover {
  background: var(--stitch-maroon-dark);
  transform: scale(1.05);
}
.chatbot-send-btn .material-symbols-outlined {
  font-size: 20px;
}

@keyframes chatbotFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes chatbotTypingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  #chatbot-widget-container { bottom: 16px; right: 16px; }
  #chatbot-window {
    width: calc(100vw - 32px);
    height: 440px;
  }
}
