/* AM Solutions - Chatbot Glassmorphism Stylesheet */

/* Floating Trigger Button */
.chatbot-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: var(--gradient-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3), var(--shadow-glow);
  transition: var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0;
}

.chatbot-trigger:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4), 0 0 25px rgba(0, 240, 255, 0.4);
}

.chatbot-trigger i {
  font-size: 1.25rem;
  animation: pulseGlow 2s infinite;
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: 90vw;
  height: 550px;
  max-height: 80vh;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: var(--border-glass);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal), height var(--transition-normal);
  font-family: var(--font-body);
}

.chatbot-container.chatbot-minimized {
  height: 64px !important;
}

.chatbot-container.hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

/* Chat Header */
.chatbot-header {
  position: relative;
  background: var(--gradient-primary);
  color: var(--text-inverse);
  padding: 16px 20px 32px 20px; /* Extra space for the wave at the bottom */
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  overflow: visible;
}

.chatbot-inline-container .chatbot-header {
  padding: 16px 20px 32px 20px;
}

.chatbot-header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.chatbot-avatar-container {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.chatbot-avatar-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #682bd8; /* Matches the right side of gradient header */
}

.chatbot-inline-container .chatbot-avatar-status-dot {
  border-color: #682bd8;
}

.chatbot-avatar-status-dot.online {
  background-color: #34c759;
  box-shadow: 0 0 6px #34c759;
}

.chatbot-avatar-status-dot.offline {
  background-color: #ff453a;
  box-shadow: 0 0 6px #ff453a;
}

.chatbot-profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.chatbot-profile-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-profile-status {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-header-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 1;
  pointer-events: none;
}

.chatbot-wave-path {
  fill: #ffffff;
  stroke: none;
}

.chatbot-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  flex-shrink: 0;
}

.chatbot-control-button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-control-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.chatbot-control-button i {
  font-size: 0.8rem;
}

/* Chat Messages Area */
.chatbot-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) transparent;
}

.chatbot-body::-webkit-scrollbar {
  width: 5px;
}
.chatbot-body::-webkit-scrollbar-track {
  background: transparent;
}
.chatbot-body::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--border-radius-full);
}

/* Message Bubbles */
.message {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-wrap: break-word;
  animation: messageFadeIn 0.3s ease forwards;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-message {
  background: var(--gradient-primary);
  color: #ffffff;
  align-self: flex-end;
  border-radius: 18px 18px 4px 18px; /* Tidio style */
}

.bot-message {
  background: #f4f7f9;
  color: #1d1d1f;
  align-self: flex-start;
  border-radius: 18px 18px 18px 4px; /* Tidio style */
  border: 1px solid #eef2f5;
}

/* Chatbot Feedback Rating below bot messages */
.chatbot-rating-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-left: 6px;
  margin-bottom: 8px;
  animation: messageFadeIn 0.3s ease;
  align-self: flex-start;
}

.chatbot-rating-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.chatbot-rating-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.chatbot-rating-btn:hover {
  background: #f4f7f9;
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.1);
}

.chatbot-rating-btn.active-up {
  background: rgba(52, 199, 89, 0.1);
  color: #34c759;
  border-color: #34c759;
}

.chatbot-rating-btn.active-down {
  background: rgba(255, 69, 58, 0.1);
  color: #ff453a;
  border-color: #ff453a;
}

.chatbot-rating-thanks {
  font-size: 0.68rem;
  color: #34c759;
  font-weight: 500;
  animation: messageFadeIn 0.3s ease;
}

.bot-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

.bot-link:hover {
  text-decoration: underline;
  filter: brightness(1.2);
}

/* Typing Indicator */
.bot-typing {
  background: var(--bg-glass-hover);
  border: var(--border-glass);
  padding: 12px 18px;
  border-radius: var(--border-radius-md);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  max-width: 80px;
  box-shadow: var(--shadow-sm);
}

.typing-animation {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  opacity: 0.4;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px 0;
  align-self: flex-start;
  animation: messageFadeIn 0.4s ease forwards;
}

.quick-reply {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 5px 11px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.quick-reply:hover {
  background: rgba(0, 113, 227, 0.03);
  color: #0071e3;
  border-color: #0071e3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.08);
}

/* Glassmorphism Chat Form */
.contact-form-glass {
  background: rgba(255, 255, 255, 0.03);
  border: var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-md);
  margin-top: 5px;
  animation: messageFadeIn 0.4s ease forwards;
}

.contact-form-glass input,
.contact-form-glass textarea {
  background: var(--bg-input);
  border: var(--border-glass);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font-body);
  transition: var(--transition-fast);
}

.contact-form-glass input:focus,
.contact-form-glass textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.contact-form-glass textarea {
  height: 80px;
  resize: none;
}

.contact-form-glass button {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: var(--transition-fast);
}

.contact-form-glass button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Footer Input Area Redesign */
.chatbot-footer-container {
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid #f0f0f5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.chatbot-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chatbot-left-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chatbot-input-row .chatbot-input {
  flex: 1;
  min-width: 0;
  background: #f4f7f9;
  border: 1px solid #eef2f5;
  border-radius: 20px;
  padding: 6px 12px;
  color: #1d1d1f;
  font-size: 0.82rem;
  outline: none;
  transition: all 0.2s ease;
  height: 34px;
}

.chatbot-input-row .chatbot-input:focus {
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 3px 12px rgba(0, 113, 227, 0.08);
}

.chatbot-left-actions .chatbot-action-btn {
  background: transparent;
  border: none;
  color: #8e8e93;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: all 0.2s ease;
}

.chatbot-left-actions .chatbot-action-btn:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

.chatbot-send {
  flex-shrink: 0;
  background: var(--gradient-primary);
  color: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 113, 227, 0.2);
}

.chatbot-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.chatbot-send i {
  font-size: 0.85rem;
  margin-left: 2px;
}

.chatbot-branding {
  text-align: center;
  font-size: 0.62rem;
  color: #c7c7cc;
}

.chatbot-branding a {
  color: #8e8e93;
  text-decoration: none;
  font-weight: 500;
}

.chatbot-branding a:hover {
  text-decoration: underline;
}

/* Floating Emoji Picker */
.chatbot-emoji-picker {
  position: absolute;
  bottom: 58px;
  left: 14px;
  background: #ffffff;
  border: 1px solid #eef2f5;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  z-index: 1000;
  animation: messageFadeIn 0.2s ease;
}

.chatbot-emoji-item {
  font-size: 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-emoji-item:hover {
  background: #f4f7f9;
  transform: scale(1.15);
}

.chatbot-emoji-picker.hidden {
  display: none !important;
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Mobile responsive adjustments (V4.8) */
@media (max-width: 768px) {
  .chatbot-trigger {
    position: fixed !important;
    display: flex !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
  }
  
  body.cookie-banner-active .chatbot-trigger {
    bottom: 110px !important;
  }
}

@media (max-width: 576px) {
  .chatbot-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 16px !important;
    left: 16px !important; /* Centered layout on mobile */
    width: auto !important;
    max-width: 100% !important;
    height: 440px !important;
    max-height: calc(100vh - 120px) !important;
    border-radius: var(--border-radius-md) !important;
    z-index: 100000 !important;
    box-shadow: var(--shadow-lg), 0 10px 30px rgba(0, 0, 0, 0.18) !important;
  }
  
  body.cookie-banner-active .chatbot-container {
    bottom: 110px !important;
    max-height: calc(100vh - 210px) !important;
  }
}

@media (max-width: 360px) {
  .chatbot-body {
    padding: 12px 14px !important;
  }
  .chatbot-footer {
    padding: 10px 12px !important;
  }
  .message {
    padding: 10px 14px !important;
    max-width: 90% !important;
  }
}


.chatbot-header,
.chatbot-body,
.chatbot-footer {
  position: relative;
  z-index: 2;
}

.chatbot-footer {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.chatbot-trigger.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Dedicated Inline Chatbot Section Styling (V8.0)
   ========================================================================== */

.chatbot-inline-section {
  padding: 80px 0;
  position: relative;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

/* Glowing background blobs for ambient glass reflection */
.chatbot-glow-blob-1,
.chatbot-glow-blob-2 {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.22; /* Highlighted opacity for maximum glass reflection */
}

.chatbot-glow-blob-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(104, 43, 216, 0.32) 0%, rgba(104, 43, 216, 0) 70%);
  top: 15%;
  left: 15%;
  animation: floatChatBlob1 24s infinite alternate ease-in-out;
}

.chatbot-glow-blob-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.32) 0%, rgba(0, 113, 227, 0) 70%);
  bottom: 15%;
  right: 15%;
  animation: floatChatBlob2 28s infinite alternate ease-in-out;
}

@keyframes floatChatBlob1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-20px, -40px) scale(0.9); }
}

@keyframes floatChatBlob2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, -60px) scale(1.15); }
  100% { transform: translate(40px, 20px) scale(0.9); }
}

/* Card layout of the inline info column */
.chatbot-inline-info-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 245, 250, 0.45) 100%) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all var(--transition-normal) ease;
}

.chatbot-inline-info-card:hover {
  border-color: var(--color-primary) !important;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  transform: translateY(-4px);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.info-card-header i {
  font-size: 1.8rem;
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.info-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.chatbot-inline-info-card p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Bullet list on the info card */
.info-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-card-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--border-radius-sm);
  padding: 6px 10px;
  transition: all var(--transition-normal) ease;
}

.info-card-list li:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 113, 227, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31, 38, 135, 0.04);
}

.info-card-list li i {
  font-size: 1.0rem;
  color: var(--color-primary) !important;
  margin-top: 1px;
  flex-shrink: 0;
}

.info-card-list li span {
  flex: 1;
}

.info-card-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Status indicator dot */
.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator-dot.online {
  background-color: #34c759;
  box-shadow: 0 0 10px #34c759;
  animation: pulseGreen 2s infinite;
}

.status-indicator-dot.offline {
  background-color: #ff453a;
  box-shadow: 0 0 10px #ff453a;
  animation: pulseRed 2s infinite;
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

@keyframes pulseRed {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 69, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 69, 58, 0);
  }
}

/* Inline Chat Container Card */
.chatbot-inline-container {
  width: 100%;
  max-width: 100%; /* Bounded width matching the left card */
  height: 520px; /* Fixed height on desktop to show scrollbar and prevent stretching */
  min-height: 450px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(245, 245, 250, 0.4) 100%) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
  font-family: var(--font-body);
  transition: all var(--transition-normal) ease;
}

.chatbot-inline-container:hover {
  border-color: rgba(0, 240, 255, 0.3) !important;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transform: translateY(-4px);
}

.chatbot-inline-container .chatbot-header {
  border-top-left-radius: var(--border-radius-md);
  border-top-right-radius: var(--border-radius-md);
}

/* Prevent auto-zoom on mobile text fields (iOS Safari autozooms when font-size < 16px) */
@media (max-width: 991px) {
  .chatbot-input,
  .contact-form-glass input,
  .contact-form-glass textarea,
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }
  
  .chatbot-inline-container {
    height: 460px;
    max-width: 450px; /* Constrain inline chatbot width on tablets */
    margin: 0 auto; /* Center it */
  }
  
  .chatbot-inline-info-card {
    padding: 25px;
  }
}

/* Attachment Button in Footer */
.chatbot-attachment-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transition: var(--transition-fast);
}

.chatbot-attachment-btn:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

/* Attachment Preview Panel above Footer */
.chatbot-attachment-preview {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-top: var(--border-glass);
  gap: 12px;
  position: relative;
  animation: messageFadeIn 0.3s ease forwards;
  z-index: 3;
}

.chatbot-attachment-preview.hidden {
  display: none !important;
}

.chatbot-attachment-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.chatbot-attachment-preview .remove-attachment-btn {
  position: absolute;
  top: 4px;
  left: 52px;
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
  transition: var(--transition-fast);
}

.chatbot-attachment-preview .remove-attachment-btn:hover {
  transform: scale(1.2);
  background: #ff453a;
}

/* Chat bubble styling for images sent by user */
.chat-message-image {
  display: block;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Preventivatore Card Styles */
.preventivatore-card {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: var(--border-glass);
  border-radius: var(--border-radius-lg, 24px);
  padding: 18px 20px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(139, 92, 246, 0.1);
  margin-top: 0;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  color: var(--text-primary);
  position: relative;
  z-index: 10;
}

.preventivatore-card:hover {
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 240, 255, 0.15);
}

.preventivatore-header {
  text-align: center;
  margin-bottom: 35px;
}

.preventivatore-header i {
  font-size: 2.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 15px;
  filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.2));
}

.preventivatore-header h3 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.preventivatore-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.preventivatore-body-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}

/* Form configuration */
.preventivatore-config {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.preventivatore-config .form-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.preventivatore-config .form-select,
.preventivatore-config .form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: var(--border-radius-md, 12px);
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.preventivatore-config .form-select option {
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary);
}

.preventivatore-config .form-select:focus,
.preventivatore-config .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.btn-add-quote {
  background: var(--gradient-primary);
  color: #ffffff;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--border-radius-md, 12px);
  border: none;
  font-size: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-add-quote:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3), 0 0 15px rgba(0, 240, 255, 0.2);
}

.btn-add-quote:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Riepilogo Preventivo */
.preventivatore-summary {
  display: flex;
  flex-direction: column;
}

.preventivatore-summary h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.quote-table-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md, 12px);
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
}

.quote-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quote-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.quote-item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.quote-item-details {
  font-size: 0.8rem;
  margin-top: 2px;
}

.badge-hours {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-recurring {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
  border: 1px solid rgba(255, 149, 0, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 4px;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  transition: color var(--transition-fast);
}

.btn-remove-item:hover {
  color: var(--color-danger, #ff453a);
}

.quote-config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.branches-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.branches-field label {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.quote-totals-panel {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--border-radius-md, 12px);
  padding: 20px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.totals-row.final-row {
  margin-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  margin-top: 12px;
}

.discount-price {
  color: var(--color-danger, #ff453a);
  font-weight: 700;
}

.final-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
}

.negotiation-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ff9500;
}

.small-approx {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: normal;
}

.disclaimer-row {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.disclaimer-row i {
  margin-right: 4px;
}

/* Contact and Lead Submission */
.preventivatore-contact-section {
  margin-top: 30px;
}

.section-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
}

.preventivatore-contact-section h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.lead-inputs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.lead-inputs-row .form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: var(--border-radius-md, 12px);
  padding: 12px 16px;
  font-size: 0.95rem;
}

.lead-gdpr-row .form-check-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lead-actions-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-send-quote {
  background: #34c759;
  color: #ffffff;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--border-radius-md, 12px);
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(52, 199, 89, 0.2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-send-quote:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 199, 89, 0.3), 0 0 15px rgba(52, 199, 89, 0.2);
}

.btn-book-appointment {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 13px 24px;
  border-radius: var(--border-radius-md, 12px);
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-book-appointment:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

.actions-or {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Specific details for On-Site intervention inside calc */
.onsite-details-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md, 12px);
  padding: 16px;
  margin-bottom: 20px;
}

/* Responsive grid */
@media (max-width: 991px) {
  .preventivatore-card {
    padding: 24px;
  }
  
  .preventivatore-body-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .lead-inputs-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .lead-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: center;
  }
}
