/* ==========================================================================
   CIRAKU AI ASSISTANT (CiraBot) WIDGET STYLES
   ========================================================================== */

:root {
  --ciraku-primary: #ff8c00;
  --ciraku-primary-hover: #ffa500;
  --ciraku-gold: #fbbf24;
  --ciraku-dark-bg: #0f1015;
  --ciraku-card-bg: rgba(26, 27, 35, 0.95);
  --ciraku-border: rgba(251, 191, 36, 0.25);
  --ciraku-text-light: #f8fafc;
  --ciraku-text-muted: #94a3b8;
  --ciraku-bot-bubble: rgba(36, 38, 50, 0.9);
  --ciraku-user-bubble: linear-gradient(135deg, #ff8c00 0%, #d97706 100%);
  --ciraku-radius-lg: 20px;
  --ciraku-radius-md: 14px;
  --ciraku-radius-sm: 8px;
}

/* Container Floating Widget */
.ciraku-ai-widget-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* FAB & Greeting Bubble Container */
.ciraku-fab-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

/* Mascot Button */
.ciraku-ai-fab {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e1e24 0%, #111115 100%);
  border: 3px solid var(--ciraku-gold);
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.35), 0 0 15px rgba(255, 140, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cirakuFloat 3.5s ease-in-out infinite;
}

.ciraku-ai-fab:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(251, 191, 36, 0.55), 0 0 25px rgba(255, 140, 0, 0.4);
}

.ciraku-ai-fab img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.ciraku-ai-fab:hover img {
  transform: scale(1.08);
}

/* Online Badge Dot on Mascot */
.ciraku-online-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #22c55e;
  border: 2.5px solid #111;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

/* Floating Greeting Speech Balloon */
.ciraku-greeting-bubble {
  background: rgba(18, 20, 29, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fff;
  padding: 10px 16px;
  border-radius: 16px 16px 16px 4px;
  font-size: 13px;
  font-weight: 500;
  max-width: 220px;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  margin-bottom: 8px;
  animation: cirakuFadeInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.ciraku-greeting-bubble::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 10px 0;
  border-color: transparent rgba(18, 20, 29, 0.92) transparent transparent;
}

.ciraku-greeting-bubble:hover {
  transform: translateY(-2px);
  border-color: var(--ciraku-gold);
}

/* ==========================================================================
   POPUP CHAT WINDOW
   ========================================================================== */
.ciraku-chat-window {
  position: absolute;
  bottom: 84px;
  left: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--ciraku-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--ciraku-border);
  border-radius: var(--ciraku-radius-lg);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(251, 191, 36, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  transform-origin: bottom left;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
}

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

/* Chat Header */
.ciraku-chat-header {
  background: linear-gradient(135deg, #171821 0%, #1e1f2b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.ciraku-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ciraku-header-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #252634;
  border: 2px solid var(--ciraku-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ciraku-header-avatar img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.ciraku-header-info h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ciraku-header-info h5 span {
  color: var(--ciraku-gold);
}

.ciraku-header-info p {
  margin: 0;
  font-size: 11px;
  color: var(--ciraku-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ciraku-status-dot {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #22c55e;
}

.ciraku-chat-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ciraku-chat-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Chat Body (Message Container) */
.ciraku-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  background: radial-gradient(circle at 10% 20%, rgba(255, 140, 0, 0.03) 0%, transparent 60%);
}

.ciraku-chat-body::-webkit-scrollbar {
  width: 5px;
}

.ciraku-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.ciraku-chat-body::-webkit-scrollbar-thumb:hover {
  background: rgba(251, 191, 36, 0.3);
}

/* Message Rows */
.ciraku-message-row {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: cirakuMsgPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.ciraku-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1e1f2b;
  border: 1.5px solid var(--ciraku-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ciraku-msg-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Message Bubble */
.ciraku-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--ciraku-radius-md);
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ciraku-message-row.bot .ciraku-msg-bubble {
  background: var(--ciraku-bot-bubble);
  color: var(--ciraku-text-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
}

.ciraku-message-row.user .ciraku-msg-bubble {
  background: var(--ciraku-user-bubble);
  color: #fff;
  border-top-right-radius: 4px;
  font-weight: 500;
}

.ciraku-msg-bubble p:last-child {
  margin-bottom: 0;
}

.ciraku-msg-bubble ul, .ciraku-msg-bubble ol {
  margin: 6px 0 6px 18px;
  padding: 0;
}

.ciraku-msg-bubble strong {
  color: var(--ciraku-gold);
}

.ciraku-message-row.user .ciraku-msg-bubble strong {
  color: #fff;
}

/* Quick Suggestion Pills Container */
.ciraku-suggestions-card {
  background: rgba(22, 24, 32, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--ciraku-radius-md);
  padding: 12px;
  margin-bottom: 4px;
  animation: cirakuMsgPop 0.35s ease forwards;
}

.ciraku-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ciraku-suggestions-header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ciraku-gold);
}

.ciraku-suggestions-hide {
  background: none;
  border: none;
  color: var(--ciraku-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.ciraku-suggestions-hide:hover {
  color: #fff;
}

.ciraku-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ciraku-suggestion-chip {
  background: rgba(38, 40, 52, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ciraku-suggestion-chip:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--ciraku-gold);
  color: var(--ciraku-gold);
  transform: translateX(4px);
}

/* Typing Indicator Animation */
.ciraku-typing-row {
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: flex-start;
}

.ciraku-typing-bubble {
  background: var(--ciraku-bot-bubble);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

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

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

/* Chat Input Footer */
.ciraku-chat-footer {
  padding: 12px 14px;
  background: #14151d;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ciraku-input-group {
  display: flex;
  align-items: center;
  background: #1f202b;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  padding: 4px 6px 4px 14px;
  transition: all 0.25s ease;
}

.ciraku-input-group:focus-within {
  border-color: var(--ciraku-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
  background: #242633;
}

.ciraku-input-icon {
  color: var(--ciraku-gold);
  font-size: 15px;
  margin-right: 8px;
  opacity: 0.85;
}

.ciraku-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}

.ciraku-chat-input::placeholder {
  color: #64748b;
}

.ciraku-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8c00 0%, #d97706 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.ciraku-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.5);
}

.ciraku-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ciraku-footer-powered {
  text-align: center;
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
}

.ciraku-footer-powered span {
  color: var(--ciraku-gold);
  font-weight: 600;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================= */
@keyframes cirakuFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes cirakuFadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE ADAPTATION)
   ========================================================================== */
@media (max-width: 576px) {
  .ciraku-ai-widget-wrapper {
    bottom: 16px;
    left: 16px;
  }

  .ciraku-ai-fab {
    width: 60px;
    height: 60px;
  }

  .ciraku-ai-fab img {
    width: 44px;
    height: 44px;
  }

  .ciraku-greeting-bubble {
    font-size: 12px;
    max-width: 170px;
    padding: 8px 12px;
  }

  .ciraku-chat-window {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 85vh;
    max-height: 85vh;
    max-width: 100vw;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
}
