body {
    padding: 30px;
  }
  
  /* Adjust body padding for mobile */
  @media (max-width: 768px) {
    body {
      padding: 15px 10px;
    }
  }
  
  .log {
    max-height: 700px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 10px;
    border: 1px solid #dee2e6;
    font-family: monospace;
    white-space: pre-line;
  }

    /* Make form more compact */
    .card-body {
      padding: 0.75rem;
    }
    .form-group {
      margin-bottom: 0.5rem;
    }
    .card {
      margin-bottom: 0.5rem;
    }
    /* Sticky Run button at top */
    .sticky-top-btn {
      position: sticky;
      top: 0;
      z-index: 100;
    }

  @media (min-width: 1200px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl {
        max-width: 1780px;
    }
}

/* Toast styling */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 350px;
}

.sim-toast {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  overflow: hidden;
  transform: translateX(100%);
  transition: opacity 0.3s, transform 0.3s;
}

.sim-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.sim-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.sim-toast-body {
  padding: 10px 15px;
}

.sim-toast.success {
  border-left: 4px solid #28a745;
}

.sim-toast.error {
  border-left: 4px solid #dc3545;
}

.sim-toast.info {
  border-left: 4px solid #17a2b8;
}

.sim-toast.warning {
  border-left: 4px solid #ffc107;
}

/* Print-friendly styles */
.print-config {
  display: none;
}

/* Class to hide logs when printing */
.no-print-logs {
  display: block; /* Normal display */
}

@media print {
  /* Hide elements not needed for printing */
  .sticky-top-btn,
  #runSimulation, 
  #runSimulationTop,
  .custom-file,
  .position-absolute,
  #saveConfig,
  #loadConfig,
  #configFilename,
  #toastContainer,
  .input-section,
  #printButtonContainer {
    display: none !important;
  }
  
  /* Hide logs when printing unless checkbox is checked */
  .no-print-logs {
    display: none !important;
  }
  
  /* Show the printable config section */
  .print-config {
    display: block !important;
    margin-top: 20px;
    page-break-inside: avoid;
  }
  
  /* Ensure the log has a fixed height for printing */
  .log {
    max-height: none;
    height: auto;
    overflow: visible;
    page-break-inside: auto;
  }
  
  /* Make sure we don't cut off elements */
  .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  
  /* Adjust layout for printing */
  .col-md-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }
  
  /* Remove shadows and borders that don't print well */
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  /* Hide buttons */
  .btn {
    display: none !important;
  }
  
  /* More readable text */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
    padding: 0;
    margin: 0;
  }
  
  /* Ensure chart renders properly */
  #balanceChart {
    max-width: 100%;
    height: auto !important;
  }
  
  /* Ensure page breaks don't occur in the middle of important sections */
  .card, 
  #finalSummary {
    page-break-inside: avoid;
  }
}

/* Simulation Details table styling */
#finalSummary table {
  margin-bottom: 0;
}

#finalSummary td {
  padding: 5px 10px;
}

#finalSummary h4 {
  color: #2c6ea0;
}

/* Mobile improvements for form elements */
@media (max-width: 576px) {
  input, select, .form-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  .card-header {
    font-size: 0.9rem;
  }
  
  label {
    font-size: 0.85rem;
  }
  
  .custom-file-label {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .form-check-label {
    font-size: 0.85rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
}

/* Responsive navigation link */
.sim-nav-link {
  display: inline-block;
  margin-bottom: 15px;
}

@media (min-width: 1024px) {
  .sim-nav-link {
    position: absolute;
  }
}

/* Mobile-friendly improvements for the chart */
@media (max-width: 768px) {
  .card-body canvas {
    height: auto !important;
  }
}