body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Background iframe styles */
.background-iframe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    z-index: -1;
    background: #f0f0f0;
}

.chatbot-fab {
  position: fixed;
  bottom: 8px;
  right: 6px;
  z-index: 9999;
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(102,126,234,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.3s;
  border: none;
  outline: none;
}

.chatbot-fab:hover {
  box-shadow: 0 16px 48px rgba(102,126,234,0.35);
  transform: scale(1.07);
}

.chatbot-fab img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.chatbot-frame-container {
  position: fixed;
  bottom: 7px;
  right: 10px;
  z-index: 10000;
  width: 400px;
  max-width: 95vw;
  height: 550px;
  max-height: 90vh;
  display: none;
  flex-direction: column;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 8px 32px rgba(102,126,234,0.18);
  border-radius: 24px;
  overflow: hidden;
  animation: chatbot-slide-in 0.4s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(16px);
}

@keyframes chatbot-slide-in {
  from { opacity: 0; transform: translateY(60px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-frame-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 18px 20px 16px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  position: relative;
}

.chatbot-frame-header img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(102,126,234,0.10);
}

.chatbot-close-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.chatbot-close-btn:hover {
  background: rgba(255,255,255,0.32);
}

.chatbot-iframe {
  flex: 1;
  border: none;
  width: 100%;
  min-height: 0;
  margin-top: -215% !important;
  background: #f8f9fa;
  margin-bottom: -14px;
}

/* Large Mobile Devices (iPhone 14 Pro Max, Samsung Galaxy S23 Ultra, etc.) */
@media (max-width: 430px) and (min-width: 390px) {
  .chatbot-frame-container {
    width: 95vw;
    height: 75vh;
    bottom: 15px;
    right: 8px;
    border-radius: 20px;
  }
  .chatbot-fab {
    right: 8px;
    bottom: 8px;
    width: 62px;
    height: 62px;
  }
  .chatbot-fab img {
    width: 32px;
    height: 32px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -240% !important;
    margin-bottom: -12px;
  }
}

/* Standard Mobile Devices (iPhone 14, Samsung Galaxy S23, etc.) */
@media (max-width: 390px) and (min-width: 375px) {
  .chatbot-frame-container {
    width: 96vw;
    height: 78vh;
    bottom: 12px;
    right: 6px;
    border-radius: 18px;
  }
  .chatbot-fab {
    right: 6px;
    bottom: 6px;
    width: 60px;
    height: 60px;
  }
  .chatbot-fab img {
    width: 30px;
    height: 30px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -250% !important;
    margin-bottom: -10px;
  }
}

/* iPhone SE, Smaller Android Devices */
@media (max-width: 375px) and (min-width: 360px) {
  .chatbot-frame-container {
    width: 97vw;
    height: 80vh;
    bottom: 10px;
    right: 5px;
    border-radius: 16px;
  }
  .chatbot-fab {
    right: 5px;
    bottom: 5px;
    width: 58px;
    height: 58px;
  }
  .chatbot-fab img {
    width: 28px;
    height: 28px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -260% !important;
    margin-bottom: -8px;
  }
}

/* Compact Mobile Devices (iPhone 12 mini, Samsung Galaxy S21, etc.) */
@media (max-width: 360px) and (min-width: 320px) {
  .chatbot-frame-container {
    width: 98vw;
    height: 82vh;
    bottom: 8px;
    right: 4px;
    border-radius: 14px;
  }
  .chatbot-fab {
    right: 4px;
    bottom: 4px;
    width: 56px;
    height: 56px;
  }
  .chatbot-fab img {
    width: 26px;
    height: 26px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -270% !important;
    margin-bottom: -6px;
  }
}

/* Very Small Mobile Devices (Older phones, budget devices) */
@media (max-width: 320px) {
  .chatbot-frame-container {
    width: 99vw;
    height: 85vh;
    bottom: 6px;
    right: 3px;
    border-radius: 12px;
  }
  .chatbot-fab {
    right: 3px;
    bottom: 3px;
    width: 54px;
    height: 54px;
  }
  .chatbot-fab img {
    width: 24px;
    height: 24px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -280% !important;
    margin-bottom: -4px;
  }
}

/* Landscape Mobile Orientation */
@media (max-height: 500px) and (orientation: landscape) {
  .chatbot-frame-container {
    width: 60vw;
    height: 90vh;
    bottom: 5px;
    right: 5px;
    border-radius: 16px;
  }
  .chatbot-fab {
    right: 5px;
    bottom: 5px;
    width: 50px;
    height: 50px;
  }
  .chatbot-fab img {
    width: 22px;
    height: 22px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -200% !important;
    margin-bottom: -10px;
  }
}

/* Tablet Portrait Mode */
@media (max-width: 768px) and (min-width: 600px) {
  .chatbot-frame-container {
    width: 380px;
    height: 600px;
    bottom: 20px;
    right: 20px;
    border-radius: 22px;
  }
  .chatbot-fab {
    right: 20px;
    bottom: 20px;
    width: 68px;
    height: 68px;
  }
  .chatbot-fab img {
    width: 36px;
    height: 36px;
  }
  .chatbot-iframe {
    width: 100%;
    margin-top: -220% !important;
    margin-bottom: -16px;
  }
}

/* High DPI Displays (Retina, AMOLED) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .chatbot-fab {
    box-shadow: 0 10px 40px rgba(102,126,234,0.3);
  }
  .chatbot-frame-container {
    box-shadow: 0 10px 40px rgba(102,126,234,0.2);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .chatbot-frame-container {
    background: rgba(30,30,30,0.9);
  }
  .chatbot-iframe {
    background: #1a1a1a;
  }
}
