/* ============================================================
   Go ahead, ask — AI Chat Widget
   Matches stevenjones.github.io design system
   ============================================================ */

#ask-steven-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1715;
  color: #f4f0e8;
  border: none;
  border-radius: 100px;
  padding: 14px 22px 14px 18px;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(26,23,21,0.18), 0 1px 4px rgba(26,23,21,0.10);
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
#ask-steven-btn:hover {
  background: #c85a2b;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200,90,43,0.22), 0 2px 8px rgba(26,23,21,0.10);
}
#ask-steven-btn .ask-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.9;
}

/* Panel */
#ask-steven-panel {
  position: fixed;
  bottom: 88px;
  right: 28px;
  z-index: 8999;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: 560px;
  background: #f4f0e8;
  border: 1px solid rgba(26,23,21,0.14);
  border-radius: 16px;
  box-shadow: 0 16px 56px rgba(26,23,21,0.16), 0 2px 8px rgba(26,23,21,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#ask-steven-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Panel header */
.ask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(26,23,21,0.10);
  background: #1a1715;
  flex-shrink: 0;
}
.ask-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ask-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #c85a2b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  color: #fff;
  font-style: italic;
  font-weight: 400;
  flex-shrink: 0;
}
.ask-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ask-header-name {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #f4f0e8;
  letter-spacing: 0.01em;
}
.ask-header-status {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244,240,232,0.5);
}
.ask-close {
  background: none;
  border: none;
  color: rgba(244,240,232,0.6);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-size: 18px;
  transition: color 0.15s;
  border-radius: 4px;
}
.ask-close:hover { color: #f4f0e8; }

/* Messages */
.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.ask-messages::-webkit-scrollbar { width: 4px; }
.ask-messages::-webkit-scrollbar-track { background: transparent; }
.ask-messages::-webkit-scrollbar-thumb { background: rgba(26,23,21,0.15); border-radius: 2px; }

.ask-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
}
.ask-msg.user { align-self: flex-end; align-items: flex-end; }
.ask-msg.steve { align-self: flex-start; align-items: flex-start; }

.ask-bubble {
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  font-family: "Geist", sans-serif;
}
.ask-msg.user .ask-bubble {
  background: #1a1715;
  color: #f4f0e8;
  border-bottom-right-radius: 4px;
}
.ask-msg.steve .ask-bubble {
  background: #ece6da;
  color: #1a1715;
  border: 1px solid rgba(26,23,21,0.10);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.ask-typing .ask-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
}
.ask-typing .dot {
  width: 6px;
  height: 6px;
  background: #6b665e;
  border-radius: 50%;
  animation: ask-bounce 1.2s infinite ease-in-out;
}
.ask-typing .dot:nth-child(2) { animation-delay: 0.18s; }
.ask-typing .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes ask-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Suggested questions */
.ask-suggestions {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.ask-suggestion-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b665e;
  margin-bottom: 4px;
}
.ask-suggestion {
  background: none;
  border: 1px solid rgba(26,23,21,0.14);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: #2c2825;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s, border-color 0.14s;
  line-height: 1.4;
}
.ask-suggestion:hover {
  background: #ece6da;
  border-color: rgba(26,23,21,0.22);
}

/* Input area */
.ask-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(26,23,21,0.10);
  background: #f4f0e8;
  flex-shrink: 0;
}
#ask-steven-input {
  flex: 1;
  border: 1px solid rgba(26,23,21,0.18);
  border-radius: 8px;
  padding: 9px 13px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: #1a1715;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  min-height: 38px;
  max-height: 100px;
}
#ask-steven-input:focus { border-color: #c85a2b; }
#ask-steven-input::placeholder { color: #6b665e; }

#ask-steven-send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #1a1715;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#ask-steven-send:hover { background: #c85a2b; }
#ask-steven-send svg { width: 16px; height: 16px; }

/* Mobile */
@media (max-width: 480px) {
  #ask-steven-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 75vh;
    border-radius: 20px 20px 0 0;
  }
  #ask-steven-btn {
    bottom: 20px;
    right: 20px;
  }
}

/* Hide floating button when panel is open on mobile */
@media (max-width: 480px) {
  #ask-steven-btn.panel-open {
    opacity: 0;
    pointer-events: none;
  }
}

/* Mobile close button in input row */
.ask-close-mobile {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: rgba(26,23,21,0.08);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #1a1715;
  transition: background 0.15s;
}
.ask-close-mobile:hover { background: rgba(26,23,21,0.14); }

@media (max-width: 480px) {
  .ask-close-mobile { display: flex; align-items: center; justify-content: center; }
}
