/* Compact Widget Styles for Graxo Chatbot */

:root {
  --primary-red: #890339;
  --dark-red: #4b0c24;
  --light-red: #a90544;
  --accent-red: #c86d90;
  --black: #000000;
  --dark-gray: #1f1f1f;
  --medium-gray: #374151;
  --light-gray: #6b7280;
  --white: #ffffff;
  --off-white: #f9fafb;
  --border-light: #e5e7eb;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 20px 25px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
  color: var(--white);
  height: 100vh;
  line-height: 1.5;
  overflow: hidden;
}

.widget-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.section {
  display: none;
  height: 100%;
}

.section.active {
  display: flex;
  flex-direction: column;
}

/* Chatbot Container */
.chatbot-container {
  background: transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Splash Screen */
.splash-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
}

.splash-content {
  text-align: center;
  max-width: 320px;
  width: 100%;
  animation: fadeInUp 0.6s ease-out;
}

.splash-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-red), var(--light-red));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(137, 3, 57, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

.splash-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, var(--white) 0%, var(--accent-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.splash-subtitle {
  font-size: 0.875rem;
  color: var(--light-gray);
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.splash-button {
  background: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(137, 3, 57, 0.3);
  position: relative;
  overflow: hidden;
}

.splash-button::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;
}

.splash-button:hover::before {
  left: 100%;
}

.splash-button:hover {
  background: var(--light-red);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(137, 3, 57, 0.5);
}

.splash-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 12px rgba(137, 3, 57, 0.4);
}

.splash-button i {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.splash-button:hover i {
  transform: translateX(3px);
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(137, 3, 57, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 28px rgba(137, 3, 57, 0.6);
  }
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--black);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--light-red);
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  animation: slideIn 0.3s ease;
  scroll-margin-top: 15px; /* Breathing room from top of widget */
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.message.bot .message-avatar {
  background: var(--primary-red);
  color: var(--white);
}

.message.user .message-avatar {
  background: var(--white);
  color: var(--black);
}

.message-content {
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.875rem;
  position: relative;
  word-wrap: break-word;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.message.bot .message-content {
  background: var(--medium-gray);
  color: var(--white);
  border-bottom-left-radius: 0.25rem;
}

.message.user .message-content {
  background: var(--primary-red);
  color: var(--white);
  border-bottom-right-radius: 0.25rem;
}

.message-time {
  font-size: 0.625rem;
  opacity: 0.5;
  margin-top: 0.25rem;
}

/* Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.option-btn {
  background: var(--primary-red);
  color: var(--white);
  border: 1.5px solid var(--primary-red);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
}

.option-btn:hover {
  background: var(--light-red);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(169, 5, 68, 0.4);
  border-color: var(--light-red);
}

.option-btn.selected {
  background: var(--primary-red);
  color: var(--white);
}

/* Chat Input */
.chat-input-container {
  padding: 0.5rem;
  background: transparent;
  flex-shrink: 0;
}

.typing-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 0.5rem 0.75rem !important;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--white);
  border-radius: 50%;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-input {
  display: flex;
  align-items: center;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(107, 114, 128, 0.2);
  border-radius: 1.25rem;
  padding: 0.35rem 0.35rem 0.35rem 0.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.chat-input:focus-within {
  border-color: rgba(137, 3, 57, 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(137, 3, 57, 0.15);
}

#userInput {
  flex: 1;
  padding: 0.4rem 0;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 0.8125rem;
  outline: none;
}

#userInput::placeholder {
  color: var(--light-gray);
}

#sendButton {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary-red);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

#sendButton:hover:not(:disabled) {
  background: var(--dark-red);
  transform: scale(1.05);
}

#sendButton:disabled {
  background: var(--medium-gray);
  cursor: not-allowed;
  transform: none;
}

/* Contact Form in Chat */
.contact-form {
  background: var(--dark-gray);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--primary-red);
  margin-top: 0.5rem;
}

.contact-form h3 {
  color: var(--white);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
}

.contact-form p {
  color: var(--light-gray);
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
  line-height: 1.3;
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--white);
  font-size: 0.75rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--medium-gray);
  border-radius: 0.5rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.75rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 2px rgba(137, 3, 57, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--light-gray);
}

.submit-btn {
  background: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.submit-btn:hover {
  background: var(--dark-red);
  transform: translateY(-1px);
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingAnimation {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.start-btn {
  align-self: center;
  background: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.start-btn:hover {
  background: var(--dark-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

.start-btn i {
  font-size: 1rem;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
