/* AI Co-Pilot Suite for Construction: OCR Scanner, Voice DPR, Market Surge, Tender Analyzer */

.ai-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .ai-grid-layout {
    grid-template-columns: 1fr;
  }
}

.ai-tool-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.ai-tool-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.ai-tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #8B5CF6, #06B6D4, #F59E0B);
}

.ai-tool-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.ai-tool-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(139, 92, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.ai-tool-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 20px;
}

/* OCR SCANNER SIMULATOR */
.ocr-dropzone {
  border: 2px dashed rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: rgba(6, 182, 212, 0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.ocr-dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.ocr-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 12px var(--accent-cyan);
  opacity: 0;
}

.ocr-scanning .ocr-scanline {
  opacity: 1;
  animation: scanline 1.5s infinite linear;
}

/* VOICE WAVEFORM */
.waveform-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  margin: 12px 0;
}

.wave-bar {
  width: 4px;
  height: 10px;
  background: var(--accent-gold);
  border-radius: 4px;
  transition: height 0.1s ease;
}

.wave-active .wave-bar:nth-child(odd) {
  animation: waveAnim 0.6s infinite alternate ease-in-out;
}
.wave-active .wave-bar:nth-child(even) {
  animation: waveAnim 0.8s infinite alternate-reverse ease-in-out;
}

@keyframes waveAnim {
  0% { height: 6px; }
  100% { height: 32px; }
}

/* AI STRUCTURED OUTPUT BOX */
.ai-output-box {
  background: rgba(8, 14, 26, 0.85);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-primary);
  max-height: 400px;
  overflow-y: auto;
}

.ai-output-box h4 {
  color: var(--accent-gold);
  font-size: 0.95rem;
  margin: 10px 0 6px 0;
}

.ai-output-box h4:first-child {
  margin-top: 0;
}

.ai-output-box ul {
  padding-left: 18px;
  margin-bottom: 12px;
}

.ai-output-box li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

/* COMMODITY SURGE MATRIX */
.commodity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
}

.commodity-badge.surge {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.commodity-badge.stable {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* CLIENT UPDATE MESSAGE PREVIEWS */
.message-preview-bubble {
  background: #111B21;
  border: 1px solid #202C33;
  border-radius: 12px;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #E9EDEF;
  white-space: pre-wrap;
  margin-top: 14px;
}
