/* ==========================================================================
   SELION.AI Interactive SEO Widgets Styling - Premium Glassmorphism
   ========================================================================== */

/* Variables and Theme Tokens */
:root {
  --widget-bg: rgba(18, 18, 22, 0.45);
  --widget-border: rgba(255, 255, 255, 0.08);
  --widget-glow: rgba(224, 224, 236, 0.15); /* Theme Silver accent */
  --widget-accent: #E0E0EC;
  --widget-accent-rgb: 224, 224, 236;
  --widget-text: #F1F1F4;
  --widget-text-sub: #A1A1B0;
  --widget-active-bg: rgba(224, 224, 236, 0.12);
  --widget-active-border: rgba(224, 224, 236, 0.4);
}

/* Glassmorphism Common Styles */
.glass-card {
  background: var(--widget-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--widget-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), 
              inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  color: var(--widget-text);
  font-family: inherit;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Capsule Visualizer Widget --- */
.capsule-visualizer {
  padding: 32px;
  max-width: 800px;
  margin: 40px auto;
  box-sizing: border-box;
}

.visualizer-header {
  text-align: center;
  margin-bottom: 28px;
}

.visualizer-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
  color: var(--widget-accent);
}

.visualizer-subtitle {
  font-size: 14px;
  color: var(--widget-text-sub);
  margin: 0;
}

.visualizer-dashboard {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.counter-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(224, 224, 236, 0.05);
  border: 1px solid rgba(224, 224, 236, 0.1);
  padding: 16px 40px;
  border-radius: 14px;
  min-width: 180px;
}

.counter-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--widget-accent);
  text-shadow: 0 0 15px rgba(var(--widget-accent-rgb), 0.3);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.counter-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--widget-text-sub);
}

.wardrobe-builder {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.builder-category {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--widget-text-sub);
  margin: 0 0 4px 0;
  font-weight: 600;
}

.items-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}

.item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.item-card.active {
  background: var(--widget-active-bg);
  border-color: var(--widget-active-border);
  box-shadow: 0 0 12px rgba(var(--widget-accent-rgb), 0.12);
}

.item-card.active .item-icon {
  transform: scale(1.15);
}

.item-icon {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.item-name {
  font-size: 13px;
  font-weight: 500;
}

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

.visualizer-button {
  display: inline-block;
  background: var(--widget-accent);
  color: #121216;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.visualizer-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--widget-accent-rgb), 0.4);
}

/* --- AI Stylist Chat Widget --- */
.stylist-chat {
  display: flex;
  flex-direction: column;
  height: 520px;
  max-width: 500px;
  margin: 40px auto;
  box-sizing: border-box;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--widget-border);
}

.stylist-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #fff 0%, var(--widget-accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 10px rgba(var(--widget-accent-rgb), 0.2);
}

.stylist-status-info {
  display: flex;
  flex-direction: column;
}

.stylist-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--widget-text);
}

.stylist-status-text {
  font-size: 11px;
  color: #10B981; /* Green active status dot */
  display: flex;
  align-items: center;
  gap: 4px;
}

.stylist-status-text::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Message Styles */
.chat-message {
  display: flex;
  max-width: 85%;
  animation: messageFadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.message-bubble {
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
}

.chat-message.bot .message-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--widget-border);
  border-radius: 2px 14px 14px 14px;
}

.chat-message.user .message-bubble {
  background: var(--widget-active-bg);
  border: 1px solid var(--widget-active-border);
  border-radius: 14px 14px 2px 14px;
}

.chat-cta-link {
  display: inline-block;
  color: var(--widget-accent);
  text-decoration: none;
  font-weight: 600;
  margin-top: 8px;
  font-size: 12.5px;
  transition: opacity 0.2s ease;
}

.chat-cta-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  align-self: flex-start;
}

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

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

.typing-label {
  font-size: 11px;
  color: var(--widget-text-sub);
  margin-left: 4px;
}

/* Quick Prompts */
.chat-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 16px 20px;
  transition: all 0.3s ease;
}

.chat-prompt-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--widget-border);
  border-radius: 8px;
  color: var(--widget-text-sub);
  font-size: 12px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.chat-prompt-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--widget-text);
  transform: translateX(2px);
}

/* Chat Input Form */
.chat-input-area {
  display: flex;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--widget-border);
  gap: 10px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--widget-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--widget-text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--widget-active-border);
}

.chat-send-btn {
  background: var(--widget-accent);
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #121216;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Responsive grid for visualizer card rows */
@media (max-width: 600px) {
  .items-row {
    grid-template-columns: 1fr;
  }
  .capsule-visualizer {
    padding: 20px;
  }
  .counter-display {
    padding: 12px 24px;
  }
  .stylist-chat {
    height: 480px;
  }
}
