/* ==========================================================================
   AI Jeju - Intelligent Client-Side Chatbot Widget Styles
   Brand Theme: Jeju Modern Luxury (Rose, Gold, Warm Slate & Glassmorphism)
   ========================================================================== */

:root {
  --ai-jeju-primary: #FF0365;
  --ai-jeju-primary-hover: #E00057;
  --ai-jeju-primary-light: #FFF0F5;
  --ai-jeju-secondary: #D4AF37;
  --ai-jeju-dark: #1A1A24;
  --ai-jeju-gray-bg: #F8F9FC;
  --ai-jeju-border: #EAEBF0;
  --ai-jeju-text: #2D3142;
  --ai-jeju-text-muted: #717588;
  --ai-jeju-shadow: 0 16px 40px -8px rgba(255, 3, 101, 0.22), 0 8px 24px -4px rgba(0, 0, 0, 0.1);
  --ai-jeju-radius: 20px;
}

/* Position Scroll-to-Top button above the Chatbot launcher */
.progress-wrap {
  bottom: 98px !important;
  right: 28px !important;
  z-index: 99990 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 576px) {
  .progress-wrap {
    bottom: 88px !important;
    right: 20px !important;
  }
}

/* Floating Launcher Button */
.ai-jeju-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
}

.ai-jeju-launcher-badge {
  background: rgba(26, 26, 36, 0.92);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: aiJejuFloat 3s ease-in-out infinite;
  white-space: nowrap;
}

.ai-jeju-launcher-badge strong {
  color: #FF75A0;
}

.ai-jeju-launcher-badge .sparkle {
  color: #FFD700;
  font-size: 14px;
}

.ai-jeju-launcher-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF0365 0%, #FF6090 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 26px;
  box-shadow: var(--ai-jeju-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.ai-jeju-launcher-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: aiJejuShimmer 4s infinite;
}

.ai-jeju-launcher:hover .ai-jeju-launcher-btn {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 20px 45px -6px rgba(255, 3, 101, 0.35);
}

.ai-jeju-launcher.active .ai-jeju-launcher-btn {
  transform: rotate(90deg);
  background: #2D3142;
}

.ai-jeju-launcher-icon-close {
  display: none;
}

.ai-jeju-launcher.active .ai-jeju-launcher-icon-open {
  display: none;
}

.ai-jeju-launcher.active .ai-jeju-launcher-icon-close {
  display: block;
}

/* Chat Window Container */
.ai-jeju-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border-radius: var(--ai-jeju-radius);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 99998;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.ai-jeju-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.ai-jeju-header {
  background: linear-gradient(135deg, #1A1A24 0%, #2A2438 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.ai-jeju-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF0365 0%, #FF75A0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 20px;
  position: relative;
  box-shadow: 0 4px 12px rgba(255, 3, 101, 0.3);
}

.ai-jeju-avatar .status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #1A1A24;
}

.ai-jeju-title-wrap h4 {
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-jeju-title-wrap .badge-ai {
  font-size: 10px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.ai-jeju-title-wrap p {
  color: #A0A3BD;
  font-size: 12px;
  margin: 2px 0 0 0;
}

.ai-jeju-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-jeju-header-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.ai-jeju-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Chat Body */
.ai-jeju-body {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
  background: var(--ai-jeju-gray-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Messages */
.ai-jeju-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: aiJejuSlideUp 0.3s ease-out;
}

.ai-jeju-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-jeju-msg.bot {
  align-self: flex-start;
}

.ai-jeju-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #FF0365, #FF6090);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-jeju-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ai-jeju-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  word-break: break-word;
}

.ai-jeju-msg.bot .ai-jeju-msg-bubble {
  background: #FFFFFF;
  border: 1px solid var(--ai-jeju-border);
  border-top-left-radius: 4px;
}

.ai-jeju-msg.user .ai-jeju-msg-bubble {
  background: linear-gradient(135deg, #FF0365 0%, #FF4585 100%);
  color: #FFFFFF;
  border-top-right-radius: 4px;
}

/* Typing Indicator */
.ai-jeju-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 18px;
  background: #FFFFFF;
  border-radius: 16px;
  border-top-left-radius: 4px;
  border: 1px solid var(--ai-jeju-border);
  width: fit-content;
}

.ai-jeju-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF0365;
  opacity: 0.4;
  animation: aiJejuBounce 1.4s infinite ease-in-out;
}

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

/* Quick Action Suggestion Chips */
.ai-jeju-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ai-jeju-chip {
  background: #FFFFFF;
  border: 1px solid #FFD0E0;
  color: #FF0365;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.ai-jeju-chip:hover {
  background: #FF0365;
  color: #FFFFFF;
  border-color: #FF0365;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 3, 101, 0.2);
}

/* Product Cards Carousel in Chat */
.ai-jeju-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.ai-jeju-product-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #EAEBF0;
  border-radius: 12px;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.ai-jeju-product-card:hover {
  border-color: #FF0365;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.ai-jeju-prod-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #F8F9FC;
}

.ai-jeju-prod-info {
  flex: 1;
  min-width: 0;
}

.ai-jeju-prod-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #1A1A24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-jeju-prod-price {
  font-size: 13px;
  font-weight: 700;
  color: #FF0365;
  margin-top: 2px;
}

.ai-jeju-prod-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #FFF0F5;
  color: #FF0365;
  text-transform: uppercase;
}

.ai-jeju-prod-btn {
  font-size: 11px;
  font-weight: 600;
  color: #FF0365;
  padding: 4px 8px;
  background: #FFF0F5;
  border-radius: 6px;
  white-space: nowrap;
}

/* Skincare Routine Step Box */
.ai-jeju-routine-box {
  background: #FFF7FA;
  border: 1px solid #FFE4EE;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}

.ai-jeju-routine-step {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.ai-jeju-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF0365;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Footer Input Area */
.ai-jeju-footer {
  padding: 14px 16px;
  background: #FFFFFF;
  border-top: 1px solid var(--ai-jeju-border);
}

.ai-jeju-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8F9FC;
  border: 1px solid var(--ai-jeju-border);
  border-radius: 30px;
  padding: 4px 6px 4px 16px;
  transition: all 0.2s;
}

.ai-jeju-input-form:focus-within {
  border-color: #FF0365;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(255, 3, 101, 0.12);
}

.ai-jeju-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--ai-jeju-text);
  outline: none;
  padding: 8px 0;
  font-family: inherit;
}

.ai-jeju-input::placeholder {
  color: #9EA2B6;
}

.ai-jeju-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FF0365;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-jeju-send-btn:hover {
  background: #E00057;
  transform: scale(1.06);
}

.ai-jeju-footer-tagline {
  font-size: 10px;
  color: #9EA2B6;
  text-align: center;
  margin-top: 6px;
}

/* Animations */
@keyframes aiJejuFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes aiJejuShimmer {
  0% { transform: translate(-100%, -100%) rotate(45deg); }
  100% { transform: translate(100%, 100%) rotate(45deg); }
}

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

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

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .ai-jeju-window {
    bottom: 84px;
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 100px);
    border-radius: 16px;
  }
  
  .ai-jeju-launcher {
    bottom: 16px;
    right: 16px;
  }
  
  .ai-jeju-launcher-badge {
    display: none;
  }
}
