/* ========================================================
   DSH STORE · AI Requirement Dialogue & Floating Assistant
   Inspired by aiaiai.help modern task input & assistant styles
   ======================================================== */

.ai-task-panel {
  background: rgba(13, 21, 46, 0.72);
  border: 1px solid rgba(40, 116, 245, 0.32);
  border-radius: 18px;
  padding: 20px 22px;
  margin: 22px 0 20px 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 24px rgba(40, 116, 245, 0.12);
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.ai-task-panel:focus-within {
  border-color: rgba(23, 191, 227, 0.6);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 32px rgba(23, 191, 227, 0.2);
}

.ai-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, rgba(40, 116, 245, 0.25), rgba(23, 191, 227, 0.25));
  color: #17bfe3;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(23, 191, 227, 0.4);
}

.ai-task-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
}



.ai-task-input-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  background: rgba(7, 12, 28, 0.82);
  border: 1px solid rgba(94, 137, 246, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s, background 0.2s;
}

.ai-task-input-wrap:focus-within {
  border-color: #2874f5;
  background: rgba(7, 12, 28, 0.95);
}

.ai-task-icon {
  margin-right: 10px;
  margin-top: 3px;
  color: #17bfe3;
  flex-shrink: 0;
  font-size: 1.15rem;
}

.ai-task-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.5;
  resize: none;
  min-height: 48px;
  max-height: 160px;
}

.ai-task-textarea::placeholder {
  color: #64748b;
}

.ai-task-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-task-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-chips-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.ai-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-chip-btn:hover {
  background: rgba(40, 116, 245, 0.18);
  border-color: rgba(40, 116, 245, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.ai-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2874f5 0%, #17bfe3 100%);
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(40, 116, 245, 0.35);
  transition: all 0.2s ease;
  margin-left: auto;
}

.ai-submit-btn:hover {
  box-shadow: 0 6px 20px rgba(40, 116, 245, 0.5);
  transform: translateY(-1px);
}

.ai-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ========================================================
   AI Recommendation Results View
   ======================================================== */

.ai-results-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  animation: fadeIn 0.3s ease;
}

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

.ai-results-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(40, 116, 245, 0.12);
  border: 1px solid rgba(40, 116, 245, 0.28);
  border-radius: 10px;
  font-size: 0.88rem;
  color: #e2e8f0;
  margin-bottom: 16px;
  line-height: 1.5;
}

.ai-model-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ai-recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.ai-plugin-card {
  background: rgba(15, 23, 50, 0.9);
  border: 1px solid rgba(94, 137, 246, 0.25);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.ai-plugin-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 191, 227, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ai-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ai-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  word-break: break-all;
}

.ai-card-badges {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.ai-card-badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-weight: 500;
}

.ai-card-badge.stars {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.ai-card-reason {
  font-size: 0.85rem;
  color: #38bdf8;
  background: rgba(23, 191, 227, 0.08);
  border-left: 3px solid #17bfe3;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  line-height: 1.45;
}

.ai-card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

.ai-command-box {
  background: rgba(6, 10, 24, 0.95);
  border: 1px solid rgba(94, 137, 246, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-command-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  word-break: break-all;
  user-select: all;
}

.ai-copy-btn {
  background: rgba(40, 116, 245, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(40, 116, 245, 0.35);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.ai-copy-btn:hover {
  background: rgba(40, 116, 245, 0.4);
  color: #fff;
}

.ai-copy-btn.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #34d399;
}

.ai-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.ai-card-detail-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.ai-card-detail-link:hover {
  text-decoration: underline;
}

/* ========================================================
   Global Floating Assistant Widget
   ======================================================== */

.floating-assistant-launcher {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 1000;
  background: linear-gradient(135deg, #2874f5 0%, #17bfe3 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(40, 116, 245, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-assistant-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(40, 116, 245, 0.6);
}

.floating-assistant-modal {
  position: fixed;
  bottom: 84px;
  right: 26px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: rgba(10, 16, 38, 0.96);
  border: 1px solid rgba(94, 137, 246, 0.35);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  display: none;
  animation: modalSlideUp 0.25s ease;
}

.floating-assistant-modal.open {
  display: flex;
}

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

.modal-header {
  padding: 14px 18px;
  background: rgba(15, 23, 52, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-bubble.user {
  align-self: flex-end;
  background: #2874f5;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: rgba(20, 30, 65, 0.85);
  border: 1px solid rgba(94, 137, 246, 0.2);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.modal-footer {
  padding: 12px 14px;
  background: rgba(12, 18, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
}

.modal-input {
  flex: 1;
  background: rgba(6, 10, 24, 0.9);
  border: 1px solid rgba(94, 137, 246, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.modal-input:focus {
  border-color: #2874f5;
}

.modal-send-btn {
  background: #2874f5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-send-btn:hover {
  background: #1d61d6;
}

@media (max-width: 760px) {
  .ai-task-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  body.home-page .hero-copy .store-search-form.unified-hero-form .ai-task-actions {
    width: 100% !important;
    margin-left: 0 !important;
    display: flex !important;
    gap: 8px !important;
  }
  body.home-page .hero-copy .store-search-form.unified-hero-form button.ai-catalog-jump-btn,
  body.home-page .hero-copy .store-search-form.unified-hero-form button.ai-submit-btn {
    flex: 1 !important;
    justify-content: center !important;
    min-width: 0 !important;
  }
  .floating-assistant-modal {
    right: 12px;
    bottom: 78px;
    width: calc(100vw - 24px);
    height: 70vh;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form {
  display: block !important;
  grid-area: auto !important;
  grid-template-columns: none !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: auto !important;
  margin: 0 !important;
  width: 100% !important;
  overflow: visible !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form label.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form .ai-task-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-left: auto !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form button.ai-catalog-jump-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  padding: 9px 16px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  min-width: auto !important;
  align-self: auto !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  line-height: normal !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form button.ai-catalog-jump-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-1px) !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form button.ai-submit-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, #2874f5 0%, #17bfe3 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 9px 20px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  min-width: auto !important;
  align-self: auto !important;
  box-shadow: 0 4px 14px rgba(40, 116, 245, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  line-height: normal !important;
}

body.home-page .hero-copy .store-search-form.unified-hero-form button.ai-submit-btn:hover {
  box-shadow: 0 6px 20px rgba(40, 116, 245, 0.5) !important;
  transform: translateY(-1px) !important;
}

.floating-assistant-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modal-title .floating-assistant-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}
