/* ============================================================
   receipt-ocr-solution.css
   Custom styles for Receipt OCR Solution Page
   Extends: bootstrap.css, style.css, common.css, config.css
   ============================================================ */

/* --- Styled Placeholders --- */
.rocr-image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: rgba(246, 99, 32, 0.02);
  border: 1.5px dashed var(--layoutBorderColor);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.rocr-image-placeholder:hover {
  border-color: var(--secondaryMastercolor);
  background: rgba(246, 99, 32, 0.04);
}
.rocr-image-placeholder span {
  font-size: 12px;
  font-weight: 600;
  color: var(--primaryTextColor);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Custom Border Grid (reused for Timeline & Features) --- */
.rocr-border-grid {
  border-top: 1px solid var(--layoutBorderColor);
  border-left: 1px solid var(--layoutBorderColor);
}
.rocr-border-cell {
  position: relative;
  padding: 40px 32px;
  border-right: 1px solid var(--layoutBorderColor);
  border-bottom: 1px solid var(--layoutBorderColor);
  background: #ffffff;
  transition: background 0.3s ease;
}
.rocr-border-cell:hover {
  background: rgba(246, 99, 32, 0.02);
}

/* --- Timeline Specs --- */
.rocr-timeline-num {
  font-size: 48px;
  font-weight: 800;
  color: rgba(246, 99, 32, 0.08);
  line-height: 1;
  font-family: var(--font-primary);
  transition: color 0.3s ease;
}
.rocr-border-cell:hover .rocr-timeline-num {
  color: rgba(246, 99, 32, 0.18);
}

/* --- Feature Specs --- */
.rocr-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(246, 99, 32, 0.06);
  border: 1px solid rgba(246, 99, 32, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--secondaryMastercolor);
  transition: all 0.3s ease;
}
.rocr-border-cell:hover .rocr-feature-icon {
  background: rgba(246, 99, 32, 0.12);
  border-color: rgba(246, 99, 32, 0.35);
  transform: scale(1.05);
}

/* --- FAQ Accordion --- */
.faq-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.faq-item {
  border: 1.5px solid var(--layoutBorderColor);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.faq-item:hover, .faq-item.active {
  border-color: var(--secondaryMastercolor);
}
.faq-trigger {
  width: 100%;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  text-align: left;
  outline: none;
  cursor: pointer;
}
.faq-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--mastercolor);
  margin: 0;
}
.faq-icon-wrapper {
  color: var(--secondaryMastercolor);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.faq-item.active .faq-icon-wrapper {
  transform: rotate(180deg);
}
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
}
.faq-answer {
  padding: 0 28px 24px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--primaryTextColor);
  margin: 0;
}

/* --- Form Frame --- */
.ctf-frame-card {
  border: 1.5px solid var(--layoutBorderColor);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.03);
}
.ctf-frame-header {
  padding: 14px 20px;
  background: var(--secondaryMastercolorLite);
}
.ctf-frame-dot {
  width: 9px;
  height: 9px;
}
.ctf-dot-red { background: #ff5f56; }
.ctf-dot-yellow { background: #ffbd2e; }
.ctf-dot-green { background: #27c93f; }

/* --- Receipt Scanner Console --- */
.receipt-scanner-console {
  border: 1.5px solid var(--layoutBorderColor);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.02);
  overflow: hidden;
  transition: all 0.3s ease;
}
.receipt-scanner-console:hover {
  border-color: var(--secondaryMastercolor);
  box-shadow: 0 20px 40px rgba(246, 99, 32, 0.05);
}

/* Mock Receipt Paper styling */
.mock-receipt-container {
  position: relative;
  background: #f1f5f9;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.mock-receipt {
  background: #fff;
  width: 100%;
  max-width: 280px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #1e293b;
  position: relative;
  border-top: 3px dashed var(--layoutBorderColor);
}
/* Serrated bottom edge */
.mock-receipt::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(-135deg, #f1f5f9 4px, transparent 0), linear-gradient(135deg, #f1f5f9 4px, transparent 0);
  background-size: 8px 8px;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.receipt-merchant {
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.receipt-meta {
  color: #64748b;
  margin-top: 4px;
}
.receipt-items {
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.receipt-item-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 12px;
}

/* Bounding box highlighter overlays */
.ocr-bounding-box-overlay {
  position: absolute;
  border: 1.5px solid var(--secondaryMastercolor);
  background: rgba(246, 99, 32, 0.08);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}
.ocr-bounding-box-overlay.active {
  opacity: 1;
}

/* Scan line sweeping animation */
.scan-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--secondaryMastercolor), transparent);
  box-shadow: 0 0 8px var(--secondaryMastercolor);
  z-index: 10;
  animation: scanMove 3s infinite linear;
}

@keyframes scanMove {
  0% { top: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Parsed JSON panel */
.extracted-json-panel {
  background: #0f172a;
  color: #38bdf8;
  font-family: monospace;
  font-size: 11px;
  padding: 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.json-title {
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 6px;
}
.json-line {
  margin-bottom: 4px;
  white-space: pre-wrap;
  transition: color 0.2s ease;
}
.json-line.highlight {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.1);
}
.json-key { color: #f472b6; }
.json-val { color: #34d399; }

/* Extract Key-Value Tag List */
.rocr-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--layoutBorderColor);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mastercolor);
  transition: all 0.3s ease;
}
.rocr-key-badge i {
  color: var(--secondaryMastercolor);
  font-size: 14px;
}
.rocr-key-badge:hover {
  border-color: var(--secondaryMastercolor);
  box-shadow: 0 4px 12px rgba(246, 99, 32, 0.05);
  transform: translateY(-1px);
}

/* Trust Commitments Grid */
.trust-card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.trust-card:hover {
  border-color: var(--secondaryMastercolor) !important;
  box-shadow: 0 12px 24px rgba(246, 99, 32, 0.04) !important;
  transform: translateY(-2px);
}

/* --- Developer API/SDK Tabs --- */
.dev-tabs-container {
  border: 1px solid var(--layoutBorderColor);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}
.dev-tab-header {
  display: flex;
  border-bottom: 1px solid var(--layoutBorderColor);
  background: #f8fafc;
}
.dev-tab-btn {
  flex: 1;
  padding: 16px 20px;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}
.dev-tab-btn:hover {
  color: var(--mastercolor);
  background: #f1f5f9;
}
.dev-tab-btn.active {
  color: var(--secondaryMastercolor);
  background: #ffffff;
  border-bottom: 2px solid var(--secondaryMastercolor);
}
.dev-tab-content {
  display: none;
  padding: 24px;
  background: #0f172a;
}
.dev-tab-content.active {
  display: block;
  animation: codeFadeIn 0.3s ease-out;
}

@keyframes codeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.code-block {
  margin: 0;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
}
.code-comment { color: #64748b; }
.code-keyword { color: #f472b6; }
.code-string { color: #34d399; }
.code-number { color: #fb923c; }
.code-function { color: #38bdf8; }
