/* Custom styles */
body {
  font-family: "Inter", sans-serif; /* Using Inter font as recommended */
}

/* Deck Calculator Header with gradient background */
.deck-calculator-header {
  background: linear-gradient(135deg, #4A90E2 0%, #50C878 100%);
  padding: 1rem;
  margin: -1rem -1rem 2rem -1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3);
  position: relative;
  overflow: hidden;
}

.deck-calculator-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.deck-calculator-header h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.025em;
}

/* Mobile responsiveness for header */
@media (max-width: 768px) {
  .deck-calculator-header {
    margin: -1rem -1rem 1.5rem -1rem;
    padding: 0.75rem 1rem;
  }
  
  .deck-calculator-header h1 {
    font-size: 1.5rem;
    text-align: center;
  }
}

/* Desktop enhancement */
@media (min-width: 1024px) {
  .deck-calculator-header {
    padding: 1.25rem;
    margin: -2rem -2rem 2.5rem -2rem;
  }
}
/* Global styles */
html {
  scroll-behavior: smooth;
}

body {
  transition: background-color 0.3s ease;
}

/* Ensure canvas container respects aspect ratio */
#canvasContainerWrapper {
  position: relative;
  width: 100%;
}

/* Status message styling */
#canvasStatus {
  padding: 0.5rem 0.75rem;
  background-color: #f1f5f9;
  border-radius: 0.375rem;
  border-left: 3px solid #4a90e2;
  transition: all 0.3s ease;
}

/* Style adjustments during blueprint mode */
.blueprint-mode #canvasStatus {
  background-color: #ebf5ff;
  border-left-color: #3b82f6;
}

#canvasContainer {
  position: relative;
  width: 100%;
  aspect-ratio: 50 / 40;
  border: 1px solid #d9d9d9;
  border-radius: 0.375rem;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#canvasContainer:hover {
  border-color: #b0b0b0;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  transition: background-color 0.3s ease, filter 0.3s ease;
}

/* Mode transition animations */
canvas.mode-transition {
  animation: pulse 0.5s ease;
}

.mode-changing {
  transition: all 0.5s ease;
}

.mode-changing #canvasContainer {
  transform: scale(0.98);
  transition: transform 0.5s ease;
}

@keyframes pulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
  100% { filter: brightness(1); }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}

.ripple-effect:active::after {
  transform: scale(0, 0);
  opacity: 0.5;
  transition: 0s;
}

/* Blueprint mode styles */
.blueprint-mode #canvasContainer {
  border-color: #4a90e2;
  box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.3);
}

.blueprint-mode canvas {
  background-color: #f8fafc;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 24px 24px; /* Match PIXELS_PER_FOOT */
}

/* Cursor styles for different interaction modes */
#canvasContainer {
  cursor: crosshair;
}

.blueprint-mode #canvasContainer {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%233b82f6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg>') 12 12, crosshair;
}

/* Cursor for wall selection mode */
.wall-selection-mode #canvasContainer {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23FFD700" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3" fill="%23FFD700"/><path d="M12 1v6m0 6v6m11-7h-6m-6 0H1"/></svg>') 12 12, crosshair;
}

/* Cursor for stair placement mode */
.stair-placement-mode #canvasContainer {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%238D6E63" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>') 12 12, pointer;
}
.info-card {
  background-color: #ffffff;
  border: 1px solid #f4f4f4;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  padding: 1rem;
  transition: box-shadow 0.3s ease;
}

/* Add consistent spacing between info-cards in main content panel */
#main-content-panel .info-card + .info-card {
  margin-top: 2rem;
}

/* Add consistent spacing between cards in input panel */
#input-panel .info-card + .info-card {
  margin-top: 2rem;
}

/* Align Materials List title with floating controls */
#bomSection {
  position: relative;
}

#bomSection > .flex:first-child {
  align-items: center;
  min-height: 2.25rem; /* Match button container height */
  margin-bottom: 0; /* Remove margin to merge with button row */
}

#bomSection h2 {
  margin: 0;
  line-height: 1;
  font-size: 1.25rem; /* Ensure consistent font size */
}

/* Merge the title row with the button row for better alignment */
#bomSection > .flex:first-child + .flex {
  margin-top: -2.25rem; /* Pull buttons up to align with title */
  position: relative;
  z-index: 1;
}

/* Add subtle hover effect to cards */
.info-card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.button-container {
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.bom-table th,
.bom-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  transition: all 0.15s ease;
}

.bom-table th {
  background-color: #f3f4f6;
  color: #111827;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 #e5e7eb;
}

.bom-table tr {
  transition: background-color 0.15s ease;
}

.bom-table tr:hover td {
  background-color: rgba(74, 144, 226, 0.04);
}

.bom-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.bom-table tr:last-child td {
  border-bottom: none;
}

.bom-table .qty-col {
  text-align: right;
  white-space: nowrap;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Hide pricing columns and total row in all views */
.price-col,
.bom-table th:nth-child(4),
.bom-table th:nth-child(5),
.bom-table td:nth-child(4),
.bom-table td:nth-child(5),
.bom-table tr.font-semibold {
  display: none;
}

/* Make the total row stand out */
.bom-table tr.font-semibold td {
  background-color: #f0f9ff;
  color: #0c4a6e;
  font-weight: 600;
  border-top: 2px solid #e5e7eb;
}
.summary-list dt {
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.1rem;
  transition: all 0.2s ease;
}

.summary-list dd {
  margin-left: 0.5rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

/* Add subtle hover effects to summary data */
.summary-list dt:hover + dd,
.summary-list dd:hover {
  background-color: rgba(0, 0, 0, 0.02);
  transform: translateX(2px);
  color: #1f2937;
  border-radius: 0.25rem;
}

/* Add data attributes in JavaScript for these key metrics
   but for now, let's modify the first few items which will be the key dimensions */
/* All summary text now uses consistent styling */
.legend-item {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
  margin-bottom: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  cursor: help;
  border: 1px solid transparent;
}

.legend-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.legend-icon {
  width: 1rem;
  height: 0.125rem;
  margin-right: 0.5rem;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.legend-item:hover .legend-icon {
  transform: scale(1.1);
}

/* Post/Footing representation (small square) */
.legend-icon-post {
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid #000000;
  border-radius: 0;
  background-color: transparent;
  transition: all 0.2s ease;
}

/* Blueprint mode uses the same small square */
.blueprint-mode .legend-icon-post {
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid #000000;
  border-radius: 0;
  background-color: transparent;
}

#legend {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.blueprint-mode #legend {
  background-color: rgba(59, 130, 246, 0.03);
  border-color: rgba(59, 130, 246, 0.2);
}
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.btn-full-width {
  width: 100%;
}

.btn-primary {
  background-color: #1a2b49;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary:hover {
  background-color: #2a3b59;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:active {
  background-color: #4a90e2;
}

.btn-primary:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.4s, opacity 0.8s;
}

.btn-primary:active:after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* Special styling for blueprint toggle button */
#blueprintToggleBtn {
  position: relative;
  overflow: hidden;
}

#blueprintToggleBtn.btn-primary {
  background-color: #3b82f6;
}

#blueprintToggleBtn.btn-primary:hover {
  background-color: #2563eb;
}

#blueprintToggleBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.2) 50%, 
    rgba(255,255,255,0) 100%
  );
  transition: all 0.6s;
}

#blueprintToggleBtn:hover::before {
  left: 100%;
}

/* Add special icon glow in blueprint mode */
.blueprint-mode #blueprintToggleBtn svg {
  filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.5));
  animation: softPulse 2s infinite;
}

@keyframes softPulse {
  0% { opacity: 0.9; }
  50% { opacity: 1; }
  100% { opacity: 0.9; }
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #4b5563;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary:active {
  background-color: #d1d5db;
}

/* Group buttons animation */
.btn + .btn {
  margin-left: 0.25rem;
}

/* Canvas control button group special treatment */
#zoomInBtn, #zoomOutBtn, #centerFitBtn, #blueprintToggleBtn, #clearCanvasBtn {
  transition: all 0.2s ease, margin 0s;
  background-color: rgba(241, 245, 249, 0.95);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

#zoomInBtn:hover, #zoomOutBtn:hover, #centerFitBtn:hover, #blueprintToggleBtn:hover, #clearCanvasBtn:hover {
  z-index: 2;
  background-color: rgba(226, 232, 240, 0.95);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Floating controls container */
.floating-controls {
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.25rem;
}

/* Enhanced shadow for floating buttons */
.floating-controls .shadow-lg {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Mobile responsiveness for floating controls */
@media (max-width: 768px) {
  .floating-controls {
    top: 0.5rem;
    right: 0.5rem;
    gap: 0.375rem;
  }
  
  #zoomInBtn, #zoomOutBtn, #centerFitBtn, #blueprintToggleBtn, #clearCanvasBtn {
    padding: 0.375rem 0.625rem;
  }
  
  #zoomInBtn svg, #zoomOutBtn svg, #centerFitBtn svg, #blueprintToggleBtn svg, #clearCanvasBtn svg {
    width: 1.125rem;
    height: 1.125rem;
  }
}
.form-input,
.form-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d9d9d9;
  border-radius: 0.375rem;
  margin-top: 0.25rem;
  transition: all 0.2s ease;
  background-color: #ffffff;
  font-size: 0.95rem;
}

.form-input:hover,
.form-select:hover {
  border-color: #b0b0b0;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
  transform: translateY(-1px);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25rem;
  padding-right: 2rem;
  appearance: none;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #333333;
  transition: color 0.2s ease;
}

.form-input:focus + .form-label,
.form-select:focus + .form-label {
  color: #4a90e2;
}
.legend-icon-blocking {
  background-color: #8b5cf6;
}

/* Dimension input styling */
#dimensionInputContainer {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.75rem;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes success-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.shake-animation {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.success-animation {
  animation: success-pulse 0.5s ease-in-out;
  border-color: #4ade80 !important;
}

.input-error {
  border-color: #ef4444 !important;
  background-color: rgba(254, 226, 226, 0.5) !important;
}

/* Style dimension input elements */
#dimensionFeetInput, #dimensionInchesInput {
  width: 4rem;
  text-align: center;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  transition: all 0.2s ease;
}

#dimensionFeetInput:focus, #dimensionInchesInput:focus {
  transform: translateY(-1px);
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#applyDimensionBtn, #cancelDimensionBtn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

#applyDimensionBtn {
  background-color: #4a90e2;
  color: white;
  border-color: #3a80d2;
}

#applyDimensionBtn:hover {
  background-color: #3a80d2;
  transform: translateY(-1px);
}

#cancelDimensionBtn:hover {
  background-color: #e9ecef;
  transform: translateY(-1px);
}

/* Blueprint mode dimension input styling */
.blueprint-mode #dimensionInputContainer {
  background-color: #ebf5ff;
  border-color: rgba(59, 130, 246, 0.3);
}

.blueprint-mode #dimensionFeetInput:focus,
.blueprint-mode #dimensionInchesInput:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.blueprint-mode #applyDimensionBtn {
  background-color: #3b82f6;
  border-color: #2563eb;
}

/* --- PRINT STYLES --- */
@media print {
  /* Global print styles */
  
  body {
    font-size: 10pt;
    margin: 20px !important;
    padding: 0 !important;
    background-color: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important; /* Modern browsers */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><text x="20" y="180" font-family="Arial" font-size="14" fill="rgba(200,200,200,0.3)" transform="rotate(-45 100 100)">Deck Calculator Plan</text></svg>') !important;
    background-repeat: repeat !important;
    background-position: center center !important;
  }
  
  /* Add print header with title and project name */
  /* Remove the CSS-generated title to prevent duplication */
  body::before {
    display: none !important;
  }
  
  /* Remove fallback header as well */
  body:not([data-project-name])::before {
    display: none !important;
  }
  
  /* Add print footer info */
  @page {
    margin-bottom: 1.5cm;
  }
  
  body::after {
    content: "Deck Calculator - " attr(data-project-name) " | " attr(data-print-date);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 8pt;
    text-align: center;
    color: #666;
    padding-top: 0.3cm;
    border-top: 1px solid #eee;
  }
  
  /* Fallback footer when no project name is set */
  body:not([data-project-name])::after {
    content: "Deck Calculator - Printed Plan | " attr(data-print-date);
  }

  /* Hide the gradient header in print view */
  .deck-calculator-header {
    display: none !important;
  }
  
  /* Hide tab navigation and related elements in print view */
  .tab-navigation {
    display: none !important;
  }
  
  /* Ensure tab content container shows properly in print */
  .tab-content-container {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Show only active tab content in print */
  .tab-content {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .tab-content.active {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Main structure tab layout for print */
  #structure-content.active {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    position: relative !important;
    overflow: visible !important;
  }
  
  /* Remove the CSS-generated title since it's already in the HTML */
  
  /* Remove duplicate rules */

  /* Hide elements not needed for the specified print layout */
  #generatePlanBtn,
  #addStairsBtn,
  #cancelStairsBtn,
  /* #clearCanvasBtn, -- This was part of the new button group, ensure it's handled if it was moved */
  .button-container, 
  #canvasStatus,
  body > div[style*="z-index: 9999"], 
  #printPageBtn, 
  #zoomInBtn,
  #zoomOutBtn,
  #centerFitBtn,
  #clearCanvasBtn,
  #blueprintToggleBtn,
  #toggleDecompositionBtn,
  .floating-controls,
  #printBomBtn,
  #resetAllBomBtn,
  #resetAllBtn,
  #bomSection .flex.justify-between.items-center.mb-4:last-child,
  #bomSection button,
  button#resetAllBtn {
    /* Explicitly hide buttons for print view */
    display: none !important;
  }

  /* Remove duplicate input panel rules */
  
  /* Remove duplicate main content panel rules */
  
  /* Canvas wrapper parent (info-card) */
  #structure-content.active #main-content-panel > .info-card:first-child {
    display: block !important;
    margin: 0 !important;
  }
  
  /* Canvas stays in the right column */
  #structure-content.active #canvasContainerWrapper {
    display: block !important;
    margin: 0 !important;
  }
  
  /* Remove duplicate BOM positioning */
  
  /* Remove grid-specific rules */
  
  /* Hide legend in print - it's between input-panel and main-content-panel */
  .legend-card,
  #legend,
  #structure-content .legend-card,
  #structure-content #legend,
  #main-layout-container .legend-card {
    display: none !important;
  }

  /* Show the contextual panel card properly for print */
  #structure-content.active #input-panel > .info-card:first-child,
  #input-panel > .info-card:first-child {
    display: block !important;
    border: 1px solid #ddd !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    background-color: #fff !important;
    page-break-inside: avoid !important;
    margin: 0 !important;
    position: relative !important;
  }
  
  #input-panel > .info-card:first-child::before {
    content: "Project Summary" !important;
    position: absolute !important;
    top: 0.25rem !important;
    left: 0.75rem !important;
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #1A2B49 !important;
    background-color: white !important;
    padding: 0 0.25rem !important;
    transform: translateY(-50%) !important;
  }

  /* Force all panel sections to be visible in print and show only plan-generated content */
  .panel-section {
    display: none !important;
  }
  
  .panel-section.hidden {
    display: none !important;
  }
  
  #plan-generated-panel {
    display: block !important;
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  #plan-generated-panel.hidden {
    display: block !important;
  }
  
  /* Hide everything in plan-generated-panel except summary */
  #plan-generated-panel > * {
    display: none !important;
  }
  
  #plan-generated-panel .panel-title {
    display: none !important;
  }
  
  #plan-generated-panel .panel-content {
    display: block !important;
  }
  
  #plan-generated-panel .panel-content > *:not(#summarySection) {
    display: none !important;
  }
  
  #summarySection {
    display: block !important;
    margin-top: 0.5rem !important;
    border-top: none !important;
    padding-top: 0.25rem !important;
    visibility: visible !important;
  }
  
  #summarySection h3 {
    display: none !important; /* Hide heading since we're using ::before content */
  }
  
  /* Ensure summary list and its content are visible */
  #summaryList {
    display: block !important;
    visibility: visible !important;
  }
  
  /* Ensure all summary content elements are shown */
  #summaryList dt,
  #summaryList dd {
    display: block !important;
    visibility: visible !important;
  }
  
  /* Override any global hidden classes in print */
  .hidden {
    display: none !important;
  }
  
  #plan-generated-panel.hidden {
    display: block !important;
  }
  
  #summarySection.hidden {
    display: block !important;
  }
  
  #summaryList.hidden {
    display: block !important;
  }
  
  /* Enhance summary list for print - vertical layout with title above content */
  .summary-list {
    display: flex !important;
    flex-direction: column !important;
    font-size: 9pt !important;
    line-height: 1.3 !important;
  }
  
  .summary-list dt {
    font-weight: 600 !important;
    color: #1f2937 !important;
    position: relative !important;
    margin-bottom: 0 !important;
    padding-top: 0.4rem !important;
  }
  
  .summary-list dt:first-child {
    padding-top: 0 !important;
  }
  
  .summary-list dd {
    margin-left: 0.5rem !important;
    margin-bottom: 0.2rem !important;
    color: #4b5563 !important;
  }
  
  /* All summary text uses consistent styling */
  .summary-list dt,
  .summary-list dd {
    page-break-inside: avoid !important;
  }

  /* Canvas container within tab structure */
  #structure-content #canvasContainerWrapper,
  #canvasContainerWrapper {
    display: block !important;
    padding: 0.75rem !important;
    border: 1px solid #bbb !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    margin: 0 !important;
    background-color: #fff !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
  }
  
  #canvasContainerWrapper::before {
    content: "Deck Layout" !important;
    position: absolute !important;
    top: 0.25rem !important;
    left: 0.75rem !important;
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #1A2B49 !important;
    background-color: white !important;
    padding: 0 0.25rem !important;
    transform: translateY(-50%) !important;
  }
  
  /* Style for blueprint mode in print */
  .blueprint-mode #canvasContainerWrapper::before {
    content: "Deck Layout - Blueprint Mode" !important;
    color: #3b82f6 !important;
  }
  
  .blueprint-mode #canvasContainerWrapper {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2) !important;
  }
  
  #canvasContainer {
    border: none !important;
    border-radius: 0.25rem !important;
    overflow: hidden !important;
    margin-top: 0.25rem !important;
  }
  
  #deckCanvas {
    border: none !important;
  }

  #legend {
    display: flex !important;
    flex-wrap: wrap !important;
    font-size: 8pt !important;
    margin-bottom: 0.75rem !important;
    padding: 0.5rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.25rem !important;
    background-color: #f9fafb !important;
  }
  
  #legend h3 {
    display: block !important;
    width: 100% !important;
    font-size: 9pt !important;
    font-weight: 600 !important;
    margin-bottom: 0.25rem !important;
    color: #1f2937 !important;
  }
  
  .legend-item {
    margin-right: 0.75rem !important;
    margin-bottom: 0.2rem !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.2rem !important;
    background-color: rgba(0,0,0,0.02) !important;
  }
  
  .legend-icon {
    width: 0.8rem !important;
    height: 0.1rem !important;
  }
  
  .legend-icon-post,
  .legend-icon-footing {
    width: 0.6rem !important;
    height: 0.6rem !important;
  }

  /* BOM section within tab structure - base styles */
  #bomSection {
    display: block !important;
    margin: 1rem 0 0 0 !important;
    padding: 0.75rem !important;
    border: 1px solid #ddd !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    background-color: #fff !important;
    width: 100% !important;
    position: relative !important;
    page-break-before: auto !important;
    clear: both !important;
  }
  
  /* FIXED TWO-COLUMN PRINT LAYOUT */
  
  /* Add title at top */
  #structure-content.active::before {
    content: "Deck Calculator - My Deck Project - Plan and Bill of Materials" !important;
    display: block !important;
    text-align: center !important;
    font-size: 16pt !important;
    font-weight: bold !important;
    color: #1A2B49 !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid #ccc !important;
  }
  
  /* FORCE TWO-COLUMN LAYOUT WITH GRID - ADJUSTED WIDTHS TO FIT */
  #structure-content.active #main-layout-container {
    display: grid !important;
    grid-template-columns: 35% 64% !important;
    grid-gap: 1% !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    align-items: start !important;
  }
  
  /* Place input panel in first column */
  #structure-content.active #input-panel {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Place main content panel in second column */
  #structure-content.active #main-content-panel {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Hide any element between the panels (like legend) */
  #structure-content.active #main-layout-container > *:not(#input-panel):not(#main-content-panel) {
    display: none !important;
  }
  
  /* Override any Tailwind width classes */
  #structure-content.active .lg\\:w-1\\/4 {
    width: 30% !important;
    max-width: 30% !important;
  }
  
  #structure-content.active .lg\\:w-3\\/4 {
    width: 68% !important;
    max-width: 68% !important;
  }
  
  /* Ensure proper stacking of BOM below the two-column layout */
  body.is-printing #structure-content.active {
    position: relative !important;
  }
  
  /* During print, move BOM to full-width below the columns */
  body.is-printing #bomSection {
    position: relative !important;
    width: 100% !important;
    margin: 2rem 0 0 0 !important;
    padding: 0.75rem !important;
    display: block !important;
    clear: both !important;
    page-break-inside: avoid !important;
  }
  
  /* Remove redundant media query */
  
  #bomSection::before {
    content: "Materials List" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0.75rem !important;
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #1A2B49 !important;
    background-color: white !important;
    padding: 0 0.25rem !important;
    transform: translateY(-50%) !important;
  }
  
  #bomSection h2 {
    display: none !important; /* Hide the heading since we're using the ::before content */
  }
  
  /* Hide all BOM buttons including Reset All */
  #bomSection .flex.justify-end,
  #bomSection button,
  #bomSection .btn,
  .flex:has(#resetAllBtn) {
    display: none !important;
  }
  
  .bom-table {
    width: 100% !important;
    font-size: 9pt !important;
    border-collapse: collapse !important;
    margin-top: 0.5rem !important;
  }
  
  .bom-table th,
  .bom-table td {
    border: 1px solid #e5e7eb !important;
    padding: 0.3rem 0.5rem !important;
    text-align: left !important;
  }
  
  .bom-table th {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
    font-weight: 600 !important;
  }
  
  .bom-table tr:nth-child(even) {
    background-color: #f9fafb !important;
  }
  
  /* Pricing columns already hidden globally */
  
  /* No need for the print-specific note anymore since pricing is hidden everywhere */

  .info-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    background-color: #fff !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .lg\:shadow-xl {
    box-shadow: none !important;
  }
  .container.mx-auto.max-w-7xl {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }
  
  /* Ensure structure content uses full width */
  #structure-content,
  #structure-content.active {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* Contextual Panel Styles */
.contextual-panel {
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.panel-section {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
}

.panel-section.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
}

.panel-section.hidden {
  display: none;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1A2B49;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.panel-title::before {
  content: '';
  width: 4px;
  height: 1.5rem;
  background-color: #4A90E2;
  margin-right: 0.75rem;
  border-radius: 2px;
}

.instruction-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.instruction-text {
  color: #4b5563;
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0;
}

/* Collapsible sections */
.collapsible-toggle {
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.collapsible-toggle:hover {
  background-color: #e5e7eb;
}

.collapsible-toggle::after {
  content: '▼';
  transition: transform 0.2s ease;
  font-size: 0.875rem;
}

.collapsible-toggle.expanded::after {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: white;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0 0 0.375rem 0.375rem;
  margin-top: -1px;
}

.collapsible-content.expanded {
  max-height: 500px;
  padding: 1rem;
}

/* Enhanced button styles */
.btn-large {
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.basic-specs {
  margin-bottom: 1.5rem;
}

.drawing-instructions {
  background-color: #f0f9ff;
  border-left: 4px solid #4A90E2;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.stair-specs {
  margin: 1rem 0;
}

.stair-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* State-specific styles */
#specification-panel .primary-action {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

#plan-generated-panel .panel-content {
  animation: slideInUp 0.4s ease-out;
}

#plan-generated-panel #summarySection {
  border: none;
  margin-top: 0;
  padding-top: 0;
}

#stair-config-panel .instruction-box {
  background-color: #fef3c7;
  border-color: #f59e0b;
}

/* Additional specifications styling */
.additional-specs {
  margin-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.spec-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

/* Spec editor styling */
.spec-editor {
  margin-top: 1rem;
}

.modify-specs-btn {
  position: relative;
}

.modify-specs-btn.active {
  background-color: #4A90E2;
  color: white;
}

/* Panel transition animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.panel-section.entering {
  animation: fadeIn 0.3s ease-in-out;
}

/* Responsive adjustments for contextual panels */
@media (max-width: 768px) {
  .contextual-panel {
    min-height: 300px;
  }
  
  .panel-title {
    font-size: 1.125rem;
  }
  
  .panel-title::before {
    width: 3px;
    height: 1.25rem;
  }
  
  .btn-large {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
  
  .instruction-box {
    padding: 0.75rem;
  }
  
  .action-buttons {
    gap: 0.5rem;
    margin: 1rem 0;
  }
}

/* Tab Navigation Styles */
.tab-navigation {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 0.75rem 0.75rem 0 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.tab-list {
  display: flex;
  padding: 0.5rem;
  gap: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  background-color: transparent;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.tab-button:hover {
  background-color: #f3f4f6;
  color: #374151;
  transform: translateY(-1px);
}

.tab-button.active {
  background-color: #4A90E2;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.tab-button.active:hover {
  background-color: #3a80d2;
  transform: translateY(-1px);
}

.tab-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.tab-button:hover .tab-icon {
  transform: scale(1.05);
}

.tab-label {
  font-weight: 500;
}

.coming-soon-badge {
  display: inline-block;
  background-color: #fbbf24;
  color: #92400e;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.tab-button.active .coming-soon-badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Tab Content Styles */
.tab-content-container {
  background-color: transparent;
  border-radius: 0 0 0.75rem 0.75rem;
  overflow: hidden;
}

.tab-content {
  display: none;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Coming Soon Content Styles */
.coming-soon-content {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
}

.coming-soon-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
}

.coming-soon-icon svg {
  width: 2rem;
  height: 2rem;
  stroke: #9ca3af;
}

.coming-soon-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

.coming-soon-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #6b7280;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.coming-soon-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.feature-tag {
  display: inline-block;
  background-color: #e5e7eb;
  color: #4b5563;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  white-space: nowrap;
}

/* Mobile responsiveness for tabs */
@media (max-width: 768px) {
  .tab-list {
    padding: 0.25rem;
    gap: 0.125rem;
  }
  
  .tab-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .tab-icon {
    width: 1rem;
    height: 1rem;
  }
  
  .coming-soon-badge {
    font-size: 0.5rem;
    padding: 0.125rem 0.25rem;
    margin-left: 0;
    margin-top: 0.125rem;
  }
  
  .tab-content {
    padding: 1rem;
  }
  
  .coming-soon-content {
    padding: 2rem 1rem;
  }
  
  .coming-soon-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
  }
  
  .coming-soon-icon svg {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  .coming-soon-title {
    font-size: 1.25rem;
  }
  
  .coming-soon-description {
    font-size: 0.875rem;
  }
  
  .feature-tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
  }
  
  .preview-section {
    padding: 1.5rem 1rem;
    margin: 1rem 0;
  }
}

@media (max-width: 480px) {
  .tab-button {
    padding: 0.5rem 0.75rem;
    min-width: 70px;
  }
  
  .tab-icon {
    width: 1rem;
    height: 1rem;
  }
  
  .tab-label {
    font-size: 0.5rem;
  }
  
  .coming-soon-title {
    font-size: 1.25rem;
  }
  
  .coming-soon-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tab-button {
    border: 2px solid currentColor;
  }
  
  .tab-button.active {
    background: #000000;
    color: #ffffff;
  }
  
  .coming-soon-badge {
    border: 1px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .tab-button,
  .tab-icon,
  .tab-content,
  .coming-soon-icon,
  .feature-tag {
    animation: none !important;
    transition: none !important;
  }
  
  .tab-button:hover {
    transform: none;
  }
  
  .coming-soon-badge {
    animation: none;
  }
}

/* ========================================
   STAIR MANAGEMENT STYLES
   ======================================== */

.stair-management-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
  margin-top: 1rem;
}

.stair-list {
  max-height: 200px;
  overflow-y: auto;
}

.stair-list:empty::before {
  content: "No stairs added yet";
  display: block;
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 1rem;
  background-color: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
}

.stair-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.stair-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.stair-item.selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
  box-shadow: 0 0 0 1px #3b82f6;
}

.stair-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.stair-item-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.875rem;
  margin-right: 1rem;
}

.stair-item-actions {
  display: flex;
  gap: 0.5rem;
}

.stair-item-info {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}

.selected-stair-controls {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button variations for stair management */
.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
  border: 1px solid #dc2626;
}

.btn-danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger:focus {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.btn-icon {
  padding: 0.25rem;
  min-width: auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 1rem;
  height: 1rem;
}

.stair-action-btn {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.stair-item:hover .stair-action-btn,
.stair-item.selected .stair-action-btn {
  opacity: 1;
}

/* Enhanced selection feedback */
.stair-selected-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background-color: #3b82f6;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Canvas interaction enhancements */
.stair-placement-active canvas {
  cursor: crosshair;
}

.stair-placement-active .stair-item {
  opacity: 0.5;
  pointer-events: none;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .stair-item-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .selected-stair-controls .flex {
    flex-direction: column;
  }
  
  .btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ========================================
   EDITABLE BOM STYLES
   ======================================== */

/* Quantity controls container */
.qty-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 60px;
  width: 100%;
}

.qty-controls.qty-modified {
  padding: 0.125rem;
}

/* Quantity input field */
.qty-input {
  width: 3rem;
  text-align: center;
  padding: 0.25rem 0.125rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  transition: all 0.2s ease;
  background-color: white;
}

.qty-input:focus {
  outline: none !important;
  border-color: #d1d5db !important;
  box-shadow: none !important;
  transform: none !important;
}

.qty-input.qty-modified {
  background-color: rgba(251, 191, 36, 0.05);
  border-color: #f59e0b;
  font-weight: 600;
}


/* Original quantity display */
.qty-original {
  font-size: 0.625rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.125rem;
  text-align: center;
  line-height: 1.2;
}

/* Row highlighting for modified items */
.bom-table tr:has(.qty-modified) {
  background-color: rgba(251, 191, 36, 0.05) !important;
}

.bom-table tr:has(.qty-modified):hover td {
  background-color: rgba(251, 191, 36, 0.1) !important;
}

/* Reset All button styling */
#resetAllBomBtn {
  transition: all 0.2s ease;
}

#resetAllBomBtn:hover {
  background-color: #f1f5f9;
  transform: translateY(-1px);
}

#resetAllBomBtn svg {
  transition: transform 0.2s ease;
}

#resetAllBomBtn:hover svg {
  transform: rotate(180deg);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .qty-controls {
    min-width: 50px;
  }
  
  .qty-input {
    width: 2.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.125rem;
  }
  
  .qty-original {
    font-size: 0.5rem;
  }
}


/* Legend card styling */
.legend-card {
  margin-top: 1rem;
}

.legend-card #legend {
  margin: 0;
}

.legend-items-vertical {
  line-height: 1.2;
}

.legend-items-vertical .legend-item {
  line-height: 1.3;
  display: flex;
  align-items: center;
}

/* Copy icon for item names */
.copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.copy-icon:hover {
  opacity: 1;
}

.copy-icon svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: currentColor;
  fill: none;
}

/* Print styles for editable BOM */
@media print {
  .qty-controls {
    display: none !important;
  }
  
  .qty-original {
    display: none !important;
  }
  
  .copy-icon {
    display: none !important;
  }
  
  /* Show the quantity value directly in the cell for print */
  .bom-table .qty-col {
    text-align: right !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0.3rem 0.25rem !important;
  }
  
  /* Add the quantity value as text content for print */
  .bom-table .qty-col::after {
    content: attr(data-print-qty) !important;
    display: block !important;
    text-align: right !important;
    font-feature-settings: "tnum" !important;
    font-variant-numeric: tabular-nums !important;
    font-size: 9pt !important;
    font-weight: normal !important;
  }
}
