/* ==========================================================================
   Professional CurlSek AI Chatbot Styles
   ========================================================================== */

:root {
  /* Chatbot specific variables */
  --chatbot-width: 480px; /* Increased width from 420px */
  --chatbot-height: 700px; /* Increased height from 650px */
  --chatbot-border-radius: 16px;
  --chatbot-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
  --chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --chatbot-z-index: 9999;
}

/* ==========================================================================
   Chatbot Toggle Button
   ========================================================================== */

.chatbot__toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--chatbot-z-index);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--color-primary-pink) 0%, var(--color-accent-purple) 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--chatbot-transition);
  box-shadow: var(--chatbot-shadow);
  font-family: var(--font-family-primary);
  font-weight: 600;
  font-size: 0.875rem;
  backdrop-filter: blur(12px);
  user-select: none;
  max-width: 200px;
}

.chatbot__toggle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 40px rgba(225, 40, 172, 0.3);
}

.chatbot__toggle:active {
  transform: translateY(0) scale(0.98);
}

.chatbot__toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot__toggle-text {
  font-weight: 600;
  white-space: nowrap;
}

.chatbot__notification {
  display: none; /* Hide notification badge */
}

/* Notification animation removed */

/* ==========================================================================
   Chatbot Modal Container
   ========================================================================== */

.chatbot {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: var(--chatbot-z-index);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: var(--chatbot-transition);
  pointer-events: none;
}

.chatbot[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chatbot__overlay {
  display: none; /* Remove overlay for side widget */
}

.chatbot__container {
  position: relative;
  width: var(--chatbot-width);
  height: var(--chatbot-height);
  background: white;
  border-radius: var(--chatbot-border-radius);
  box-shadow: var(--chatbot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

/* ==========================================================================
   Chatbot Header
   ========================================================================== */

.chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--color-primary-pink) 0%, var(--color-accent-purple) 100%);
  color: white;
  border-radius: var(--chatbot-border-radius) var(--chatbot-border-radius) 0 0;
  position: relative;
}

.chatbot__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

.chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot__avatar-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.chatbot__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: white;
}

.chatbot__subtitle {
  font-size: 0.8rem;
  margin: 0;
  opacity: 0.9;
  color: white;
}

.chatbot__close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--chatbot-transition);
  font-weight: 300;
}

.chatbot__close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* ==========================================================================
   Chatbot Body
   ========================================================================== */

.chatbot__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg-light);
}

/* Welcome Screen */
.chatbot__welcome {
  padding: 20px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
}

.chatbot__welcome-content {
  margin-bottom: 20px;
  flex-shrink: 0;
}

.chatbot__welcome-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-primary-pink) 0%, var(--color-accent-purple) 100%);
  color: white;
  border-radius: 50%;
  margin: 0 auto 16px;
}

.chatbot__welcome-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0 0 8px;
}

.chatbot__welcome-description {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin: 0;
}

/* Categories Grid */
.chatbot__categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

.chatbot__category {
  padding: 12px 16px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--chatbot-transition);
  text-align: left;
  position: relative;
  overflow: hidden;
  min-height: 70px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.chatbot__category::before {
  display: none; /* Remove the top border effect */
}

.chatbot__category:hover {
  border-color: var(--color-primary-pink);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(225, 40, 172, 0.1);
}

.chatbot__category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-primary-pink) 0%, var(--color-accent-purple) 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 8px;
}

.chatbot__category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin: 0 0 4px;
}

.chatbot__category-description {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   Chat Messages
   ========================================================================== */

.chatbot__messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.chatbot__messages.active {
  display: flex;
}

/* Message Styles */
.chatbot__message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 85%;
  animation: slideInMessage 0.3s ease;
}

.chatbot__message--bot {
  align-self: flex-start;
}

.chatbot__message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

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

.chatbot__message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-pink) 0%, var(--color-accent-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.chatbot__message-avatar img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.chatbot__message--user .chatbot__message-avatar {
  background: var(--color-text-light);
}

.chatbot__message-content {
  background: white;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(225, 40, 172, 0.1);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chatbot__message--user .chatbot__message-content {
  background: linear-gradient(135deg, rgba(225, 40, 172, 0.9) 0%, rgba(146, 19, 241, 0.9) 100%);
  color: white;
  border-color: transparent;
}

.chatbot__message-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  color: var(--color-text-dark);
}

.chatbot__message--user .chatbot__message-text {
  color: white;
}

/* Question Options */
.chatbot__options {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot__option {
  padding: 12px 16px;
  background: rgba(225, 40, 172, 0.05);
  border: 1px solid rgba(225, 40, 172, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--chatbot-transition);
  font-size: 0.85rem;
  text-align: left;
  color: var(--color-text-dark);
  font-weight: 500;
}

.chatbot__option:hover {
  background: rgba(225, 40, 172, 0.1);
  border-color: rgba(225, 40, 172, 0.3);
  color: var(--color-text-dark);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(225, 40, 172, 0.1);
}

.chatbot__option--contact {
  background: rgba(146, 19, 241, 0.05);
  border-color: rgba(146, 19, 241, 0.15);
  font-style: italic;
}

.chatbot__option--contact:hover {
  background: rgba(146, 19, 241, 0.1);
  border-color: rgba(146, 19, 241, 0.3);
}

/* Contact Info Display */
.chatbot__contact-info {
  background: linear-gradient(135deg, rgba(225, 40, 172, 0.05) 0%, rgba(146, 19, 241, 0.05) 100%);
  border: 1px solid rgba(225, 40, 172, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}

.chatbot__contact-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary-pink);
  margin: 0 0 16px;
  text-align: center;
  border-bottom: 1px solid rgba(225, 40, 172, 0.2);
  padding-bottom: 8px;
}

.chatbot__contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-text-dark);
  transition: var(--chatbot-transition);
}

.chatbot__contact-item:last-child {
  margin-bottom: 0;
}

.chatbot__contact-item:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(225, 40, 172, 0.1);
  transform: translateY(-1px);
}

.chatbot__contact-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary-pink);
  flex-shrink: 0;
}

.chatbot__contact-item strong {
  color: var(--color-text-dark);
  font-weight: 600;
  min-width: 60px;
}

.chatbot__contact-item span {
  color: var(--color-text-light);
}

/* Contact Action Button */
.chatbot__contact-action {
  margin-top: 16px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(225, 40, 172, 0.2);
}

.chatbot__contact-btn {
  padding: 8px 16px;
  background: var(--color-primary-pink);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--chatbot-transition);
  text-decoration: none;
  display: inline-block;
}

.chatbot__contact-btn:hover {
  background: var(--color-accent-purple);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 40, 172, 0.3);
}

/* ==========================================================================
   Chatbot Footer
   ========================================================================== */

.chatbot__footer {
  padding: 16px 24px;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}

.chatbot__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.chatbot__action-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: white;
  color: var(--color-text-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--chatbot-transition);
  border: 1px solid var(--color-border);
}

.chatbot__action-btn:hover {
  background: var(--color-primary-pink);
  color: white;
  border-color: var(--color-primary-pink);
  transform: translateY(-2px);
}

/* ==========================================================================
   Loading Animation
   ========================================================================== */

.chatbot__typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

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

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

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .chatbot {
    bottom: 80px;
    right: 16px;
    left: 16px;
  }
  
  .chatbot__container {
    width: 100%;
    height: 600px; /* Increased mobile height */
    max-width: 450px; /* Increased mobile max-width */
    margin: 0 auto;
  }
  
  .chatbot__toggle {
    bottom: 16px;
    right: 16px;
    padding: 12px 16px;
  }
  
  .chatbot__toggle-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .chatbot {
    bottom: 80px;
    right: 8px;
    left: 8px;
  }
  
  .chatbot__container {
    width: 100%;
    height: 500px; /* Increased small mobile height */
    border-radius: 12px;
  }
  
  .chatbot__header {
    border-radius: 12px 12px 0 0;
  }
}

/* ==========================================================================
   Accessibility & Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .chatbot,
  .chatbot__container,
  .chatbot__category,
  .chatbot__option,
  .chatbot__toggle {
    transition: none;
  }
  
  .chatbot__notification {
    animation: none;
  }
  
  .chatbot__typing-dot {
    animation: none;
  }
}

/* Focus indicators */
.chatbot__category:focus,
.chatbot__option:focus,
.chatbot__action-btn:focus,
.chatbot__close:focus,
.chatbot__toggle:focus {
  outline: 2px solid var(--color-primary-pink);
  outline-offset: 2px;
}

/* Custom Scrollbar Styling */
.chatbot__welcome::-webkit-scrollbar,
.chatbot__categories::-webkit-scrollbar,
.chatbot__messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot__welcome::-webkit-scrollbar-track,
.chatbot__categories::-webkit-scrollbar-track,
.chatbot__messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 2px;
}

.chatbot__welcome::-webkit-scrollbar-thumb,
.chatbot__categories::-webkit-scrollbar-thumb,
.chatbot__messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.chatbot__welcome::-webkit-scrollbar-thumb:hover,
.chatbot__categories::-webkit-scrollbar-thumb:hover,
.chatbot__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Firefox scrollbar styling */
.chatbot__welcome,
.chatbot__categories,
.chatbot__messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.02);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chatbot__container {
    border: 2px solid var(--color-text-dark);
  }
  
  .chatbot__category,
  .chatbot__option,
  .chatbot__message-content {
    border-width: 2px;
  }
}
