@page {
  size: auto !important;  /* let the user choose */
}

.copyable {
    cursor: copy;
}

.pn-result-highlight {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.pn-result-fade {
    transition: background-color 1.5s ease, border-color 1.5s ease;
}

.flash-container {
    position: fixed;
    z-index: 999;
    left: 30%;
    display: hidden;
}

.flash-container-displayed {
    display: inline;
    background-color: rgb(201, 201, 201);
    margin: 8px;
    padding: 14px;
}

.hidden {
    display: none;
}

 /* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

.bg-success-light {
  background-color: lightgreen;
}
.bg-danger-light {
  background-color: rgb(255, 195, 195);
}

.status_no_doctor, .status_no_activities, .status_no_activities_and_no_doctor {
  background-color: rgb(170, 170, 170);
}

.status_missing_activities {
  background-color: rgb(255, 186, 96);
}

.status_missing_invites {
  background-color: rgb(255, 195, 195);
}

.status_missing_soon {
  background-color: rgb(255, 253, 126);
}

.status_missing_activities_and_no_doctor, .status_missing_invites_and_no_doctor, .status_missing_soon_and_no_doctor {
  background-color: rgb(174, 52, 255);
}

.inline-icon {
   vertical-align: bottom;
   font-size: 18px !important;
   padding-bottom: 2px;
}

.dropdown-menu-wide {
    min-width: 18rem;
}

/* Off-canvas styles */
.offcanvas {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
  z-index: 1050;
  overflow-y: auto;
}

.offcanvas.show {
  right: 0;
}

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.offcanvas-body {
  padding: 1rem;
}

.offcanvas-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
}

.offcanvas-backdrop.show {
  display: block;
}

/* Adjust calendar container to account for offcanvas */
.calendar-container {
  transition: margin-right 0.3s ease-in-out;
}

.calendar-container.offcanvas-open {
  margin-right: 480px;
}

/* Template list */
.template-list {
  margin-top: 20px;
}
.template-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.template-item:last-child {
  border-bottom: none;
}
.delete-template {
  color: #dc3545;
  cursor: pointer;
}

.modal-content {
  max-height: 90vh;
}

.modal-body {
  overflow-y: auto;
}

@media (min-width: 1200px) {
  .modal-xxl {
    max-width: 1150px;
  }
}

@media (min-width: 1600px) {
  .modal-xxl {
    max-width: 1500px;
  }
}

/* Navigation badges */
.nav-badge {
  font-size: 0.65rem;
  position: relative;
  top: -0.6em;
  margin-left: 1px;
}

/* Print Styles */
@media print {
  /* Hide navigation, buttons, and interactive elements */
  nav,
  .navbar,
  button,
  .btn,
  input[type="button"],
  input[type="submit"],
  .modal,
  .modal-backdrop,
  .offcanvas,
  .offcanvas-backdrop,
  footer,
  .badge,
  #flash-container,
  .flash-container {
    display: none !important;
  }

  /* Hide form controls but show their values */
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="checkbox"],
  select,
  textarea {
    border: none !important;
    background: transparent !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
  }

  /* Make readonly fields look like plain text */
  input[readonly],
  input[disabled],
  textarea[readonly] {
    color: #000 !important;
  }

  /* Page layout */
  @page {
    margin: 1cm;
    size: portrait;
  }

  body {
    margin: 0;
    padding: 0;
    font-size: 12pt;
    color: #000;
    background: white;
  }

  /* Ensure content uses full width */
  .container,
  .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Cards - show content but remove styling */
  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 10px !important;
  }

  .card-header {
    background-color: #f0f0f0 !important;
    border-bottom: 1px solid #000 !important;
    padding: 5px 10px !important;
    font-weight: bold;
  }

  .card-body {
    padding: 10px !important;
  }

  /* Tables */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto;
    font-size: 10pt;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  thead {
    display: table-header-group;
  }

  th,
  td {
    border: 1px solid #000 !important;
    padding: 4px !important;
    text-align: left;
  }

  th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
  }

  /* Audio-specific print styles */
  /* Hide interactive controls */
  .col-md-4 .d-flex.gap-2,
  .form-check,
  .btn-group,
  #audioComment,
  #workRelatedDropdown,
  #measurementDate,
  #measurementUser {
    display: none !important;
  }

  /* Hide control panel (right sidebar in audio) */
  .col-md-4 .card {
    display: none !important;
  }

  /* Expand audiogram to full width */
  .col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Audiogram - ensure it prints properly */
  .audiogram-container {
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
  }

  #audiogram {
    max-width: 100%;
    height: auto;
  }

  /* Hide specific columns in audio measurement table */
  .table-responsive-measurements th:nth-child(1),
  .table-responsive-measurements td:nth-child(1),
  .table-responsive-measurements th:nth-child(2),
  .table-responsive-measurements td:nth-child(2) {
    display: none !important;
  }

  /* Make measurement table readable */
  .table-responsive-measurements {
    overflow: visible !important;
  }

  .table-responsive-measurements table {
    font-size: 8pt !important;
  }

  /* Spiro-specific print styles */
  /* Hide patient edit button and actions */
  #editPatientBtn,
  #patientEditActions,
  .history-row button {
    display: none !important;
  }

  /* Hide measurement form fields */
  #measurementFormFields input,
  #measurementFormFields select,
  #measurementFormFields textarea,
  #saveStatusMessage,
  #sendStatusMessage,
  #sentStatusIndicator,
  #sourceIndicator {
    display: none !important;
  }

  /* Hide action column in historical table */
  .table-striped thead th:last-child,
  .table-striped tbody td:last-child {
    display: none !important;
  }

  /* Show only the display values for patient info */
  .form-control-plaintext {
    display: inline !important;
    border: none !important;
    padding: 0 !important;
  }

  /* Ensure labels are visible */
  .form-label {
    font-weight: bold;
    display: inline !important;
  }

  /* Color preservation for grade indicators (if needed) */
  .grade-0,
  .grade-1,
  .grade-2,
  .grade-3 {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Status badges - hide them */
  .badge {
    display: none !important;
  }

  /* Page breaks */
  h1,
  h2,
  h3,
  h4,
  h5 {
    page-break-after: avoid;
  }

  .card {
    page-break-inside: avoid;
  }

  /* Remove Bootstrap row gaps */
  .row {
    margin: 0 !important;
  }

  .col-md-3,
  .col-md-4,
  .col-md-6,
  .col-md-8,
  .col-md-12 {
    padding: 0 5px !important;
  }
}