/* ============================================ */
/* TALK TO PDF — Chat Interface Styles          */
/* ============================================ */

/* Features Grid (shared with humanizer/detector) */
.humanizer-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 992px) {
  .humanizer-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .humanizer-features-grid {
    grid-template-columns: 1fr;
  }
}

.humanizer-feature-card {
  background: var(--tool-card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

.humanizer-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--tool-card-shadow);
  border-color: rgba(var(--primary-color-rgb), 0.4);
}

.humanizer-feature-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-color-rgb), 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  font-size: 1.5rem;
}

.humanizer-feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--dark-text);
}

.humanizer-feature-desc {
  font-size: 0.95rem;
  color: var(--dark-text);
  opacity: 0.8;
  line-height: 1.6;
}

.talk-to-pdf-page.has-active-pdf .tool-layout-container.talk-to-pdf-layout {
  max-width: 1600px;
  width: 100%;
  margin: 70px auto 0;
  padding: 20px 24px;
  justify-content: center;
  align-items: flex-start;
}

.talk-to-pdf-page.has-active-pdf .tool-section {
  width: 100%;
  max-width: none;
  padding: 16px 0 0;
}

.talk-to-pdf-page.has-active-pdf .tool-card-specific {
  width: 100%;
  min-width: 0;
}

.talk-to-pdf-page.has-active-pdf .tool-header {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.pdf-value-panel {
  margin-bottom: 1.5rem;
  padding: 1.4rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(58, 90, 254, 0.18), transparent 45%),
    linear-gradient(135deg, rgba(106, 156, 137, 0.12), rgba(58, 90, 254, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.pdf-value-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text);
  margin-bottom: 0.9rem;
}

.pdf-value-title {
  font-size: 1.55rem;
  line-height: 1.2;
  margin-bottom: 0.8rem;
  color: var(--dark-text);
}

.pdf-value-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--dark-text);
  opacity: 0.88;
  margin-bottom: 1rem;
}

.pdf-value-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}

.pdf-value-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dark-text);
  font-size: 0.92rem;
}

.pdf-value-item i {
  color: var(--primary-medium);
  font-size: 1rem;
}

.pdf-pricing-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0.95rem;
}

.pdf-pricing-trust-note {
  margin: 0 0 0.95rem;
  font-size: 0.86rem;
  color: var(--dark-text);
  opacity: 0.86;
}

.pdf-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--dark-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-price-chip.highlight {
  background: rgba(58, 90, 254, 0.15);
  border-color: rgba(58, 90, 254, 0.25);
}

.pdf-privacy-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--dark-text);
  opacity: 0.82;
}

.pdf-privacy-note i {
  color: var(--primary-medium);
  margin-right: 8px;
}

/* PDF Upload Area */
.pdf-upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
}

.pdf-upload-area:hover,
.pdf-upload-area.drag-over {
  border-color: var(--primary-medium);
  background: rgba(106, 156, 137, 0.08);
  transform: translateY(-2px);
}

.pdf-upload-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pdf-upload-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 0.5rem;
}

.pdf-upload-hint {
  font-size: 0.9rem;
  color: var(--dark-text);
  opacity: 0.6;
  margin-bottom: 1.2rem;
}

/* PDF Info Bar */
.pdf-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.pdf-info-icon {
  font-size: 1.8rem;
  color: #ef4444;
  flex-shrink: 0;
}

.pdf-info-details {
  flex: 1 1 260px;
  min-width: 0;
}

.pdf-document-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pdf-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--dark-text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.pdf-doc-badge-name {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-doc-badge-remove {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-doc-badge-remove:hover {
  opacity: 1;
  color: #ef4444;
}

.pdf-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 360px;
  min-width: 0;
  justify-content: flex-end;
}

.pdf-info-actions .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: 100%;
}

#chatSection {
  min-width: 0;
}

.pdf-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

#chatSection.has-document-loaded .pdf-workspace {
  max-width: 1560px;
  margin: 0 auto;
}

.pdf-document-badges {
  max-width: 100%;
  overflow: hidden;
}

.pdf-chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.pdf-chat-main {
  min-width: 0;
}

.pdf-chat-sidebar {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

#chatSection.has-document-loaded .pdf-chat-shell {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

#chatSection.has-document-loaded .pdf-chat-sidebar {
  display: flex;
}

.session-status-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(106, 156, 137, 0.22);
  background:
    linear-gradient(135deg, rgba(106, 156, 137, 0.14), rgba(58, 90, 254, 0.08)),
    rgba(255, 255, 255, 0.03);
}

.session-status-copy {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-value-title {
  font-size: 1rem;
  font-weight: 700;
}

.session-value-point {
  font-size: 0.9rem;
  opacity: 0.9;
}

.session-value-description {
  font-size: 0.86rem;
  line-height: 1.5;
  opacity: 0.82;
}

.session-value-list {
  margin: 2px 0 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.session-value-list li {
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.95;
}

.session-value-price {
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-medium);
}

.session-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--dark-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-mode-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.analysis-mode-copy {
  flex: 1;
  min-width: 0;
}

.analysis-mode-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 4px;
}

.analysis-mode-description {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--dark-text);
  opacity: 0.72;
}

.analysis-mode-toggle {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  width: 100%;
  gap: 8px;
  align-items: stretch;
}

.analysis-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 40px;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dark-text);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.analysis-mode-btn:hover {
  border-color: rgba(58, 90, 254, 0.25);
  transform: translateY(-1px);
}

.analysis-mode-btn.is-active {
  background: rgba(58, 90, 254, 0.14);
  border-color: rgba(58, 90, 254, 0.28);
  box-shadow: 0 8px 18px rgba(58, 90, 254, 0.12);
}

.analysis-mode-btn[data-mode="deep"] {
  justify-content: center;
  gap: 8px;
  padding-inline: 12px;
  border-color: rgba(58, 90, 254, 0.35);
  background: rgba(58, 90, 254, 0.12);
}

.analysis-mode-label {
  white-space: nowrap;
  line-height: 1;
}

.analysis-mode-btn.is-locked {
  opacity: 0.7;
}

.analysis-mode-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.analysis-mode-premium-note {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(58, 90, 254, 0.28);
  background:
    linear-gradient(135deg, rgba(58, 90, 254, 0.14), rgba(106, 156, 137, 0.1)),
    rgba(255, 255, 255, 0.04);
  color: var(--dark-text);
}

.analysis-mode-premium-note.is-locked {
  opacity: 0.85;
}

.analysis-mode-premium-note.is-unlocked {
  border-color: rgba(106, 156, 137, 0.35);
}

.analysis-mode-premium-title {
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.analysis-mode-premium-line {
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.92;
}

.session-upsell-banner {
  margin-bottom: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(58, 90, 254, 0.18);
  background:
    linear-gradient(135deg, rgba(58, 90, 254, 0.14), rgba(106, 156, 137, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.session-upsell-banner.is-urgent {
  border-color: rgba(239, 68, 68, 0.28);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(58, 90, 254, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.session-upsell-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 6px;
}

.session-upsell-copy {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--dark-text);
  opacity: 0.9;
}

.session-upsell-copy-text {
  margin-bottom: 8px;
}

.session-upsell-list {
  margin: 0;
  padding-left: 1rem;
}

.session-upsell-list li {
  margin-bottom: 4px;
}

.session-upsell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.session-upsell-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.session-upsell-cta.primary {
  background: var(--primary-gradient);
  color: #fff;
}

.session-upsell-cta.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--dark-text);
}

.session-upsell-cta:hover {
  transform: translateY(-1px);
}

.saved-chats-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.saved-chats-heading {
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.saved-chats-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(191, 219, 254, 0.82);
}

.saved-chats-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
}

.saved-chats-list::-webkit-scrollbar {
  width: 6px;
}

.saved-chats-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.42);
  border-radius: 99px;
}

.saved-chats-list::-webkit-scrollbar-track {
  background: transparent;
}

.saved-chat-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.saved-chat-item.is-active {
  border-color: rgba(99, 102, 241, 0.28);
  background:
    linear-gradient(135deg, rgba(79, 111, 255, 0.15), rgba(124, 58, 237, 0.08));
}

.saved-chat-row {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.saved-chat-title {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--dark-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-chat-meta {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(191, 219, 254, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.saved-chat-action {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--dark-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.saved-chat-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.saved-chat-action.is-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

.saved-chat-empty {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(191, 219, 254, 0.74);
}

.prompt-suggestion-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.prompt-suggestion-card-title {
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark-text);
}

.prompt-suggestion-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.prompt-suggestion-strip .quick-prompt-btn {
  width: 100%;
  white-space: normal;
  text-align: left;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.04);
}

/* Chat Container */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 640px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

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

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

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

/* Message Bubbles */
.chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msgSlideIn 0.3s ease-out;
}

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

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

.chat-message.ai {
  align-self: flex-start;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 4px;
}

.chat-message.user .msg-avatar {
  background: var(--primary-gradient);
  color: white;
}

.chat-message.ai .msg-avatar {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--dark-text);
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

.chat-message.user .msg-bubble {
  background: var(--primary-gradient);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.ai .msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dark-text);
  border-bottom-left-radius: 4px;
}

.chat-reference-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 auto 1rem;
  padding: 0.9rem 1rem;
  max-width: min(100%, 720px);
  border-radius: 14px;
  background: rgba(58, 90, 254, 0.12);
  border: 1px solid rgba(58, 90, 254, 0.22);
  color: var(--dark-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-reference-note i {
  margin-top: 0.12rem;
  color: #90a7ff;
}

.chat-reference-note span {
  flex: 1;
}

.msg-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--dark-text);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-top: 8px;
  opacity: 0.7;
}

.msg-copy-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dark-text);
  opacity: 0.4;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

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

/* Welcome State */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 2rem;
}

.chat-welcome-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chat-welcome-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 0.5rem;
}

.chat-welcome-desc {
  font-size: 0.95rem;
  color: var(--dark-text);
  opacity: 0.6;
  max-width: 400px;
}

/* Quick Prompts */
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 1.2rem;
}

.quick-prompt-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--dark-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-prompt-btn i {
  margin-right: 6px;
}

.quick-prompt-btn:hover {
  background: rgba(106, 156, 137, 0.15);
  border-color: var(--primary-medium);
  transform: translateY(-1px);
}

/* Chat Input Area */
.chat-input-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  align-items: end;
}

.chat-input-expectation {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(58, 90, 254, 0.08);
  border: 1px solid rgba(58, 90, 254, 0.16);
}

.chat-input-expectation-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--dark-text);
}

.chat-input-expectation-subtitle {
  font-size: 0.8rem;
  color: var(--dark-text);
  opacity: 0.82;
}

.chat-input-area .cf-turnstile {
  grid-column: 1 / -1;
  width: 100% !important;
  max-width: 320px;
  justify-self: end;
  display: none;
  justify-content: flex-end;
  overflow: hidden;
}

.chat-input-area .cf-turnstile.is-visible {
  display: flex;
}

.chat-input-area .cf-turnstile > div {
  width: 100% !important;
  max-width: 100% !important;
}

.chat-input-area .cf-turnstile iframe {
  width: 100% !important;
  max-width: 100%;
  border-radius: 14px !important;
}

.chat-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--dark-text);
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--primary-medium);
}

.chat-input::placeholder {
  color: var(--dark-text);
  opacity: 0.4;
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(106, 156, 137, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.post-response-upsell {
  align-self: flex-start;
  max-width: 85%;
  margin-left: 42px;
  margin-top: -4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(58, 90, 254, 0.22);
  background: rgba(58, 90, 254, 0.08);
}

.post-response-upsell-copy {
  font-size: 0.84rem;
  color: var(--dark-text);
}

.post-response-upsell-action {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--primary-gradient);
}

/* Loading bar for PDF extraction */
.pdf-loading-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 12px 0;
  display: none;
}

.pdf-loading-bar .progress {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.pdf-loading-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--dark-text);
  opacity: 0.6;
  display: none;
}

/* Chat action buttons row */
.chat-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 10px;
}

.chat-actions-row .btn {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* ============================================ */
/* LIGHT MODE                                   */
/* ============================================ */
.light-mode .pdf-upload-area {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.02);
}

.light-mode .pdf-upload-area:hover,
.light-mode .pdf-upload-area.drag-over {
  background: rgba(106, 156, 137, 0.06);
}

.light-mode .pdf-info-bar {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .pdf-doc-badge {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--light-text);
}

.light-mode .chat-container {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.01);
}

.light-mode .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.light-mode .chat-message.ai .msg-avatar {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .chat-message.ai .msg-bubble {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .chat-reference-note {
  background: rgba(58, 90, 254, 0.08);
  border-color: rgba(58, 90, 254, 0.18);
  color: var(--light-text);
}

.light-mode .chat-reference-note i {
  color: #3a5afe;
}

.light-mode .quick-prompt-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
}

.light-mode .quick-prompt-btn:hover {
  background: rgba(106, 156, 137, 0.1);
}

.light-mode .session-status-bar {
  border-color: rgba(106, 156, 137, 0.25);
  background:
    linear-gradient(135deg, rgba(106, 156, 137, 0.12), rgba(58, 90, 254, 0.06)),
    rgba(0, 0, 0, 0.02);
}

.light-mode .session-status-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--light-text);
}

.light-mode .pdf-pricing-trust-note {
  color: var(--light-text);
}

.light-mode .pdf-value-panel,
.light-mode .analysis-mode-bar,
.light-mode .session-upsell-banner,
.light-mode .prompt-suggestion-card {
  border-color: rgba(0, 0, 0, 0.08);
  background:
    linear-gradient(135deg, rgba(58, 90, 254, 0.08), rgba(106, 156, 137, 0.05)),
    rgba(0, 0, 0, 0.02);
}

.light-mode .pdf-value-item,
.light-mode .pdf-price-chip,
.light-mode .analysis-mode-btn,
.light-mode .session-upsell-cta.secondary {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--light-text);
}

.light-mode .analysis-mode-btn.is-active {
  background: rgba(58, 90, 254, 0.12);
  border-color: rgba(58, 90, 254, 0.18);
}

.light-mode .analysis-mode-premium-note {
  border-color: rgba(58, 90, 254, 0.2);
  background:
    linear-gradient(135deg, rgba(58, 90, 254, 0.12), rgba(106, 156, 137, 0.08)),
    rgba(0, 0, 0, 0.02);
}

.light-mode .chat-input-area {
  border-top-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.light-mode .chat-input-expectation {
  background: rgba(58, 90, 254, 0.08);
  border-color: rgba(58, 90, 254, 0.14);
}

.light-mode .chat-input {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: var(--light-text);
}

.light-mode .msg-copy-btn {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--light-text);
}

.light-mode .msg-copy-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}

.light-mode .chat-input::placeholder {
  color: var(--light-text);
}

.light-mode .post-response-upsell {
  background: rgba(58, 90, 254, 0.09);
  border-color: rgba(58, 90, 254, 0.2);
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 1080px) {
  .talk-to-pdf-page.has-active-pdf .tool-layout-container.talk-to-pdf-layout {
    margin-top: 70px;
    padding: 16px;
  }

  .talk-to-pdf-page.has-active-pdf .tool-section {
    padding: 18px;
  }

  #chatSection.has-document-loaded .pdf-chat-shell {
    grid-template-columns: 1fr;
  }

  .chat-container {
    height: 560px;
  }
}

@media (max-width: 768px) {
  .talk-to-pdf-page.has-active-pdf .tool-layout-container.talk-to-pdf-layout {
    padding: 14px;
  }

  .talk-to-pdf-page.has-active-pdf .tool-section {
    padding: 14px;
  }

  .chat-container {
    height: 450px;
  }

  .chat-messages {
    padding: 14px;
    gap: 12px;
  }

  .chat-message {
    max-width: 92%;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .msg-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .quick-prompts {
    gap: 6px;
  }

  .quick-prompt-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .session-status-bar {
    padding: 12px 14px;
  }

  .session-status-copy {
    font-size: 0.92rem;
  }

  .pdf-value-list {
    grid-template-columns: 1fr;
  }

  .analysis-mode-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .analysis-mode-toggle {
    grid-template-columns: 1fr;
  }

  .analysis-mode-premium-note {
    width: 100%;
    max-width: 100%;
  }

  .session-upsell-actions {
    flex-direction: column;
  }

  .session-upsell-cta {
    width: 100%;
  }

  .pdf-upload-area {
    padding: 2rem 1.5rem;
  }

  .pdf-upload-icon {
    font-size: 2.5rem;
  }

  .pdf-info-bar {
    flex-wrap: wrap;
  }

  .pdf-info-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .pdf-info-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .post-response-upsell {
    max-width: 92%;
    margin-left: 34px;
  }
}

@media (max-width: 480px) {
  .talk-to-pdf-page.has-active-pdf .tool-layout-container.talk-to-pdf-layout {
    padding: 10px;
  }

  .chat-container {
    height: 400px;
    border-radius: 12px;
  }

  .prompt-suggestion-card {
    padding: 12px;
  }

  .chat-input-area {
    padding: 10px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
  
  .chat-input-area .cf-turnstile {
    max-width: 100%;
    justify-content: center;
    justify-self: stretch;
  }
  
  .chat-input-area .cf-turnstile > div,
  .chat-input-area .cf-turnstile iframe {
    width: 100% !important;
  }

  .chat-input {
    flex: 1;
    font-size: 0.9rem;
    padding: 10px 14px;
    margin-bottom: 0;
  }

  .pdf-value-panel {
    padding: 1.1rem;
  }

  .pdf-value-title {
    font-size: 1.3rem;
  }
  
  .chat-send-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 50%;
    margin-left: 8px;
  }
}
