/* style.css - Design System for HimiTrace™ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #0a0a0f;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.2);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.2);
  --danger-color: #ef4444;
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 2rem;
  overflow-x: hidden;
}

/* Utilities */
h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

.glow-text-green {
  text-shadow: 0 0 10px var(--accent-green-glow);
}

.glow-text-blue {
  text-shadow: 0 0 10px var(--accent-blue-glow);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1rem;
}

header h1 {
  font-size: 1.75rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header h1 span {
  color: var(--accent-green);
}

/* Glassmorphism Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-title);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
}

.btn-primary {
  background-color: var(--accent-green);
  color: #000;
}

.btn-primary:hover {
  background-color: #059669;
  box-shadow: 0 0 15px var(--accent-green-glow);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Grid Layout */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Uploader Dropzone */
.uploader-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: border-color 0.2s, background 0.2s;
}

.uploader-area:hover {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.02);
}

/* Scanning Laser Effect */
.scanner-line {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to bottom, transparent, var(--accent-green), transparent);
  box-shadow: 0 0 12px var(--accent-green);
  animation: scan 2s infinite ease-in-out;
}

@keyframes scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanning .scanner-line {
  display: block;
}

/* Form Styling */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue-glow);
}

/* Stacked Charts / Impact Bars */
.impact-bar-wrapper {
  margin-bottom: 1rem;
}

.impact-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.impact-bar-container {
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.impact-bar-segment {
  height: 100%;
}

.materials-color { background-color: #fca5a5; }
.processing-color { background-color: #34d399; }
.assembly-color { background-color: #a78bfa; }
.distribution-color { background-color: #fbbf24; }
.use-color { background-color: #60a5fa; }
.eol-color { background-color: #f87171; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Mobile Stack Layout for scan details */
.dpp-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

.badge-verified {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.dpp-card-stack {
  display: flex;
  flex-col: column;
  flex-direction: column;
  gap: 1rem;
}

.care-icons {
  display: flex;
  gap: 1.25rem;
  margin-top: 1rem;
  justify-content: center;
}

.care-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  gap: 0.35rem;
}

.care-icon-item svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 1.5;
}

/* Tab Styling */
.tabs {
  border-bottom: 1px solid var(--card-border);
}

.tab-btn:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
}

.tab-btn.active {
  color: var(--accent-green) !important;
  border-bottom: 2px solid var(--accent-green) !important;
  background-color: rgba(16, 185, 129, 0.05) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Lineage Flow (Supply Chain Journey) Improvements */
.lineage-step.active .lineage-dot {
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
}

.lineage-step.active span {
  color: #fff !important;
}

.lineage-flow-vertical {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 2rem;
  margin-top: 1.5rem;
}

.lineage-flow-vertical::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.lineage-node-vertical {
  position: relative;
  margin-bottom: 1.5rem;
}

.lineage-node-vertical::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue-glow);
  z-index: 2;
}

.lineage-node-vertical.active::before {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.lineage-node-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.lineage-node-content h3 {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #fff;
}

.lineage-node-content p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Mandatory fields asterisk styling */
label.required::after {
  content: " *";
  color: var(--danger-color, #ef4444);
  font-weight: bold;
}

/* AI OCR filled inputs styling */
.form-control.ai-filled {
  border-color: rgba(59, 130, 246, 0.6) !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3) !important;
  background-color: rgba(59, 130, 246, 0.08) !important;
  transition: all 0.3s ease;
}

