/**
 * Çözüyo AI Chatbot Widget Styles
 * Modern, responsive chat widget with purple gradient theme
 */

/* ============================================
   CHATBOT TOGGLE BAR (Yatay)
   ============================================ */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 280px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-purple), var(--accent-purple));
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(123, 44, 191, 0.3);
  transition: all 0.3s ease;
  z-index: 9998;
}

.chatbot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(123, 44, 191, 0.4);
}

.chatbot-toggle--hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.chatbot-toggle__icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-toggle__icon svg {
  color: var(--white);
  width: 20px;
  height: 20px;
}

.chatbot-toggle__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-toggle__title {
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.chatbot-toggle__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.chatbot-toggle__status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chatbot-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary-blue);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  border: 2px solid var(--white);
}

/* ============================================
   CHATBOT WINDOW
   ============================================ */
.chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9999;
  overflow: hidden;
}

.chatbot-window--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ============================================
   CHATBOT HEADER
   ============================================ */
.chatbot-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: var(--white);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px 16px 0 0;
}

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

.chatbot-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.chatbot-avatar svg {
  color: var(--white);
}

.chatbot-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--white);
}

.chatbot-status {
  font-size: 0.75rem;
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.chatbot-close {
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   CHATBOT MESSAGES
   ============================================ */
.chatbot-messages {
  flex: 1;
  padding: var(--spacing-md);
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Custom scrollbar */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   MESSAGE BUBBLES
   ============================================ */
.chatbot-message {
  display: flex;
  margin-bottom: 8px;
  animation: messageSlideIn 0.3s ease-out;
}

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

.chatbot-message--user {
  justify-content: flex-end;
}

.chatbot-message--bot {
  justify-content: flex-start;
}

.chatbot-message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  position: relative;
}

.chatbot-message--user .chatbot-message-content {
  background: linear-gradient(135deg, var(--primary-purple), var(--accent-purple));
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chatbot-message--bot .chatbot-message-content {
  background: var(--white);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chatbot-message-content p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-message-time {
  font-size: 0.6875rem;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s ease-in-out infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ============================================
   CHATBOT INPUT
   ============================================ */
.chatbot-input-wrapper {
  background: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: var(--spacing-sm) var(--spacing-md);
}

.chatbot-form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s;
  background: #f8f9fa;
}

.chatbot-input:focus {
  border-color: var(--primary-purple);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.1);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-purple), var(--accent-purple));
  border: none;
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(123, 44, 191, 0.3);
}

.chatbot-send:active {
  transform: scale(0.95);
}

.chatbot-footer-text {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  margin: 0;
  opacity: 0.8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .chatbot-window {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
  }

  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
    left: 16px;
    min-width: auto;
    height: 56px;
  }

  .chatbot-toggle__title {
    font-size: 0.875rem;
  }

  .chatbot-toggle__status {
    font-size: 0.6875rem;
  }

  .chatbot-header {
    border-radius: 0;
  }

  .chatbot-message-content {
    max-width: 85%;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .chatbot-window,
  .chatbot-toggle,
  .chatbot-message {
    animation: none;
    transition: none;
  }
}

/* Focus visible for keyboard navigation */
.chatbot-toggle:focus-visible,
.chatbot-close:focus-visible,
.chatbot-send:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}
