*{
  font-family: "Gill Sans", sans-serif;
}

body {
    margin: 0;
    /* font-family: Arial, sans-serif; */
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  #main-header {
    width: 100%;
    background: linear-gradient(90deg, #ebf3ff 0%, #1976d2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 0;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
  }
  .header-content {
    display: flex;
    align-items: center;
    height: 60px;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 32px;
  }
  .logo {
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.6em;
  }

  .remedi-logo {
    width: 80%; /* Reduced by 20% */
    height: auto;
  }

  .branding-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
  }

  .powered-by {
    font-size: 0.75rem;
    margin-left: 5.5px;
    color: #777;
    font-weight: 400;
    margin-bottom: -5px;
    align-self: flex-start;
  }

  .brisa-logo {
    display: flex;
    align-items: center;
  }
  .logo i {
    font-size: 2.2rem;
    margin-right: 0.3em;
    color: #fff;
  }
  @media (max-width: 600px) {
    .header-content {
      padding: 0 12px;
    }
    .logo {
      font-size: 1.3rem;
    }
    #main-header {
      height: 48px;
    }
    .header-content {
      height: 48px;
    }
  }

  #container {
    display: flex;
    width: 100%;
    height: calc(100vh - 60px); /* Subtract header height */
    transition: all 0.5s ease;
    overflow: hidden;
  }

  #left {
    flex: 1;
    padding: 20px;
    transition: width 0.5s ease;
    box-sizing: border-box;
    overflow-y: auto;
    max-width: 50%;
  }

  pre {
    /* font-family: 'Times New Roman', Times, serif; */
    background-color: #f4f4f4;      /* Light gray background */
    padding: 1em;                   /* Spacing inside the box */
    border-radius: 6px;             /* Rounded corners */
    border: 1px solid #ddd;         /* Subtle border */
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;          /* Preserves formatting and allows wrapping */
    word-wrap: break-word;          /* Breaks long words */
    overflow-x: auto;               /* Enables horizontal scroll if needed */
    color: #2d2d2d;                 /* Dark gray text for better readability */
  }
  
  #interaction-area {
    width: 100%;
    min-height: 250px;
    margin-bottom: 10px;
    position: relative;
  }
  .interaction-placeholder, #nurseTextarea, #videoFeed {
    width: 100%;
    height: calc(80vh - 80px); /* Reduced height */
    font-size: 16px;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #ccc;
    margin-bottom: 0;
}
.interaction-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f2f2f2;
    color: #888;
}
#nurseTextarea {
    /* font-family: 'sans-serif'; */
    resize: vertical;
    display: none;
    outline: none;
    border: 1px solid #bdbdbd;
    box-shadow: 0 0 0 2px #bdd4ff;
    transition: all 0.2s ease;
}
#nurseTextarea:focus {
    border-color: #b6cffe;
    box-shadow: 0 0 0 2px #bdd4ff;
}
#videoFeed {
    display: none;
    object-fit: cover;
    background: #000;
}
  #interaction-modes {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  
  .mode-btn {
    flex: 0 0 48px;
    height: 48px;
    width: 48px;
    border-radius: 12px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 1.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
  }
  .mode-btn.selected {
    background: #e6f7e6;
    border: 2px solid #4CAF50;
  }
  .mode-btn.speech-recording {
    background: #ffe6e6;
    border: 2px solid #ff3333;
    color: #ff3333;
    animation: pulse 1s infinite alternate;
  }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 #ffcccc; }
    100% { box-shadow: 0 0 10px 4px #ffcccc; }
  }
  .generate-btn {
    margin-left: auto;
    padding: 10px 24px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    font-weight: bold;
  }

  #generateBtn {
    /* margin-top: 20px; */
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
  }

  #right {
    flex: 1;
    max-width: 50%;
    min-width: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    box-sizing: border-box;
    border-left: 1px solid #ccc;
    transition: width 0.5s ease;
    background-color: #f9f9f9;
    border-radius: 0 10px 10px 0;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .right-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: space-around;
  }

  .nav-item {
    padding: 15px 15px;
    font-size: 0.95em;
    color: #555;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .nav-item i {
    font-size: 1.4em;
    margin-bottom: 4px;
    color: #777;
    transition: all 0.2s ease;
  }
  
  .nav-text {
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    bottom: 2px;
    white-space: nowrap;
  }

  .nav-item:hover {
    color: #1976d2;
    background-color: rgba(25, 118, 210, 0.05);
  }
  
  .nav-item:hover i {
    color: #1976d2;
  }
  
  .nav-item:hover .nav-text {
    opacity: 1;
  }

  .nav-item.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 600;
  }
  
  .nav-item.active i {
    color: #1976d2;
  }
  
  .nav-item.active .nav-text {
    opacity: 1;
    font-weight: 600;
  }

  #right-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
  }
  
  .tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
  }
  
  .tab-content.active {
    display: block;
  }
  
  .content-placeholder {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .content-placeholder h3 {
    margin-top: 0;
    color: #1976d2;
    font-size: 1.2em;
    margin-bottom: 15px;
  }


  .step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
    position: relative; /* Needed for pseudo-element positioning */
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  .step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 9px; /* half of 20px width - 1px line width */
    width: 2px;
    height: calc(100% - 20px); /* from below the circle to the bottom of step */
    background: #ccc;
    z-index: 0;
  }


  .circle {
    min-width: 20px;
    min-height: 20px;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
  }

  .circle::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 2px;
    height: calc(100% - 20px); /* dynamic height */
    background: #ccc;
    transform: translateX(-50%);
  }


  .step:last-child {
    margin-bottom: 0;
  }

  .step:last-child .circle::after {
    display: none;
  }

  .text {
    font-size: 1.1em;
    font-weight: bold;
  }

  .description {
    margin-top: 5px;
    font-size: 0.95em;
    color: #555;
    white-space: pre-wrap;
  }

  #micBtn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 5px;
    background-color: gray;
    color: white;
    border: none;
  }

  #pre-insight-checklist {
    background: #fffbe7;
    border: 1px solid #ffe08a;
    border-radius: 10px;
    padding: 20px 18px 10px 18px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(255, 224, 138, 0.08);
    transition: all 0.3s;
  }
  
  .checklist-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .checklist-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
  }
  
  .auto-update-icon {
    color: #1976d2;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    background-color: rgba(25, 118, 210, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .auto-update-icon i {
    display: inline-block;
  }
  
  @keyframes spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  
  #pre-insight-checklist {
    position: relative;
  }
  #pre-insight-suggestions {
    background: #e7f8ff;
    border: 1px solid #5cb1fc;
    border-radius: 10px;
    padding: 20px 18px 10px 18px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(255, 224, 138, 0.08);
    transition: all 0.3s;
  }
  .checklist-title {
    font-size: 1.18em;
    font-weight: bold;
    margin-bottom: 12px;
    color: #b58900;
    letter-spacing: 0.5px;
  }
  .suggestions-title {
    font-size: 1.18em;
    font-weight: bold;
    margin-bottom: 12px;
    color: #0073b5;
    letter-spacing: 0.5px;
  }
  .insight-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
  }
  .insight-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.9em;
    color: #666;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }
  .insight-table td {
    padding: 10px;
    font-size: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
  }
  .suggetion-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
  }
  .suggetion-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.9em;
    color: #666;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }
  .suggetion-table td {
    padding: 10px;
    font-size: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
  }
  .status-toggle {
    font-weight: bold;
    color: #777;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-block;
    background: rgba(0,0,0,0.05);
  }
  .status-toggle:hover {
    background: rgba(0,0,0,0.08);
  }
  .status-asked {
    color: #4CAF50;
    background: rgba(76,175,80,0.1);
  }
  .status-asked:hover {
    background: rgba(76,175,80,0.15);
  }
  .relevance-toggle {
    color: #777;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-block;
  }
  .relevance-toggle:hover {
    background: rgba(0,0,0,0.05);
  }
  .relevance-marked {
    color: #f44336;
    font-weight: bold;
  }

  .toast-error {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s ease-out, fadeOut 0.3s ease-in 4.7s forwards;
  }

  .toast-success {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s ease-out, fadeOut 0.3s ease-in 4.7s forwards;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  @keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); display: none; }
  }
  
  .loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3); /* semi-transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px); /* subtle blur effect */
  }

  .loader-overlay-suggestions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3); /* semi-transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px); /* subtle blur effect */
  }

  .loader-overlay-test-suggestions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3); /* semi-transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px); /* subtle blur effect */
  }

  .loader-overlay-doctor-recommendations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3); /* semi-transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px); /* subtle blur effect */
  }

  .loader-overlay-patient-summary {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3); /* semi-transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px); /* subtle blur effect */
  }


  
  .heartbeat-loader {
    width: 30px;
    height: 30px;
    background-color: grey;
    border-radius: 50%;
    animation: heartbeat 1.4s infinite ease-in-out;
    opacity: 0.7;
  }
  
  @keyframes heartbeat {
    0%, 100% {
      transform: scale(1);
      opacity: 0.3;
    }
    50% {
      transform: scale(1.3);
      opacity: 0.9;
    }
  }
  
  .hidden {
    display: none;
  }
  
  /* Loader circle */
.btn-loader {
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  transition: opacity 0.3s ease;
}

/* Spin animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hidden by default */
.hidden {
  display: none;
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #a5d6a7; /* lighter green */
}

.test-checkbox {
  accent-color: #4CAF50;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  cursor: pointer;
  vertical-align: middle;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(76, 175, 80, 0.08);
  transition: box-shadow 0.2s;
}

.test-checkbox:focus {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px #b7e1cd;
}

.test-checkbox:checked {
  accent-color: #4CAF50;
  background-color: #4CAF50;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px #b7e1cd;
}


/* Container for each test suggestion row */
.test-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0; /* No margin so desc is close */
  padding: 4px 0;
}

/* Test name label styling */
.test-item label {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

/* Input field styling */
.test-input[type="file"], .test-input[type="text"] {
  width: 30px;
  height: 30px;
  font-size: 0;
  border: none;
  background: url('upload-icon.png') no-repeat center center;
  background-size: contain;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.test-input[type="file"]:hover, .test-input[type="text"]:hover {
  opacity: 1;
}

.test-input[type="file"]::file-selector-button {
  display: none;
}

/* Description below the row */
.test-desc {
  margin-left: 32px; /* Indent to align with text start after number/checkbox */
  margin-bottom: 10px;
  color: #555;
  font-size: 0.97em;
  white-space: pre-line;
}
