/* Chatbot Styles */

.rockship-chatbot-container {
  position: fixed;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Pulsing animation for chat button to make it more visible */

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.7);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  }
}

.rockship-floating-button {
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
  transition: all 0.3s ease !important;
  -webkit-user-select: none !important;
     -moz-user-select: none !important;
          user-select: none !important;
  font-size: 24px !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Remove pulsing animation and hover effect for chat button */

.rockship-floating-button:hover {
  /* No transform or box-shadow on hover */
}

.rockship-floating-button:before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%) !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.rockship-floating-button:hover:before {
  opacity: 1 !important;
}

.rockship-floating-button:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rockship-floating-button:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.rockship-floating-button:hover:before {
  opacity: 1;
}

.rockship-floating-button.dragging {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
  transition: none;
  /* Remove transition during dragging for immediate response */
  z-index: 10001;
  /* Ensure it stays on top while dragging */
}

/* Chatbox styles */

.rockship-chatbox {
  position: absolute;
  right: 70px;
  bottom: 0;
  width: 400px;
  height: 600px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.rockship-chatbox.open {
  display: flex;
  transform: scale(1) translateY(0);
}

.rockship-chatbox-header {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.rockship-chatbox-header:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
}

.rockship-chatbox-title {
  font-weight: 600;
  font-size: 18px;
  position: relative;
  z-index: 1;
}

.rockship-chatbox-actions {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.rockship-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}

.rockship-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Minimized state styles */

.rockship-floating-button.minimized {
  width: 40px;
  height: 40px;
  right: 0;
  border-radius: 50% 0 0 50%;
  transform: translateX(20px);
  font-size: 16px;
  animation: slideToEdge 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
  z-index: 10000;
}

.rockship-floating-button.minimized:hover {
  transform: translateX(15px) scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.rockship-chatbot-container.minimized {
  right: 0 !important;
}

@keyframes slideToEdge {
  from {
    transform: translateX(0);
    border-radius: 50%;
  }

  to {
    transform: translateX(20px);
    border-radius: 50% 0 0 50%;
  }
}

@keyframes slideFromEdge {
  from {
    transform: translateX(20px);
    border-radius: 50% 0 0 50%;
  }

  to {
    transform: translateX(0);
    border-radius: 50%;
  }
}

.rockship-floating-button.expanding {
  animation: slideFromEdge 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Messages container styles */

.rockship-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8f9fa;
  position: relative;
}

.rockship-messages-container::-webkit-scrollbar {
  width: 6px;
}

.rockship-messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.rockship-messages-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Markdown styling */

.markdown-content {
  line-height: 1.3;
}

.markdown-content h1 {
  font-size: 1.4rem;
  font-weight: bold;
  margin: 0.8rem 0 0.4rem 0;
  line-height: 1.3;
}

.markdown-content h2 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0.7rem 0 0.35rem 0;
  line-height: 1.3;
}

.markdown-content h3 {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0.6rem 0 0.3rem 0;
  line-height: 1.3;
}

.markdown-content p {
  margin: 0.3rem 0;
  line-height: 1.3;
}

.markdown-content ul,
.markdown-content ol {
  margin: 0.2rem 0 0.3rem 1.2rem;
  padding: 0;
}

.markdown-content ul {
  list-style-type: disc;
}

.markdown-content ol {
  list-style-type: decimal;
}

.markdown-content li {
  margin: 0.15rem 0;
  padding: 0;
  line-height: 1.3;
}

.markdown-content a {
  color: #007bff;
  text-decoration: underline;
}

.markdown-content code {
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  line-height: 1.2;
  font-size: 0.9em;
}

.markdown-content pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

.markdown-content blockquote {
  border-left: 3px solid #e9ecef;
  padding-left: 0.8rem;
  color: #6c757d;
  margin-left: 0.5rem;
  margin-bottom: 0.5rem;
}

.markdown-content table {
  border-collapse: collapse;
  margin-bottom: 0.5rem;
  width: 100%;
}

.markdown-content table th,
.markdown-content table td {
  border: 1px solid #e9ecef;
  padding: 0.3rem 0.5rem;
}

.markdown-content table th {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: bold;
}

/* Message styles */

.rockship-message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rockship-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 8px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.rockship-message.assistant {
  align-self: flex-start;
  background: white;
  color: #333;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Input container styles */

.rockship-input-container {
  padding: 20px;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 12px;
  background: white;
  align-items: flex-end;
}

.rockship-message-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  resize: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.rockship-message-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rockship-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 18px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.rockship-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.rockship-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading indicator styles */

.rockship-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  align-self: center;
  gap: 8px;
  color: #666;
  font-size: 13px;
  font-weight: 600;
}

/* Typing indicator should be left-aligned */

.rockship-typing {
  justify-content: flex-start;
  align-self: flex-start;
}

.rockship-loading-messages {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
}

.rockship-loading-spinner {
  color: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.rockship-message {
  background: white;
  border-radius: 20px;
  align-self: flex-start;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-bottom-left-radius: 8px;
  animation: messageSlide 0.3s ease-out;
  margin-top: 8px;
  margin-bottom: 8px;
}

.rockship-loading-dots {
  display: flex;
  gap: 3px;
}

.rockship-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #667eea;
  animation: bounce 1.4s infinite ease-in-out both;
}

.rockship-loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.rockship-loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Error and welcome message styles */

.rockship-error {
  color: #dc3545;
  font-size: 13px;
  padding: 12px 18px;
  background: #f8d7da;
  border-radius: 12px;
  margin: 8px 0;
  border-left: 4px solid #dc3545;
  animation: messageSlide 0.3s ease-out;
}

.rockship-welcome-message {
  text-align: center;
  color: #666;
  font-size: 15px;
  padding: 30px 20px;
  font-style: italic;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-radius: 16px;
  border: 2px dashed rgba(102, 126, 234, 0.2);
}

/* Utility classes with !important */

.fixed {
  position: fixed !important;
}

.flex {
  display: flex !important;
}

.flex-1 {
  flex: 1 1 0% !important;
}

.flex-col {
  flex-direction: column !important;
}

.items-center {
  align-items: center !important;
}

.items-end {
  align-items: flex-end !important;
}

.justify-start {
  justify-content: flex-start !important;
}

.justify-end {
  justify-content: flex-end !important;
}

.justify-center {
  justify-content: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

/* Spacing */

.p-2 {
  padding: 0.5rem !important;
}

.p-4 {
  padding: 1rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.pt-2 {
  padding-top: 0.5rem;
}

.pb-4 {
  padding-bottom: 1rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Sizing */

.w-4 {
  width: 1rem;
}

.w-6 {
  width: 1.5rem;
}

.w-8 {
  width: 2rem;
}

.w-12 {
  width: 3rem;
}

.w-14 {
  width: 3.5rem;
}

.w-80 {
  width: 20rem;
}

.h-4 {
  height: 1rem;
}

.h-6 {
  height: 1.5rem;
}

.h-8 {
  height: 2rem;
}

.h-12 {
  height: 3rem;
}

.h-14 {
  height: 3.5rem;
}

.h-24 {
  height: 6rem;
}

.h-96 {
  height: 24rem;
}

.h-full {
  height: 100%;
}

.max-w-\[80\%\] {
  max-width: 80%;
}

.max-h-24 {
  max-height: 6rem;
}

/* Positioning */

.top-4 {
  top: 1rem;
}

.right-4 {
  right: 1rem;
}

.bottom-4 {
  bottom: 1rem;
}

.bottom-20 {
  bottom: 5rem;
}

.left-4 {
  left: 1rem;
}

.z-40 {
  z-index: 40;
}

.z-50 {
  z-index: 50;
}

/* Layout */

.order-1 {
  order: 1;
}

.order-2 {
  order: 2;
}

.overflow-y-auto {
  overflow-y: auto;
}

.resize-none {
  resize: none;
}

/* Appearance */

.rounded-lg {
  border-radius: 0.5rem !important;
}

.rounded-full {
  border-radius: 9999px;
}

.rounded-bl-none {
  border-bottom-left-radius: 0px;
}

.rounded-br-none {
  border-bottom-right-radius: 0px;
}

.border {
  border-width: 1px !important;
  border-color: #e5e7eb !important;
}

.border-t {
  border-top-width: 1px;
  border-top-color: #e5e7eb;
}

.border-b {
  border-bottom-width: 1px;
  border-bottom-color: #e5e7eb;
}

/* Colors */

.bg-white {
  background-color: #ffffff !important;
}

.bg-gray-50 {
  background-color: #f9fafb;
}

.bg-opacity-20 {
  background-color: rgba(255, 255, 255, 0.2);
}

.text-white {
  color: #ffffff;
}

.text-gray-500 {
  color: #6b7280;
}

/* Text */

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.leading-relaxed {
  line-height: 1.625;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

.break-words {
  word-wrap: break-word;
}

/* Opacity */

.opacity-50 {
  opacity: 0.5 !important;
}

.opacity-75 {
  opacity: 0.75;
}

.opacity-90 {
  opacity: 0.9;
}

/* Cursor */

.cursor-not-allowed {
  cursor: not-allowed;
}

/* Hover effects */

.hover\:bg-white:hover {
  background-color: #ffffff;
}

.hover\:bg-opacity-20:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Disabled states */

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

.disabled\:cursor-not-allowed:disabled {
  cursor: not-allowed;
}

/* Scroll behavior */

.scroll-smooth {
  scroll-behavior: smooth;
}

/* Gap */

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

/* Min height */

.min-h-0 {
  min-height: 0px;
}

/* Animation keyframes */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Scrollbar styling */

.rockship-chatbot ::-webkit-scrollbar {
  width: 6px;
}

.rockship-chatbot ::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.rockship-chatbot ::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.rockship-chatbot ::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Custom resize handle */

.rockship-resize-handle {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  cursor: nw-resize;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  transition: all 0.2s ease;
}

.rockship-resize-handle:hover {
  background: rgba(255, 255, 255, 0.3);
}
