/**
 * PR341 — Lily Inspection Prep Coach
 * TradeRail Field Portal CSS
 * TradeRail orange: #FF6B00
 * Lily bar: border-left: 4px solid #7C3AED; background: #f5f0ff
 */

/* ─── Main Container ────────────────────────────────────────────────────── */

.inspection-prep-panel {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 0;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ─── Readiness Status Bar ──────────────────────────────────────────────── */

.readiness-status-bar {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  overflow: hidden;
  font-weight: 600;
  font-size: 13px;
}

.readiness-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  opacity: 0.18;
  transition: width 0.4s ease;
  pointer-events: none;
}

.readiness-bar-label {
  position: relative;
  z-index: 1;
  flex: 1;
}

.readiness-bar-blockers {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Bar state variants */

.readiness-bar-red {
  background: #fef2f2;
  border-bottom: 2px solid #ef4444;
  color: #7f1d1d;
}

.readiness-bar-red .readiness-bar-fill {
  background: #ef4444;
}

.readiness-bar-red .readiness-bar-blockers {
  background: #ef4444;
  color: #ffffff;
}

.readiness-bar-amber {
  background: #fffbeb;
  border-bottom: 2px solid #f59e0b;
  color: #78350f;
}

.readiness-bar-amber .readiness-bar-fill {
  background: #f59e0b;
}

.readiness-bar-amber .readiness-bar-blockers {
  background: #f59e0b;
  color: #ffffff;
}

.readiness-bar-green {
  background: #f0fdf4;
  border-bottom: 2px solid #22c55e;
  color: #14532d;
}

.readiness-bar-green .readiness-bar-fill {
  background: #22c55e;
}

/* ─── Lily Insight Bar ──────────────────────────────────────────────────── */

.lily-insight-bar {
  border-left: 4px solid #7C3AED;
  background: #f5f0ff;
  padding: 12px 16px;
  margin: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #3b0764;
  line-height: 1.5;
}

.lily-insight-label {
  font-weight: 700;
  color: #7C3AED;
  margin-right: 4px;
}

.lily-insight-text {
  color: #4c1d95;
}

/* ─── Checklist Container ───────────────────────────────────────────────── */

.checklist-container {
  padding: 0 16px 8px 16px;
}

.checklist-container h3,
.checklist-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 8px 0;
}

/* ─── Checklist Items ───────────────────────────────────────────────────── */

.checklist-item {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  gap: 8px;
  font-size: 13px;
}

.item-state-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-weight: 700;
  font-family: monospace;
}

.item-label {
  flex: 1;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.4;
  min-width: 200px;
}

.item-confirmed-badge {
  font-size: 11px;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* Item state variants */

.item-verified {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.item-verified .item-state-icon {
  color: #16a34a;
}

.item-verified .item-label {
  color: #166534;
}

.item-blocking {
  border-color: #fecaca;
  background: #fef2f2;
}

.item-blocking .item-state-icon {
  color: #dc2626;
}

.item-blocking .item-label {
  color: #991b1b;
  font-weight: 500;
}

.item-unverified {
  border-color: #e5e7eb;
  background: #f9fafb;
}

.item-unverified .item-state-icon {
  color: #6b7280;
}

/* ─── Lily Note (blocking items) ────────────────────────────────────────── */

.lily-note {
  width: 100%;
  margin-top: 4px;
  font-size: 12px;
  color: #7C3AED;
  background: #f5f0ff;
  border-left: 3px solid #7C3AED;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  font-style: italic;
  line-height: 1.4;
}

/* ─── Confirm Item Button ───────────────────────────────────────────────── */

.confirm-item-btn {
  background: #FF6B00;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.confirm-item-btn:hover {
  background: #e05e00;
}

.confirm-item-btn:focus {
  outline: 2px solid #FF6B00;
  outline-offset: 2px;
}

.confirm-item-btn--pending {
  background: #f59e0b;
  color: #1f2937;
}

.confirm-item-btn--done {
  background: #6b7280;
  color: #ffffff;
  cursor: default;
}

.confirm-item-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ─── Outcome Section ───────────────────────────────────────────────────── */

.outcome-section {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.outcome-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
}

.outcome-btn {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: #ffffff;
  color: #374151;
  border-color: #d1d5db;
}

.outcome-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.outcome-btn:focus {
  outline: 2px solid #FF6B00;
  outline-offset: 2px;
}

.outcome-btn[data-outcome="pass"] {
  border-color: #22c55e;
  color: #166534;
}

.outcome-btn[data-outcome="pass"]:hover {
  background: #f0fdf4;
}

.outcome-btn[data-outcome="pass_conditions"] {
  border-color: #f59e0b;
  color: #78350f;
}

.outcome-btn[data-outcome="pass_conditions"]:hover {
  background: #fffbeb;
}

.outcome-btn[data-outcome="fail"] {
  border-color: #ef4444;
  color: #991b1b;
}

.outcome-btn[data-outcome="fail"]:hover {
  background: #fef2f2;
}

.outcome-btn[data-outcome="reinspection_required"] {
  border-color: #f97316;
  color: #7c2d12;
}

.outcome-btn[data-outcome="reinspection_required"]:hover {
  background: #fff7ed;
}

.outcome-btn[data-outcome="cancelled"] {
  border-color: #6b7280;
  color: #374151;
}

.outcome-btn[data-outcome="cancelled"]:hover {
  background: #f3f4f6;
}

.outcome-btn--pending {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

.outcome-btn--done {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: default;
}

.outcome-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .inspection-prep-panel {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .readiness-status-bar {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .outcome-btn {
    display: block;
    width: 100%;
    margin: 4px 0;
    text-align: center;
  }

  .checklist-item {
    padding: 8px;
  }
}
