/* ==========================================================================
   INTERACTIVE COMPONENTS & WIDGETS (ADOPT.AI AESTHETIC)
   ========================================================================== */

/* 1. ORDER REVIEW 360 CONTROL TOWER CARD */
.order-360-card {
  width: 100%;
  background: var(--bg-navy-card);
  border: 1px solid var(--border-navy);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  color: #fff;
  box-shadow: var(--shadow-card);
}

.order-360-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-navy);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.order-code-badge {
  font-family: var(--font-mono);
  background: var(--color-electric-blue);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

.order-status-pill {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid var(--color-emerald);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.order-timeline-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.timeline-step-box {
  background: var(--bg-navy-elevated);
  border: 1px solid var(--border-navy);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.timeline-step-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light-subtle);
  margin-bottom: 0.35rem;
}

.timeline-step-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-sky-blue);
}

/* 2. INTERACTIVE PLANNING CANVAS STAGE */
.canvas-node-pipeline {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  overflow-x: auto;
  padding: 1rem 0;
}

.canvas-node {
  flex: 1;
  min-width: 180px;
  background: var(--bg-navy-card);
  border: 1px solid var(--border-navy-strong);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  position: relative;
}

.node-header {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-sky-blue);
  margin-bottom: 0.5rem;
}

.node-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.node-metric {
  font-size: 0.8rem;
  color: var(--text-light-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
}

.node-arrow {
  color: var(--color-electric-blue);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* 3. SIZE x COLOR MATRIX TABLE */
.matrix-table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-stone-surface);
  border: 1px solid var(--border-stone);
  border-radius: var(--radius-md);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.88rem;
}

.matrix-table th {
  background: var(--bg-stone-muted);
  color: var(--text-dark);
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-stone);
}

.matrix-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-stone);
}

.matrix-input-mock {
  display: inline-block;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--border-stone-strong);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 60px;
}

/* 4. JOB WORK RATE ROLL-UP WIDGET */
.rate-rollup-box {
  background: var(--bg-navy-card);
  border: 1px solid var(--border-navy);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: #fff;
}

.formula-display {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-navy-elevated);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.formula-term {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.term-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-light-subtle);
}

.term-val {
  font-weight: 700;
  color: var(--color-sky-blue);
}

.formula-op {
  font-size: 1.25rem;
  color: var(--color-electric-blue);
  font-weight: 700;
}

/* 5. IN-APP AI COPILOT CHAT SIMULATOR */
.ai-copilot-container {
  background: var(--bg-navy-surface);
  border: 1px solid var(--border-navy-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-navy-glow);
  max-width: 780px;
  margin: 0 auto;
}

.copilot-header {
  background: var(--bg-navy-card);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-navy);
}

.copilot-chat-feed {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 380px;
  overflow-y: auto;
}

.chat-bubble {
  max-width: 85%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.5;
}

.bubble-user {
  align-self: flex-end;
  background: var(--color-electric-blue);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.bubble-ai {
  align-self: flex-start;
  background: var(--bg-navy-card);
  color: var(--text-light);
  border: 1px solid var(--border-navy);
  border-bottom-left-radius: 2px;
}

.copilot-input-bar {
  display: flex;
  padding: 1rem 1.5rem;
  background: var(--bg-navy-card);
  border-top: 1px solid var(--border-navy);
  gap: 0.75rem;
}

.copilot-input {
  flex: 1;
  background: var(--bg-navy-elevated);
  border: 1px solid var(--border-navy);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
}

.copilot-input:focus {
  border-color: var(--color-electric-blue);
}

/* 6. MODAL BOOKING DIALOG */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 30, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-stone-surface);
  border: 1px solid var(--border-stone);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  padding: 2.25rem;
  box-shadow: var(--shadow-elevated);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

[data-theme="dark"] .modal-card {
  background: var(--bg-navy-card);
  border-color: var(--border-navy);
  color: #fff;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark-subtle);
  line-height: 1;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-dark);
}

[data-theme="dark"] .form-label {
  color: var(--text-light);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-stone-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-stone-surface);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .form-control {
  background: var(--bg-navy-elevated);
  border-color: var(--border-navy);
  color: #fff;
}

.form-control:focus {
  border-color: var(--color-electric-blue);
  box-shadow: 0 0 0 3px var(--color-electric-glow);
}
