/* Daneel Chat Widget v3 — WeirdGifts.co */

#daneel-widget { position: fixed; bottom: 20px; right: 16px; z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* Bubble button */
#daneel-bubble { display: flex; align-items: center; gap: 8px; background: #6366f1; color: #fff; border: none; border-radius: 50px; padding: 10px 18px; cursor: pointer; font-size: 15px; box-shadow: 0 4px 16px rgba(99,102,241,0.35); transition: transform 0.2s, box-shadow 0.2s; }
#daneel-bubble:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
.daneel-bubble-icon { font-size: 20px; }
.daneel-bubble-label { font-weight: 600; }

/* Chat window */
#daneel-window { position: fixed; bottom: 76px; right: 16px; width: 320px; max-height: 460px; background: #faf8f5; border: 1px solid #e8e0d8; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; }
#daneel-window[hidden] { display: none; }

/* Header */
#daneel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #6366f1; border-radius: 16px 16px 0 0; }
.daneel-header-info { display: flex; align-items: center; gap: 8px; color: #fff; }
.daneel-avatar { font-size: 24px; }
.daneel-header-info strong { display: block; font-size: 14px; color: #fff; }
.daneel-subtitle { font-size: 10px; color: rgba(255,255,255,0.75); }
#daneel-close { background: none; border: none; color: rgba(255,255,255,0.75); font-size: 16px; cursor: pointer; padding: 4px 6px; }
#daneel-close:hover { color: #fff; }

/* Messages */
#daneel-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 150px; max-height: 280px; background: #faf8f5; }
.daneel-msg { display: flex; gap: 6px; animation: daneel-fade 0.3s ease; }
.daneel-msg-user { flex-direction: row-reverse; }
.daneel-msg-avatar { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.daneel-msg-bubble { padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; max-width: 220px; word-wrap: break-word; }
.daneel-msg-assistant .daneel-msg-bubble { background: #fff; color: #2d2a26; border: 1px solid #e8e0d8; border-bottom-left-radius: 4px; }
.daneel-msg-user .daneel-msg-bubble { background: #6366f1; color: #fff; border-bottom-right-radius: 4px; }

/* Typing dots */
.daneel-dots { display: flex; gap: 4px; padding: 4px 0; }
.daneel-dots span { width: 5px; height: 5px; background: #a855f7; border-radius: 50%; animation: daneel-blink 1.4s infinite; }
.daneel-dots span:nth-child(2) { animation-delay: 0.2s; }
.daneel-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Notice */
#daneel-notice { padding: 5px 12px; font-size: 9px; color: #9e9588; text-align: center; border-top: 1px solid #e8e0d8; }

/* Input area */
#daneel-input-area { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid #e8e0d8; background: #f3efe9; }
#daneel-input { flex: 1; background: #fff; border: 1px solid #e8e0d8; border-radius: 10px; padding: 7px 10px; color: #2d2a26; font-size: 13px; resize: none; font-family: inherit; }
#daneel-input::placeholder { color: #9e9588; }
#daneel-input:focus { outline: none; border-color: #a855f7; }
#daneel-send { background: #6366f1; color: #fff; border: none; border-radius: 10px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
#daneel-send:hover { background: #4f46e5; }
#daneel-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Footer row (counter + end button) */
#daneel-footer { display: flex; align-items: center; justify-content: space-between; padding: 3px 10px 6px; min-height: 22px; }
#daneel-counter { font-size: 10px; color: #9e9588; }
#daneel-end { background: none; border: none; color: #9e9588; font-size: 10px; cursor: pointer; padding: 2px 4px; text-decoration: underline; text-underline-offset: 2px; }
#daneel-end:hover { color: #6366f1; }
.daneel-counter-warn { color: #ec4899 !important; }

/* Exhausted */
.daneel-exhausted { text-align: center; padding: 10px; font-size: 12px; color: #9e9588; font-style: italic; }

/* Share */
.daneel-share { text-align: center; padding: 10px; border-top: 1px solid #e8e0d8; margin-top: 6px; }
.daneel-share p { font-size: 11px; color: #9e9588; margin: 0 0 6px; }
.daneel-share-btn { background: #6366f1; color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.daneel-share-btn:hover { background: #4f46e5; }

/* Proactive preview bubble */
#daneel-preview { position: fixed; bottom: 76px; right: 16px; width: 260px; background: #faf8f5; border: 1px solid #e8e0d8; border-radius: 14px; padding: 12px 14px; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,0.1); animation: daneel-slide-up 0.4s ease; z-index: 9998; }
#daneel-preview:hover { border-color: #a855f7; box-shadow: 0 6px 24px rgba(168,85,247,0.15); }
.daneel-preview-text { color: #2d2a26; font-size: 13px; line-height: 1.45; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.daneel-preview-reply { color: #6366f1; font-size: 12px; font-weight: 600; }
.daneel-preview-fade { opacity: 0; transition: opacity 0.5s ease; }
@keyframes daneel-slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Animations */
@keyframes daneel-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes daneel-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* Mobile portrait — bottom sheet */
@media (max-width: 480px) {
  #daneel-widget { bottom: 10px; right: 10px; }
  #daneel-window { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%; max-height: 70vh; border-radius: 16px 16px 0 0; border-bottom: none; z-index: 10000; }
  #daneel-preview { right: 10px; bottom: 68px; width: 240px; }
  .daneel-msg-bubble { max-width: 220px; }
  #daneel-messages { max-height: 45vh; }
}

/* Tablet / landscape */
@media (min-width: 481px) and (max-width: 1024px) {
  #daneel-window { width: 300px; right: 16px; bottom: 76px; }
  #daneel-preview { width: 250px; right: 16px; }
}
