/* 
 * index.css
 * Primary styles for CareBeam main application interface
 * This file takes precedence over styles.css for any overlapping styles
 */

/* Variables */

/* ROOT/RESET */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* cursor: none; */
}

:root {
  /* spacing */
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 64px;
  --sidebar-mobile-width: min(86vw, 320px);

  --light-green: #68e095;
  --green: #68e095;
  --grey: #d9d9d9;
  --darkGrey: #949494;
  --lightGrey: #fafafa;
  --blue: #335df3;
  --white: #ffffff;
  --black: #000000;
  --button-text: white;
  --upload-button-bg: #4a6fa5;
  --upload-button-hover-bg: #3a5a8a;
  --button-bg-hover: #5acf7f;
  --button-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --button-shadow-active: 0 1px 2px rgba(0, 0, 0, 0.1);

  /* new CSS -DK */
  --primaryText: #374151;
  --primaryTextInverse: var(--white);
  --secondaryText: #4b5563;
  --tertiaryText: #6b7280;
  --baseColor: var(--white);
  --baseColorHover: #f4f4f4;
  --baseColorActive: #e6e6e6;
  --baseAccent: rgb(239, 246, 255);
  --primaryAccent: var(--blue);
  --primaryAccentHover: #4a6ff5;
  --primaryAccentActive: rgb(7, 54, 224);
  --secondaryAccent: rgb(22, 163, 74);
  --tertiaryAccent: #fbbf24;
  --dangerColor: #ef4444;
  --primaryAccentLight: rgb(191, 219, 254);
  --primaryAccentLighter: #dfecff;
}

/* set up fade in animations */
@keyframes fade-in {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

.fade-in {
  animation: fade-in 1s ease-in-out;
}

html,
body {
  overflow: hidden;
  min-height: 100%;
  height: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%; /* Prevent font size adjustment on orientation change */
  touch-action: manipulation; /* Optimize touch actions */
}

/* Button Styles with consistent width */
#uploadAudioBtn,
#generateBtn,
#generateSoapBtn,
#generateProgressNoteBtn,
#generateVisitSummaryBtn,
#generateDiagnosticInsightsBtn,
#generatePsychNoteBtn,
#generateMentalHealthNoteBtn,
#generatePainMgmtNoteBtn,
#generateChiroNoteBtn,
#generateCodesBtn,
#clarityPediatricsBtn,
#nascentiaHealthBtn,
#timothyGrothBtn,
#samaritanPalliativeBtn,
#samaritanPrimaryCareBtn,
#nomaTherapyBtn,
#templateBuilderBtn,
#myNotesBtn {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  height: 44px;
  font-size: 16px;

  font-weight: 500;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  padding: 0 16px;
  box-sizing: border-box !important;
  transition: background-color 0.3s ease !important;
  overflow: hidden !important;
}

.audit-publish-dropdown {
  max-height: 320px;
  overflow-y: auto;
  padding: 0;
}

.audit-publish-dropdown .dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 16px;
  font-weight: 500;
}

.audit-publish-dropdown .dropdown-item .audit-note-label {
  font-size: 15px;
  color: #1a1a1a;
}

.audit-publish-dropdown .dropdown-item .audit-note-meta {
  font-size: 12px;
  color: #666666;
}

.audit-publish-dropdown .dropdown-item:hover {
  background-color: #f1f4ff;
}

.audit-publish-container {
  margin-top: 8px;
}

.audit-publish-dropdown .dropdown-empty,
.audit-publish-dropdown .dropdown-loading,
.audit-publish-dropdown .dropdown-empty small {
  width: 100%;
}

/* Upload Audio Button styles */
#uploadAudioBtn {
  background-color: var(--upload-button-bg, #4a6fa5);
  color: var(--button-text);
}

#uploadAudioBtn:hover {
  background-color: var(--upload-button-hover-bg, #3a5a8a);
}

#uploadAudioBtn:active {
  transform: scale(0.97);
  box-shadow: var(--button-shadow-active);
}

#uploadAudioBtn > i,
#generateBtn > i,
#saveBtn > i,
#editorOptionsBtn > i,
#codesSearchBtn > i {
  margin-right: 8px;
}

#uploadAudioBtn > span,
#generateBtn > span,
#saveBtn > span,
#editorOptionsBtn > span,
#codesSearchBtn > span {
  white-space: nowrap;
}

/* Add pulse animation for recording state */
@keyframes recording-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(104, 224, 149, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(104, 224, 149, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(104, 224, 149, 0);
  }
}

/* Make icon and text alignment more consistent */
#generateBtn > i,
#generateSoapBtn > i,
#generateProgressNoteBtn > i,
#generateVisitSummaryBtn > i,
#generateDiagnosticInsightsBtn > i,
#generatePsychNoteBtn > i,
#generateMentalHealthNoteBtn > i,
#generatePainMgmtNoteBtn > i,
#generateChiroNoteBtn > i,
#generateCodesBtn > i {
  position: static !important;
  flex-shrink: 0 !important;
  margin-right: 8px !important;
  font-size: 16px !important;
}

#generateBtn > span,
#generateSoapBtn > span,
#generateProgressNoteBtn > span,
#generateVisitSummaryBtn > span,
#generateDiagnosticInsightsBtn > span,
#generatePsychNoteBtn > span,
#generateMentalHealthNoteBtn > span,
#generatePainMgmtNoteBtn > span,
#generateChiroNoteBtn > span,
#generateCodesBtn > span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 0 1 auto !important;
}

#generateBtn {
  background-color: var(--blue, #335df3) !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 500;
}

#generateBtn:hover,
#myNotesBtn:hover {
  background-color: #4a6df9 !important;
  transform: translateY(-1px);
}

/* NEW: Style Clarity and Nascentia buttons on desktop like Generate Note */
#clarityPediatricsBtn,
#nascentiaHealthBtn,
#care2uBtn,
#timothyGrothBtn,
#samaritanPalliativeBtn,
#samaritanPrimaryCareBtn,
#nomaTherapyBtn,
#templateBuilderBtn {
  background-color: var(--blue, #335df3) !important;
  color: white !important;
  border: none;
  border-radius: 8px;
}

#clarityPediatricsBtn:hover,
#nascentiaHealthBtn:hover,
#care2uBtn:hover,
#timothyGrothBtn:hover,
#samaritanPalliativeBtn:hover,
#samaritanPrimaryCareBtn:hover,
#nomaTherapyBtn:hover {
  transform: translateY(-1px);
}

/* Override: Make Template Builder button green in header */
#templateBuilderBtn {
  background-color: var(--green, #68e095) !important;
  color: var(--black, #000000) !important;
}

/* Template Builder button - no hover effects */

/* Fix icon positioning for all buttons */
#generateBtn > i,
#generateSoapBtn > i,
#generateProgressNoteBtn > i,
#generateVisitSummaryBtn > i,
#generateDiagnosticInsightsBtn > i,
#generatePsychNoteBtn > i,
#generateMentalHealthNoteBtn > i,
#generatePainMgmtNoteBtn > i,
#generateChiroNoteBtn > i,
#generateCodesBtn > i {
  position: static !important;
  flex-shrink: 0 !important;
  margin-right: 8px !important;
  font-size: 16px !important;
}

/* Fix text content to maintain fixed width */
#generateBtn span,
#generateSoapBtn span,
#generateProgressNoteBtn span,
#generateVisitSummaryBtn span,
#generateDiagnosticInsightsBtn span,
#generatePsychNoteBtn span,
#generateMentalHealthNoteBtn span,
#generatePainMgmtNoteBtn span,
#generateChiroNoteBtn span,
#generateCodesBtn span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 0 1 auto !important;
}

#deleteEncounterBtn {
  display: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  height: 36px;
}

@media (max-width: 768px) {
  /* Ensure all buttons have consistent styling */
  #generateBtn {
    height: 54px;
    font-size: 18px;
    border-radius: 8px;
    width: 100%;
    max-width: 95%;
    margin: 5px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 16px;
  }
}

.minimize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Push to Healthie button styling */
.push-to-healthie-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 44px;
  background-color: #335df3 !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 8px;
  font-size: 16px;
  padding: 0 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: 8px;
}

.push-to-healthie-btn:hover {
  background-color: #2a4fd9 !important;
}

.push-to-healthie-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.push-to-healthie-btn.success:disabled {
  opacity: 1; /* Full opacity for posted state - green should be fully visible */
  cursor: not-allowed;
}

.push-to-healthie-btn span {
  font-weight: 500;
  white-space: nowrap;
  color: var(--white) !important;
}

.push-to-healthie-btn.success {
  background-color: #68e095 !important;
}

.push-to-healthie-btn.success span {
  color: #000000 !important; /* Black text on green background */
}

.push-to-healthie-btn.error {
  background-color: #ef4444 !important;
}

/* Push to athena button styling */
.push-to-athena-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 44px;
  background-color: #335df3 !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 8px;
  font-size: 16px;
  padding: 0 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: 8px;
}

.push-to-athena-btn:hover {
  background-color: #2a4fd9 !important;
}

.push-to-athena-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.push-to-athena-btn.success:disabled {
  opacity: 1; /* Full opacity for posted state - green should be fully visible */
  cursor: not-allowed;
}

.push-to-athena-btn span {
  font-weight: 500;
  white-space: nowrap;
  color: var(--white) !important;
}

.push-to-athena-btn.success {
  background-color: #68e095 !important;
}

.push-to-athena-btn.success span {
  color: #000000 !important; /* Black text on green background */
}

.push-to-athena-btn.error {
  background-color: #ef4444 !important;
}

/* Push to eCW button styling */
.push-to-ecw-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 44px;
  background-color: #3b82f6 !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 8px;
  font-size: 16px;
  padding: 0 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: 8px;
}

.push-to-ecw-btn:hover {
  background-color: #2563eb !important;
}

.push-to-ecw-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.push-to-ecw-btn.success:disabled {
  opacity: 1; /* Full opacity for posted state - green should be fully visible */
  cursor: not-allowed;
}

.push-to-ecw-btn span {
  font-weight: 500;
  white-space: nowrap;
  color: var(--white) !important;
}

.push-to-ecw-btn.success {
  background-color: #68e095 !important;
}

.push-to-ecw-btn.success span {
  color: #000000 !important; /* Black text on green background */
}

.push-to-ecw-btn.error {
  background-color: #ef4444 !important;
}

/* Healthie notification animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.unified-copy-btn {
  width: 120px;
}

.voice-edit-btn {
  width: 44px;
  min-width: 44px;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-edit-btn.recording {
  background-color: #f44336;
  color: #fff;
  border-color: #f44336;
}

/* Improve textarea spacing */
.soap-output,
.progress-note-output,
.visit-summary-output,
.diagnostic-insights-output,
.psych-note-output,
.mental-health-note-output,
.pain-mgmt-note-output,
.chiro-note-output,
.code-note-output,
.clarity-note-output,
.nascentia-note-output,
.timothy-groth-note-output,
.samaritan-palliative-note-output,
.samaritan-primary-care-note-output,
.athena-note-output {
  margin-top: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 15px;
  width: 100%;
  box-sizing: border-box;
  min-height: 480px;
  /* resize: vertical; */
}

#status {
  display: inline-block;
  vertical-align: middle;
  margin-left: 1rem;
}

#status:not(.recording) {
  display: none;
}

#status.recording {
  display: inline-block;
  color: #335df3;
  font-weight: 500;
}

.scribeai-logo {
  width: 152px;
  height: auto;
  margin-left: 15px;
}

.subscription-banner {
  background-color: #f0f4ff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  z-index: 99;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.body-header {
  /* background-color: var(--blue); */
  background-color: #0A0D29;
  height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  z-index: 99;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Make the patient-info consistent in all states */
.patient-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--grey);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 20px;
  margin: 0;
}

/* Custom Template Items */
.custom-template-item {
  padding: 12px 18px !important;
}

.custom-template-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

.custom-template-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.custom-template-name {
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.custom-template-meta {
  font-size: 12px;
  color: #666;
  font-weight: normal;
}

/* Custom Note Output Container */
.note-output-container {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.note-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-actions {
  display: flex;
  gap: 8px;
}

.note-actions button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.note-actions button:hover {
  background: #f0f0f0;
}

.note-content {
  padding: 20px;
  white-space: pre-wrap;
  line-height: 1.6;
  color: #333;
}

/* Microphone Visualization Styles */
.mic-visualization {
  display: none; /* Hidden by default */
  /* margin-left: 10px; */
  height: 20px;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  padding-left: 1rem;
  padding-right: 1rem;
}

.mic-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2px;
}

.mic-wave .bar {
  width: 3px;
  border-radius: 1px;
  background-color: var(--black);
  animation: none !important;
  transition: height 0.05s ease-out;
}

.mic-wave .bar1 {
  height: 8px;
}

.mic-wave .bar2 {
  height: 16px;
}

.mic-wave .bar3 {
  height: 20px;
}

.mic-wave .bar4 {
  height: 16px;
}

.mic-wave .bar5 {
  height: 8px;
}

@keyframes sound-wave {
  0% {
    transform: scaleY(0.8);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(0.8);
    opacity: 0.6;
  }
}

/* Danger button style for Delete Encounter */
.danger-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
}

.danger-btn:hover {
  background-color: #c82333;
}

/* Spinner Animation */
.fa-spin {
  animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Subscription Styles */
.subscription-banner {
  background-color: #f0f4ff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  z-index: 99;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subscribe-button {
  background-color: #4f46e5;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
}

.subscribe-button:hover {
  background-color: #4338ca;
}

/* Mobile Styles */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
  }

  /* Make containers take full width with consistent sizing */
  .patient-info {
    width: 98% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Buttons take full width */
  #generateBtn {
    width: 100% !important;
    box-sizing: border-box !important;
    flex: 1 0 auto !important;
    transition:
      background-color 0.3s ease,
      color 0.3s ease !important;
    height: 54px !important;
    min-height: 54px !important;
    font-size: 18px !important;
    border-radius: 8px !important;
    margin: 5px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
  }
}

/* Standardize button size and prevent content-based resizing */
#generateBtn {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  height: 44px !important;
  font-size: 16px;
  font-weight: 500;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  padding: 0 16px;
  box-sizing: border-box !important;
  transition: background-color 0.3s ease !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

/* Mobile adjustments for the buttons */
@media (max-width: 768px) {
  .patient-info {
    flex-direction: column;
    gap: 10px;
    /* align-items: center; */
  }

  #generateBtn {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Fix icon positioning */
#generateBtn i {
  margin-right: 8px !important;
  font-size: 16px !important;
  position: static !important;
}

/* Trial countdown/subscription banner styling */
.trial-countdown {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  z-index: 9999;
  background-color: var(--blue);
  color: white;
  padding: 8px 20px;
  box-sizing: border-box;
  height: 36px;
  font-size: 13px;
  border-radius: 0 0 8px 8px;
}

/* Desktop specific z-index for trial banner */
@media (min-width: 769px) {
  .trial-countdown {
    z-index: 110; /* Higher z-index to stack on top of header */
    top: 20px; /* Move it up more to increase overlap with header */
  }

  .body-header {
    z-index: 100;
  }
}

.trial-countdown > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trial-countdown-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* Style for the warning variant */
.trial-countdown.warning {
  background-color: #f59e0b;
}

/* Style the "Resubscribe" button */
#resubscribe-btn {
  padding: 4px 10px;
  background-color: white;
  color: #f59e0b;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  font-size: 12px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Hide dismiss button on desktop */
@media (min-width: 769px) {
  .trial-countdown #dismiss-banner-btn {
    display: none !important;
  }

  /* Give more space to the text when button is hidden */
  .trial-countdown > div:first-child {
    flex: 1;
  }

  /* Center the resubscribe button */
  .trial-countdown-actions {
    flex: 0 0 auto;
  }

  /* Desktop styling for upgrade button */
  #upgrade-now-btn {
    height: 30px;
    padding: 4px 10px;
    font-size: 12px;
    min-width: auto;
    max-width: none;
    box-shadow: 0 0 6px 0px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: white;
    color: var(--blue);
  }

  #upgrade-now-btn:hover {
    box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
  }
}

/* Mobile-specific styles for the banner */
@media (max-width: 768px) {
  .trial-countdown {
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    flex-direction: column;
    height: auto;
    padding: 8px 15px;
    font-size: 12px;
  }

  .trial-countdown > div:first-child {
    margin-bottom: 5px;
  }

  .trial-countdown-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Mobile styling for upgrade button */
  #upgrade-now-btn {
    height: 36px;
    padding: 4px 12px;
    font-size: 13px;
    background-color: white;
    color: var(--blue);
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
  }

  .trial-countdown + .main-content {
    margin-top: calc(
      60px + 66px
    ); /* 60px header + approx 66px for two-line banner */
  }
}

/* Override specific for preventing initial size flashing */
@media (max-width: 768px) {
  /* Force immediate rendering of end state for all elements */
  #generateBtn {
    transition: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -webkit-animation: none !important;
    will-change: auto !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  /* Set initial sizes for all critical elements */
  #generateBtn {
    contain: layout size style !important;
    content-visibility: auto !important;
  }

  #generateBtn {
    min-height: 54px !important;
    height: 54px !important;
  }

  /* Reserve space for elements that might not be loaded yet */
  .patient-info {
    min-height: 180px !important;
  }

  /* Force immediate rendering */
  body {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
  }

  /* Set sizes initially */
  html:not(.js) #generateBtn {
    width: 100% !important;
    height: 54px !important;
    min-height: 54px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Prevent FOUC (Flash of Unstyled Content) */
html {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Disable all animations for mobile to prevent resizing */
@media (max-width: 768px) {
  * {
    transition: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -webkit-animation: none !important;
  }
}

/* Core button and container style - mobile specific */
@media (max-width: 768px) {
  /* All buttons must have exact same dimensions */
  #generateBtn,
  #generateSoapBtn,
  #generateProgressNoteBtn,
  #generateVisitSummaryBtn,
  #generateDiagnosticInsightsBtn,
  #generatePsychNoteBtn,
  #generateMentalHealthNoteBtn,
  #generatePainMgmtNoteBtn,
  #generateChiroNoteBtn,
  #generateCodesBtn {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    font-size: 18px !important;
    border-radius: 8px !important;
    margin: 5px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0 16px !important;
    gap: 8px !important;
  }

  /* Override specific button styling for mobile - keep Learn Format button consistent */

  /* All content containers must have the same width */
  .patient-info,
  .patient-info.loaded-state {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #generateBtn {
    background-color: var(--blue) !important;
    color: var(--white) !important;
    border: none !important;
  }

  /* Setting up the container structure */
  .patient-info {
    flex-direction: column !important;
    padding: 0 !important;
    border: none !important;
    gap: 4px !important;
    margin: 0 0 10px 0 !important;
    /* align-items: center !important; */
  }

  /* Stacked display for patient info */
  .patient-info > div:last-child {
    display: flex !important;
    flex-direction: column !important;
  }
  /* Note outputs */
  .soap-output,
  .progress-note-output,
  .visit-summary-output,
  .diagnostic-insights-output,
  .psych-note-output,
  .mental-health-note-output,
  .pain-mgmt-note-output,
  .chiro-note-output,
  .code-note-output,
  .clarity-note-output,
  .nascentia-note-output,
  .timothy-groth-note-output {
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Body header responsive fixes */
.body-header {
  /* background-color: var(--blue); */
  background-color: #0A0D29;
  height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  z-index: 99;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Fix for toggle buttons */
#darkModeToggle,
#toggleCodesButton {
  position: fixed;
  width: 40px;
  height: 40px;
  display: none; /* Hide by default on desktop */
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: white;
  z-index: 100;
  font-size: 18px;
}

/* Only show toggle buttons on mobile */
@media (max-width: 768px) {
  #darkModeToggle,
  #toggleCodesButton {
    display: flex; /* Show on mobile */
  }

  #darkModeToggle {
    top: 10px;
    right: 65px;
  }

  #toggleCodesButton {
    top: 10px;
    right: 115px;
  }
}

@media (max-width: 480px) {
  /* Smaller spacing for compact mobile devices */

  #darkModeToggle {
    right: 50px;
  }

  #toggleCodesButton {
    right: 90px;
  }

  /* Make logo smaller on very small screens */
  .scribeai-logo {
    width: 130px;
  }

  /* Reduce padding in header */
  .body-header {
    padding: 0 10px;
  }
}

@media (max-width: 360px) {
  /* Extra compact for very small devices */

  #darkModeToggle {
    right: 45px;
  }

  #toggleCodesButton {
    right: 85px;
  }

  /* Make logo even smaller */
  .scribeai-logo {
    width: 110px;
  }

  /* Further reduce padding */
  .body-header {
    padding: 0 5px;
  }
}

/* Learn Format button specific styling */

#uploadAudioBtn,
#generateBtn,
#saveBtn,
#editorOptionsBtn,
#codesSearchBtn {
  margin-top: 0;
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 8px 16px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
  font-size: 14px;
  box-shadow: var(--button-shadow);
}

/* Upload Audio Button styles */
#uploadAudioBtn {
  background-color: var(--upload-button-bg, #4a6fa5);
  color: var(--button-text);
}

#uploadAudioBtn:hover {
  background-color: var(--upload-button-hover-bg, #3a5a8a);
}

#uploadAudioBtn:active {
  transform: scale(0.97);
  box-shadow: var(--button-shadow-active);
}

#uploadAudioBtn > i,
#generateBtn > i,
#saveBtn > i,
#editorOptionsBtn > i,
#codesSearchBtn > i {
  margin-right: 8px;
}

#uploadAudioBtn > span,
#generateBtn > span,
#saveBtn > span,
#editorOptionsBtn > span,
#codesSearchBtn > span {
  white-space: nowrap;
}

.custom-notes-header {
  display: none !important;
}

/* hide elements just for mobile layout */
@media (max-width: 768px) {
  .upload-audio-span {
    display: none;
  }

  .mobile-button-subcontainer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    margin-bottom: 2rem !important;
  }

  .patient-info > *:nth-child(n + 2) {
    display: none !important;
  }
  /* .patient-info > div:last-child {
    display: none !important;
  } */

  .custom-notes-header {
    display: block !important;
    margin-bottom: 1rem;
  }
  .patient-info {
    min-height: 0px !important;
  }

  #app-content {
    height: 100svh;
  }
  html,
  body {
    overscroll-behavior: none;
    overflow: auto;
  }
}

@media (min-width: 769px) {
  #clarityPediatricsBtn,
  #nascentiaHealthBtn,
  #care2uBtn,
  #timothyGrothBtn,
  #samaritanPalliativeBtn,
  #nomaTherapyBtn {
    border-radius: 8px !important;
    margin: 0 auto !important;
  }
}

/* Toggle view button (View Source) styling */
.toggle-view-btn {
  height: 28px !important;
  background-color: var(--white) !important;
  border: 1px solid var(--grey) !important;
  font-weight: 600 !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  text-align: center !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}

/* Hide Template Builder button on mobile */
@media (max-width: 768px) {
  #templateBuilderBtn {
    display: none !important;
  }

  .push-to-healthie-btn,
  .push-to-athena-btn {
    height: 64px;
  }
}
