/**
 * Shopping Cart Changes Stylesheet
 *
 * Styling for AI improvements selection interface (checkbox-based shopping cart)
 */

/* ============================================
   CONTAINER
   ============================================ */
.shopping-cart-container {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 2rem;
  background: transparent; /* Transparent - inherit from parent */
  border-radius: 12px;
  box-shadow: none; /* No shadow - parent has shadow */
}

.dark .shopping-cart-container {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   HEADER
   ============================================ */
.shopping-cart-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.dark .shopping-cart-header {
  border-bottom-color: #334155;
}

.shopping-cart-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600; /* Semibold for hierarchy */
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.dark .shopping-cart-title {
  color: #f1f5f9;
}

.shopping-cart-title .material-symbols-outlined {
  font-size: 2rem;
  color: #137fec;
}

.shopping-cart-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 0 1rem 0;
}

.dark .shopping-cart-subtitle {
  color: #94a3b8;
}

.shopping-cart-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cart-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-action-btn:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
}

.dark .cart-action-btn {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

.dark .cart-action-btn:hover {
  background: #475569;
  border-color: #64748b;
}

.cart-action-btn .material-symbols-outlined {
  font-size: 1.125rem;
}

/* ============================================
   LIST
   ============================================ */
.shopping-cart-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Empty State */
.shopping-cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.shopping-cart-empty .material-symbols-outlined {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.shopping-cart-empty p {
  font-size: 1rem;
  margin: 0;
}

/* ============================================
   CART ITEM
   ============================================ */
.cart-item {
  background: #ffffff; /* White card on gray background */
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle elevation */
}

.dark .cart-item {
  background: #0f172a;
  border-color: #334155;
}

.cart-item:hover {
  border-color: #137fec; /* Primary color on hover */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* Elevated shadow */
}

.cart-item-selected {
  background: #eff6ff;
  border-color: #137fec;
}

.dark .cart-item-selected {
  background: #1e3a5f;
  border-color: #137fec;
}

/* Item Header */
.cart-item-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Checkbox */
.cart-item-checkbox {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.cart-item-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: white;
  transition: all 0.2s ease;
  position: relative;
}

.dark .checkbox-custom {
  background: #1e293b;
  border-color: #475569;
}

.cart-item-checkbox input[type="checkbox"]:checked + .checkbox-custom {
  background: #137fec;
  border-color: #137fec;
}

.cart-item-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.cart-item-checkbox:hover .checkbox-custom {
  border-color: #137fec;
}

/* Meta */
.cart-item-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cart-item-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #475569;
}

.dark .cart-item-section {
  color: #cbd5e1;
}

.section-icon {
  font-size: 1.125rem;
  color: #137fec;
}

.cart-item-type {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Impact Badge */
.cart-item-impact {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
}

.cart-item-impact.impact-high {
  background: #dcfce7;
  color: #166534;
}

.dark .cart-item-impact.impact-high {
  background: #064e3b;
  color: #6ee7b7;
}

.cart-item-impact.impact-medium {
  background: #dbeafe;
  color: #1e40af;
}

.dark .cart-item-impact.impact-medium {
  background: #1e3a8a;
  color: #93c5fd;
}

.cart-item-impact.impact-low {
  background: #f3f4f6;
  color: #6b7280;
}

.dark .cart-item-impact.impact-low {
  background: #374151;
  color: #9ca3af;
}

/* ============================================
   ITEM BODY
   ============================================ */
.cart-item-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Reason */
.cart-item-reason {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #78350f;
  line-height: 1.5;
}

.dark .cart-item-reason {
  background: #451a03;
  color: #fcd34d;
}

.reason-icon {
  font-size: 1.25rem;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* Diff */
.cart-item-diff {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}

.diff-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.diff-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.diff-content {
  padding: 0.75rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #475569;
}

.dark .diff-content {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.diff-before .diff-content {
  border-left: 3px solid #ef4444;
  background: #fef2f2;
}

.dark .diff-before .diff-content {
  background: #450a0a;
}

.diff-after .diff-content {
  border-left: 3px solid #10b981;
  background: #f0fdf4;
}

.dark .diff-after .diff-content {
  background: #052e16;
}

.diff-arrow {
  display: flex;
  align-items: center;
  padding-top: 2rem;
}

.diff-arrow .material-symbols-outlined {
  font-size: 1.5rem;
  color: #cbd5e1;
}

/* ============================================
   SUMMARY
   ============================================ */
.shopping-cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: #f1f5f9;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
}

.dark .shopping-cart-summary {
  background: #0f172a;
  border-color: #334155;
}

.summary-stats {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.summary-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
}

.dark .summary-label {
  color: #94a3b8;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.dark .summary-value {
  color: #f1f5f9;
}

.summary-impact {
  color: #059669;
}

.summary-impact.summary-impact-zero {
  color: #94a3b8;
}

.summary-total {
  font-size: 1rem;
  color: #94a3b8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .shopping-cart-container {
    padding: 1.5rem;
  }

  .shopping-cart-title {
    font-size: 1.25rem;
  }

  .cart-item {
    padding: 1rem;
  }

  .cart-item-header {
    flex-wrap: wrap;
  }

  .cart-item-diff {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .diff-arrow {
    display: none;
  }

  .shopping-cart-summary {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .shopping-cart-container {
    padding: 1rem;
  }

  .shopping-cart-actions {
    flex-direction: column;
  }

  .cart-action-btn {
    width: 100%;
    justify-content: center;
  }

  .summary-value {
    font-size: 1.25rem;
  }
}

/* ============================================
   MATERIAL SYMBOLS ICONS
   ============================================ */
.change-icon .material-symbols-outlined {
  font-size: 1.5rem;
  color: #3b82f6;
  font-variation-settings:
    'FILL' 0,
    'wght' 300,
    'GRAD' 0,
    'opsz' 24;
}

.dark .change-icon .material-symbols-outlined {
  color: #60a5fa;
}
