/* Ask Philia AI Assistant Styling - Landing Page Only */

/* Floating Trigger Button */
.ask-philia-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #0c0e12;
  border: 1px solid #CCFF00;
  border-radius: 999px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(204, 255, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.8);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.ask-philia-trigger:hover {
  transform: translateY(-2px) scale(1.02);
  background: #141820;
  box-shadow: 0 12px 40px rgba(204, 255, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.9);
}

.ask-philia-trigger-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #CCFF00;
  border-radius: 50%;
  color: #000000;
}

.ask-philia-trigger-text {
  letter-spacing: 0.3px;
}

/* Assistant Modal / Panel Container */
.ask-philia-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ask-philia-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ask-philia-panel {
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 48px);
  margin: 0 24px 24px 0;
  background: #0c0e12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 40px rgba(204, 255, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ask-philia-modal-overlay.active .ask-philia-panel {
  transform: translateY(0) scale(1);
}

/* Panel Header */
.ask-philia-header {
  padding: 20px 24px;
  background: rgba(18, 22, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ask-philia-header-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px 0;
}

.ask-philia-header-title span {
  color: #CCFF00;
}

.ask-philia-header-subtitle {
  font-size: 12px;
  color: #8e8e93;
  margin: 0;
  line-height: 1.4;
}

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

.ask-philia-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Panel Body / Messages Stream */
.ask-philia-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.ask-philia-messages::-webkit-scrollbar {
  width: 6px;
}

.ask-philia-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Suggested Questions Section */
.ask-philia-suggestions-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 8px;
}

.ask-philia-suggestions-title {
  font-size: 12px;
  font-weight: 700;
  color: #CCFF00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.ask-philia-suggestions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ask-philia-suggestion-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ask-philia-suggestion-pill:hover {
  background: rgba(204, 255, 0, 0.12);
  border-color: #CCFF00;
  color: #CCFF00;
  transform: translateX(2px);
}

/* Message Bubbles */
.ask-philia-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: fadeInMsg 0.3s ease forwards;
}

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

.ask-philia-message.user {
  align-self: flex-end;
}

.ask-philia-message.assistant {
  align-self: flex-start;
}

.ask-philia-bubble {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
}

.ask-philia-message.user .ask-philia-bubble {
  background: #CCFF00;
  color: #000000;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

.ask-philia-message.assistant .ask-philia-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  border-bottom-left-radius: 4px;
}

.ask-philia-bubble p {
  margin: 0 0 8px 0;
}

.ask-philia-bubble p:last-child {
  margin-bottom: 0;
}

.ask-philia-bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

.ask-philia-bubble li {
  margin-bottom: 4px;
}

/* Comparison Table Styling */
.ask-philia-table-wrapper {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  -webkit-overflow-scrolling: touch;
}

.ask-philia-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: left;
  table-layout: auto;
}

.ask-philia-comparison-table th {
  background: rgba(204, 255, 0, 0.15);
  color: #CCFF00;
  font-weight: 700;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(204, 255, 0, 0.25);
  font-size: 11px;
}

.ask-philia-comparison-table th.col-0,
.ask-philia-comparison-table td.col-0 {
  width: 44%;
  text-align: left;
  padding-left: 8px;
}

.ask-philia-comparison-table th.col-1,
.ask-philia-comparison-table td.col-1 {
  width: 28%;
  text-align: center;
}

.ask-philia-comparison-table th.col-2,
.ask-philia-comparison-table td.col-2 {
  width: 28%;
  text-align: center;
}

.ask-philia-comparison-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  vertical-align: middle;
}

.ask-philia-comparison-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.ask-philia-comparison-table tr:last-child td {
  border-bottom: none;
}

/* Embedded Store CTA Card inside Chat */
.ask-philia-store-card {
  margin-top: 10px;
  padding: 14px;
  background: rgba(204, 255, 0, 0.08);
  border: 1px solid rgba(204, 255, 0, 0.3);
  border-radius: 14px;
  text-align: center;
}

.ask-philia-store-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #CCFF00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ask-philia-store-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.ask-philia-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ask-philia-store-btn:hover {
  background: #1a1e26;
  border-color: #CCFF00;
  color: #CCFF00;
}

/* Typing Indicator */
.ask-philia-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.ask-philia-typing span {
  width: 6px;
  height: 6px;
  background: #CCFF00;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.ask-philia-typing span:nth-child(1) { animation-delay: -0.32s; }
.ask-philia-typing span:nth-child(2) { animation-delay: -0.16s; }

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

/* Panel Input Bar */
.ask-philia-footer {
  padding: 8px 12px;
  background: rgba(18, 22, 30, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ask-philia-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 16px; /* Prevents iOS Safari auto-zoom on input focus */
  outline: none;
  transition: all 0.2s ease;
}

.ask-philia-input::placeholder {
  color: #71717a;
}

.ask-philia-input:focus {
  border-color: #CCFF00;
  background: rgba(255, 255, 255, 0.08);
}

.ask-philia-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #CCFF00;
  border: none;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ask-philia-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(204, 255, 0, 0.4);
}

.ask-philia-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
  .ask-philia-modal-overlay {
    height: 100dvh;
    align-items: flex-end;
  }

  .ask-philia-trigger {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .ask-philia-panel {
    margin: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 20px 20px 0 0;
    border: none;
  }

  .ask-philia-footer {
    padding: 8px 12px;
  }
}
