/* ===== Components ===== */

/* Chatbot Widget */
.chatbot {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
  pointer-events: none;
}

.chatbot * {
  pointer-events: auto;
}

.chatbot-trigger {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-trigger:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.chatbot-panel {
  width: 340px;
  max-height: 500px;
  background: var(--chatbot-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.3s ease;
}

.chatbot-panel[hidden] {
  display: none;
}

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

.chatbot-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-header-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.chatbot-status {
  font-size: 0.7rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
}

.chatbot-header-actions {
  display: flex;
  gap: 6px;
}

.chatbot-header-actions button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
  font-size: 1rem;
}

.chatbot-header-actions button:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.chatbot-messages {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 320px;
  min-height: 200px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.5;
  animation: msgFade 0.3s ease;
}

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

.chat-msg.bot {
  align-self: flex-start;
  background: var(--chatbot-msg-bot);
  color: var(--chatbot-msg-bot-text);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--chatbot-msg-user);
  color: var(--chatbot-msg-user-text);
}

.chat-msg-time {
  font-size: 0.65rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

.chatbot-input-area input {
  flex: 1;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  transition: border-color var(--transition-fast);
}

.chatbot-input-area input:focus {
  border-color: var(--border-hover);
}

.chatbot-input-area input::placeholder {
  color: var(--text-faint);
}

.chatbot-send {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chatbot-send:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.chatbot-send svg {
  width: 16px;
  height: 16px;
}

.chatbot-hint {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-align: center;
  padding: 0 var(--space-lg) var(--space-sm);
}

/* ===== LIGHTBOX MODAL ===== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.lightbox.show {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

