body {
  background-color: #f9fafb;
  --bs-body-color: #373737;
  padding-top: 40px;
  /* Variables para transiciones */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.8s ease;
  /* Variables para sombras */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  /* Variables para transformaciones */
  --hover-lift: translateY(-2px);
  --hover-lift-sm: translateY(-1px);

  /* Custom guest speaker colors */
  --guest-1-color: 145, 96, 219;
  --guest-2-color: 255, 138, 61;
  --guest-3-color: 32, 201, 151;
  --guest-4-color: 99, 102, 241;
}

.navbar {
  padding: 0 !important;
}

.navbar-nav .nav-link {
  color: white !important;
}

.navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

.logo-image {
  max-height: 50px;
}

header {
  height: 60px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
  background: var(--bs-primary);
}

/* Menú lateral */
#sidebar {
  width: 150px;
  /* Ancho fijo del menú lateral */
  position: fixed;
  top: 60px;
  /* Comienza debajo de la barra superior */
  left: 0;
  height: calc(100% - 60px);
  /* Ocupa todo el alto restante */
  z-index: 100;
  padding-top: 20px;
}

#sidebar .nav-link {
  padding: 10px 20px;
  font-size: 18px;
  display: block;
  color: white;
}

#sidebar .nav-link:hover {
  background-color: var(--bs-nav-link-hover-color);
}

#sidebar .nav-link.active {
  background-color: #4aa287;
}

/* Contenido principal */
#pre-container {
  background: var(--bs-primary);
}

#main-container {
  overflow-y: auto;
  padding-top: 20px;
}

/* Estilos para pantallas más pequeñas */
@media (max-width: 768px) {
  #sidebar {
    width: 100%;
    /* El menú ocupa el 100% del ancho de la pantalla en pantallas pequeñas */
    height: auto;
    position: relative;
    /* Ya no es fijo */
  }

  .content {
    margin-left: 0;
    /* El contenido ahora se adapta */
    padding-top: 20px;
  }

  .navbar-toggler {
    margin-right: 1rem;
  }

  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #007bff;
    padding: 1rem;
  }
}

.form-group {
  display: flex;
  align-items: center;
}

.form-group label {
  margin-right: 0.5rem;
}

.form-group input[type="range"] {
  margin-left: 0.5rem;
}

.btn-group {
  display: flex;
  justify-content: center;
}

.form-check-label {
  margin-left: 10px;
}

#speech-settings {
  transition: opacity 0.2s, max-height 0.2s;
  overflow: hidden;
  justify-content: center;
  align-items: center;
  max-height: 200px;
  opacity: 1;
  /*background: #90ffb51c;*/
}

#speech-settings.hide {
  max-height: 0;
  opacity: 0;
}

/* Variables para scrollbars personalizados */
:root {
  --scrollbar-width: 6px;
  --scrollbar-border-radius: 3px;
  --user-primary-color: #0d6efd; /* Default primary color (Bootstrap blue) */
}

/* Clase base para scrollbars personalizados */
.custom-scrollbar {
  scrollbar-width: thin;
  overflow-y: auto;
}

.custom-scrollbar::-webkit-scrollbar {
  width: var(--scrollbar-width);
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  border-radius: var(--scrollbar-border-radius);
}

/* Contenedor de transcripción */
.transcription-container {
  display: flex;
  flex-direction: column;
  height: auto;
  flex-grow: 1;
  min-height: 500px;
  padding: 1rem;
  border-radius: 0.5rem;
  scrollbar-width: thin;
  overflow-y: auto;
  scrollbar-color: var(--bs-primary) transparent;
}

/* Indicadores de estado de análisis */
.message-content-wrapper {
  position: relative;
}

.status-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Posicionar el indicador en la esquina del mensaje, no en la fila de la inconsistencia */
.message-inconsistency .status-indicator {
  top: 8px;
  right: 8px;
  position: absolute;
}

.status-indicator.analyzing {
  background-color: var(--bs-warning);
  animation: analyzing-pulse 1.5s infinite;
}

.status-indicator.analyzed {
  background-color: var(--bs-success);
}

@keyframes analyzing-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--bs-warning-rgb), 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(var(--bs-warning-rgb), 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--bs-warning-rgb), 0);
  }
}

.transcription-container::-webkit-scrollbar {
  width: var(--scrollbar-width);
}

.transcription-container::-webkit-scrollbar-track {
  background: transparent;
}

.transcription-container::-webkit-scrollbar-thumb {
  background-color: var(--bs-primary);
  border-radius: var(--scrollbar-border-radius);
}

.transcription-container > div {
  margin-bottom: 0.5rem;
}

/* Contenedor de inconsistencias */
#inconsistency-container {
  height: calc(100vh - 350px);
  min-height: 300px;
  padding: 0.5rem;
  scrollbar-width: thin;
  overflow-y: auto;
  scrollbar-color: var(--bs-warning) transparent;
}

/* Contenedor de checkpoints */
#checkpoint-container {
  height: calc(100vh - 350px);
  min-height: 300px;
  padding: 0.5rem;
  scrollbar-width: thin;
  overflow-y: auto;
  scrollbar-color: var(--bs-success) transparent;
}

#inconsistency-container::-webkit-scrollbar {
  width: var(--scrollbar-width);
}

#inconsistency-container::-webkit-scrollbar-track {
  background: transparent;
}

#inconsistency-container::-webkit-scrollbar-thumb {
  background-color: var(--bs-warning);
  border-radius: var(--scrollbar-border-radius);
}

.consultation-container .height-auto {
  display: flex;
  flex-direction: column;
  height: auto; /* Important: Remove fixed height */
}

.cursor-pointer {
  cursor: pointer;
  text-decoration: none;
  color: var(--bs-body-color);
}

.card {
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  text-decoration: none;
  margin-bottom: 1em;
  animation: cardAppear 0.4s ease forwards;
}

.card:hover {
  transform: var(--hover-lift);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 20px;
  font-weight: bold;
}

.card-text {
  font-size: 16px;
}

.icon-space {
  margin-right: 5px;
}

.popover-alert {
  background-color: #f8d7da;
  /* Color de fondo de la alerta */
  border-color: #f5c6cb;
  /* Color del borde de la alerta */
}

.popover-alert .popover-header {
  background-color: #f8d7da;
  /* Color de fondo del encabezado de la alerta */
  border-color: #f5c6cb;
  /* Color del borde del encabezado de la alerta */
  color: #721c24;
  /* Color del texto del encabezado de la alerta */
}

.popover-alert .popover-body {
  color: #721c24;
  /* Color del texto del cuerpo de la alerta */
}

.document-template-header {
  display: flex;
  justify-content: space-between;
  height: 50px;
  overflow: hidden;
}

.document-template-text {
  display: inline-block;
  height: 50px;
  overflow: hidden;
}

.document-text {
  display: inline-block;
  height: 150px;
  overflow: hidden;
}

.document-modal {
  --bs-modal-width: 80% !important;
}

.document-modal-body,
.document-template-modal-body {
  height: auto;
  overflow-y: auto;
}

.ql-toolbar {
  position: sticky;
  top: 40px;
  z-index: 10;
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
  border-bottom: 1px solid #ccc;
  background-color: white;
}

.card.disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.card.disabled .saved-text {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-size: 18px;
  text-align: center;
}

.saved-text {
  display: none;
}

.btn-close-custom {
  width: 40px;
  height: 40px;
  background-color: rgb(232, 23, 8);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

form#document-dropzone {
  border: 2px dashed var(--bs-primary);
  border-radius: 15px;
  background: #ffffff;
  padding: 20px;
  transition: all 0.3s ease-in-out;
  align-items: center;
  justify-content: center;
}

#dropzone-hint {
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  text-align: center;
  margin: 20px 0;
}

.dz-default.dz-message {
  display: none;
}

.dz-success {
  background: none;
  border: 2px solid var(--bs-primary);
  border-radius: 10px;
}

.dz-error {
  background: none;
  border: 2px solid var(--bs-danger);
  border-radius: 10px;
}

@keyframes pulsate {
  0% {
    box-shadow: 0 0 5px var(--bs-primary);
  }

  50% {
    box-shadow: 0 0 15px var(--bs-primary);
  }

  100% {
    box-shadow: 0 0 5px var(--bs-primary);
  }
}

.dz-processing:not(.dz-complete):not(.dz-error) {
  animation: pulsate 1s infinite ease-in-out;
  border: 2px solid var(--bs-primary-border-subtle);
  border-radius: 10px;
}

.dz-row-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 10px;
  margin-bottom: 10px;
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 0;
}

.file-name {
  flex: 2;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.file-size {
  flex: 1;
  font-size: 14px;
  color: #666;
  text-align: right;
}

/* Variables para iconos */
:root {
  --icon-size-sm: 32px;
  --icon-size-md: 35px;
  --icon-font-size-sm: 14px;
  --icon-font-size-md: 20px;
  --icon-font-size-lg: 22px;
}

/* Base para contenedores de iconos */
.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size-sm);
  min-width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  border-radius: 50%;
  background: var(--bs-primary-bg-subtle);
  position: relative;
}

.icon-container i {
  color: var(--bs-primary);
}

/* Different background colors for guest icons with enhanced styles */
.icon-container.guest-0 {
  border: 2px solid rgba(var(--bs-primary-rgb), 0.4);
}

.icon-container.guest-1 {
  border: 2px solid rgba(var(--guest-1-color), 0.4);
}

.icon-container.guest-2 {
  border: 2px solid rgba(var(--guest-2-color), 0.4);
}

.icon-container.guest-3 {
  border: 2px solid rgba(var(--guest-3-color), 0.4);
}

.icon-container.guest-4 {
  border: 2px solid rgba(var(--guest-4-color), 0.4);
}

.confirmed-text {
  margin-bottom: 0.25rem;
  margin-left: 0.25rem;
  color: var(--bs-dark);
  padding: 0.4rem;
  border-radius: 0.4rem;
  background-color: var(--bs-primary-bg-subtle);
  border: 1px solid var(--bs-primary);
  z-index: 2;
  position: relative;
  font-style: normal; /* Asegurarse de que no esté en cursiva */
}

.confirmed-text-time {
  font-size: 0.8rem;
  margin: 0;
}

.transcribing-text {
  margin-left: 0.25em;
  margin-right: 0.25em;
  margin-bottom: 0.25rem;
  padding: 0.2em;
  border-radius: 10px;
  background-color: var(--bs-light-bg-subtle);
  border: 2px solid var(--bs-light-border-subtle);
  font-style: italic;
  color: var(--bs-gray-600);
  /* Efecto de parpadeo sutil para indicar que está transcribiendo */
  animation: transcribing-pulse 2s infinite;
}

@keyframes transcribing-pulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

#patient-table td {
  vertical-align: middle;
}

.new-template-card {
  position: relative;
  text-align: center;
  overflow: hidden;
  /* Asegura que el contenido no se desborde */
  border: 2px solid var(--bs-primary-border-subtle);
}

/* Estilo para el contenido del editor */
.ql-editor {
  line-height: 1.6;
  color: var(--bs-body-color);
}

/* Encabezados dentro del editor */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4 {
  color: var(--user-primary-color); /* Use CSS variable */
  margin-top: 0px;
}

.ql-editor h1 {
  font-size: 28px;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--user-primary-color); /* Use user's color */
  padding-bottom: 10px;
}

.ql-editor h2 {
  font-size: 22px;
  margin-bottom: 1rem;
}

/* Párrafos dentro del editor */
.ql-editor p {
  font-size: 16px;
  margin-bottom: 1rem;
  text-align: justify;
}

/* Tablas dentro del editor */
.ql-editor table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 14px;
}

.ql-editor table,
.ql-editor th,
.ql-editor td {
  border: 1px solid var(--bs-border-color);
}

.ql-editor th,
.ql-editor td {
  padding: 10px;
  text-align: left;
}

.ql-editor th {
  background-color: #f0f0f0;
}

/* Listas dentro del editor */
.ql-editor ul,
.ql-editor ol {
  font-size: 16px;
  margin-bottom: 15px;
}

/* Enlaces dentro del editor */
.ql-editor a {
  color: var(--user-primary-color); /* Use CSS variable */
  text-decoration: underline;
}

.ql-editor a:hover {
  text-decoration: underline;
}

.non-editable {
  background-color: var(--bs-light-bg-subtle);
}

/* Chat Window Styles - Modern Redesign */
#chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px var(--bs-primary-darker);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chat-button:hover {
  transform: scale(1.1);
}

#chat-button:active {
  transform: scale(0.95);
}

#chat-button img {
  width: 40px;
  height: 40px;
  transition: transform var(--transition-normal);
}

#chat-button:hover img {
  transform: scale(1.1);
}

#chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 500px;
  background-color: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

#chat-window.resize-active {
  transition: none;
  box-shadow: 0 0 0 2px var(--bs-primary), var(--shadow-lg);
}

#chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.resizable {
  position: relative;
}

.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  top: 0;
  left: 0;
  cursor: nwse-resize;
  background: transparent;
  z-index: 10;
}

.resizable:hover .resize-handle {
  background-color: rgba(0, 0, 0, 0.05);
  border-bottom-right-radius: 5px;
}

#chat-header {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  align-items: center;
  position: sticky;
  top: 0;
}

#patient-info-chat {
  display: flex;
  align-items: center;
}

#patient-info-chat .patient-avatar {
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

#patient-info-chat .patient-avatar i {
  font-size: 18px;
  color: white;
}

#patient-info-chat .patient-details {
  display: flex;
  flex-direction: column;
}

#patient-info-chat .patient-name {
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.1;
  color: white;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
}

#patient-info-chat .patient-meta {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 1px;
}

#patient-info-chat #patient-docs-count {
  font-size: 0.85rem;
  opacity: 0.8;
}

#patient-info-chat #patient-docs-count i {
  margin-right: 2px;
  margin-left: 4px;
}

#chat-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

#minimize-chat-button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all var(--transition-fast);
}

#minimize-chat-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#minimize-chat-button:active {
  transform: scale(0.95);
}

#chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background-color: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100% - 120px); /* Restar aproximadamente la altura del header y footer */
  max-height: calc(100% - 120px);
}

#chat-body .user-input {
  align-self: flex-end;
  max-width: 80%;
  background-color: var(--bs-primary);
  color: white;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: var(--shadow-sm);
}

#chat-body .user-input p {
  margin: 0;
  word-break: break-word;
}

#chat-body .ai-response {
  align-self: flex-start;
  max-width: 90%;
  background-color: white;
  color: var(--bs-body-color);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

#chat-body .ai-response p {
  margin: 0;
  word-break: break-word;
}

#chat-body .help-input {
  align-self: center;
  text-align: center;
  margin-top: auto;
  margin-bottom: auto;
  font-size: 1.1rem;
}

#chat-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  transition: all var(--transition-fast);
}

#chat-input:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25);
}

.no-select {
  user-select: none;
}

/* Message timestamps and typing indicator */
.message-timestamp {
  font-size: 11px;
  margin-top: 4px;
  text-align: right;
}

.ai-response .message-timestamp {
  text-align: left;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  display: inline-block;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Patient page specific styles */
.patient-sidebar {
  min-height: calc(100vh - 60px);
}

.sidebar-card {
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-color: #fff;
  transition: all 0.2s ease;
  animation: sidebarCardAppear 0.4s ease forwards;
}

@keyframes sidebarCardAppear {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sidebar-card-header {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  padding: 5px;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
}

.sidebar-card-header i {
  color: var(--bs-primary);
  opacity: 0.9;
}

.sidebar-card-body {
  padding: 5px 10px;
}

.patient-info-item {
  position: relative;
}

.patient-info-item small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--bs-gray-600);
  letter-spacing: 0.01em;
}

.info-content {
  line-height: 1.4;
  color: var(--bs-gray-800);
  font-size: 0.85rem;
  background-color: #ffffff;
  padding: 0.5rem;
  border-radius: 0.25rem;
  word-break: break-word;
  border: 1px solid var(--bs-gray-400);
}

.info-content:empty::before {
  content: "No information provided";
  font-style: italic;
  color: var(--bs-gray-500);
  font-size: 0.75rem;
}

.fw-medium {
  font-weight: 500;
}

/* Timeline styles */

.timeline-with-icons {
  position: relative;
  list-style: none;
  padding-left: 45px;
  margin: 0;
}

.timeline-with-icons li {
  list-style-type: none;
}

.timeline-with-icons::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bs-primary);
  opacity: 0.1;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item-content {
  position: relative;
  padding: 1.5rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.timeline-icon {
  position: absolute;
  left: -40px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bs-primary);
  border-radius: 50%;
  margin-bottom: 0;
  z-index: 1;
}

.timeline-item .delete-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.timeline-item-content:hover .delete-btn {
  opacity: 1;
}

.patient-summary {
  position: relative;
  background-color: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.patient-summary:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

.patient-summary .rounded-circle,
.card-body .rounded-circle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.patient-summary .rounded-circle i,
.card-body .rounded-circle i {
  font-size: 16px;
}

.patient-summary .rounded-circle.large {
  width: 48px;
  height: 48px;
}

.patient-summary .rounded-circle.large i {
  font-size: 24px;
}

.patient-summary .text-muted.small {
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.patient-summary .fw-bold {
  font-size: 1.1rem;
}

.patient-summary #patient-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bs-gray-900);
  margin-bottom: 0.25rem;
}

#patientTabs .nav-link,
#consultationTabs .nav-link,
#documentTabs .nav-link,
#profileTabs .nav-link {
  position: relative;
  border: none;
  padding: 0.2rem 0.75rem;
  color: var(--bs-gray-600);
}

#patientTabs .nav-link::after,
#consultationTabs .nav-link::after,
#documentTabs .nav-link::after,
#profileTabs .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--bs-primary);
  opacity: 0;
  transform: scaleX(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#patientTabs .nav-link:hover,
#consultationTabs .nav-link:hover,
#documentTabs .nav-link:hover,
#profileTabs .nav-link:hover {
  color: var(--bs-primary);
}

#patientTabs .nav-link.active,
#consultationTabs .nav-link.active,
#documentTabs .nav-link.active,
#profileTabs .nav-link.active {
  color: var(--bs-primary);
  background: transparent;
}

#patientTabs .nav-link.active::after,
#consultationTabs .nav-link.active::after,
#documentTabs .nav-link.active::after,
#profileTabs .nav-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Card hover effects */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Timeline animations */
@keyframes timelineAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-item {
  animation: timelineAppear 0.4s ease forwards;
}

/* Patient summary animations */
@keyframes summaryAppear {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.patient-summary {
  animation: summaryAppear 0.4s ease forwards;
}

/* Card animations */
@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: cardAppear 0.3s ease forwards;
}

/* Tab navigation styles */
.nav-tabs .nav-link {
  color: var(--bs-body-color);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.2rem 0rem;
  transform: translateY(0);
  transition: var(--transition-normal);
}

.nav-tabs .nav-link:hover {
  transform: translateY(-4px);
  border-color: transparent;
}

.nav-tabs .nav-link.active {
  transform: translateY(0px);
  color: var(--bs-primary);
  font-weight: 600;
  border: none;
  border-bottom: 2px solid var(--bs-primary);
}

/* Timeline filter styles */
.timeline-filters {
  display: flex;
  /* gap: 0.5rem; */
}

.timeline-filter-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.timeline-filter-btn.active {
  background-color: var(--bs-primary);
  color: white;
  border-color: var(--bs-primary);
}

.timeline-filter-btn:not(.active):hover {
  color: var(--bs-primary);
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary);
}

.timeline-actions {
  display: flex;
  gap: 0.5rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.summary-card {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-bottom: 1rem;
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.summary-card:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-card .card-body {
  user-select: none;
  /* Previene la selección de texto al hacer clic */
}

.inconsistency-text {
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin: 0;
  color: var(--bs-warning-text);
}

.inconsistency-text.high {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text);
}

.inconsistency-text.medium {
  background-color: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text);
}

.inconsistency-text.low {
  background-color: var(--bs-info-bg-subtle);
  color: var(--bs-info-text);
}

.ql-container.ql-snow {
  border: 1px solid var(--bs-primary-bg-subtle) !important;
}

.ql-toolbar.ql-snow {
  border: 1px solid var(--bs-primary) !important;
}

.badge-navigation {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.badge-no-navigation {
  background-color: transparent;
  color: var(--bs-primary);
}

.smooth-transition {
  transition: all 0.3s ease-in-out;
}

.resize-none {
  resize: none;
}

/* Estilos para la tabla de informes */
.table tbody tr {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.table tbody tr:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.02);
}

.selected-report {
  --bs-table-bg: transparent;
  border-left: 3px solid var(--bs-primary) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  background-color: var(--bs-primary-bg-subtle) !important;
}

.selected-report td {
  font-weight: 500;
  color: var(--bs-primary);
}

.selected-report::before {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(100% + 1px); /* Ajustamos el ancho para compensar los bordes */
  background: linear-gradient(
    90deg,
    rgba(var(--bs-primary-rgb), 0.05) 0%,
    rgba(var(--bs-primary-rgb), 0.02) 50%,
    rgba(var(--bs-primary-rgb), 0) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.selected-report td {
  position: relative;
  z-index: 1;
}

/* Aseguramos que los botones de acción estén por encima del gradiente */
.selected-report .d-flex {
  position: relative;
  z-index: 1;
}

.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease-in-out;
}

.sortable:hover {
  background-color: var(--bs-primary-bg-subtle);
}

.sortable i.fa-sort-up,
.sortable i.fa-sort-down {
  color: var(--bs-primary);
}

.sortable i.fa-sort {
  color: var(--bs-primary);
}

.password-toggle-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  cursor: pointer;
  color: #888;
  z-index: 1;
}

.password-toggle-icon i {
  pointer-events: none;
}

/* For the Password field */
#password + .password-toggle-icon {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

/* Hover effect for eye icons */
.password-toggle-icon:hover {
  color: #333;
}

/* Styles for password strength feedback */
.password-strength {
  font-size: 0.875em;
  margin-top: 5px;
  font-weight: bold;
}

/* Weak password styling */
.password-strength.weak {
  color: #ff4d4d;
  /* Red */
}

/* Medium password styling */
.password-strength.medium {
  color: #ffa500;
  /* Orange */
}

/* Strong password styling */
.password-strength.strong {
  color: #4caf50;
  /* Green */
}

/* Move form content higher on the page */
.login-container {
  margin-top: 10vh;
}

/* Forgot Password */
.email-error {
  color: #ff4d4d;
  font-size: 0.875em;
  margin-top: 5px;
}

/* Signup */

/* Move form content higher on the page */
.signup-container {
  margin-top: 10vh;
}

.password-criteria {
  font-size: 0.875em;
  margin-top: 5px;
}

.password-criteria ul {
  list-style-type: none;
  padding-left: 5px;
}

.password-criteria p {
  color: var(--bs-body-color);
}

.password-criteria ul {
  margin-top: 5px;
}

.password-criteria li {
  margin-bottom: 3px;
}

.password-criteria li i {
  width: 16px;
  margin-right: 5px;
}

.password-criteria .text-success i {
  color: #4caf50;
}

.password-criteria .text-danger i {
  color: #ff4d4d;
}

.colored-toast.swal2-icon-success {
  background-color: #a5dc86 !important;
}

.colored-toast.swal2-icon-error {
  background-color: #f27474 !important;
}

.colored-toast.swal2-icon-warning {
  background-color: #f8bb86 !important;
}

.colored-toast.swal2-icon-info {
  background-color: #3fc3ee !important;
}

.colored-toast.swal2-icon-question {
  background-color: #87adbd !important;
}

.colored-toast .swal2-title {
  color: white;
}

.colored-toast .swal2-close {
  color: white;
}

.colored-toast .swal2-html-container {
  color: white;
}

.auto-close-sweet-alert .swal2-timer-progress-bar {
  background-color: var(--bs-primary);
}

.callback-sweet-alert .swal2-confirm {
  background-color: var(--bs-primary);
}

.swal2-confirm:focus-visible {
  box-shadow: 0px 0px 0.2rem var(--bs-primary-border-subtle);
}

/* Add this rule at the end of the file or in a relevant section for drawers */
.template-drawer.resizing {
  transition: none !important;
}

.swal2-title {
  color: var(--bs-primary);
}

.yes-no-sweet-alert .swal2-actions {
  display: flex;
  justify-content: space-between;
}

textarea.auto-resize-textarea {
  overflow: hidden;
  min-height: 100px !important;
}

.timer-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bs-primary-bg-subtle);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
  min-width: 100px;
  justify-content: center;
}

.timer {
  font-weight: 500;
  color: var(--bs-primary);
  font-family: monospace;
}

.timer-wrapper:not(.d-none) {
  animation: fadeIn 0.3s ease-in-out;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--bs-danger);
  border-radius: 50%;
  opacity: 0.5;
  transition: all 0.8s ease-in-out;
}

.pulse-dot.active {
  opacity: 1;
  transform: scale(1.3);
}

.inconsistency-text {
  color: var(--bs-warning-text);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hover-shadow {
  transition: var(--transition-normal);
}

.hover-shadow:hover {
  transform: var(--hover-lift);
  box-shadow: var(--shadow-lg);
}

.rounded-circle {
  transition: var(--transition-normal);
}

.card:hover .rounded-circle {
  transform: scale(1.1);
}

.search-wrapper {
  max-width: 400px;
  position: relative;
}

.form-control {
  transition: var(--transition-fast);
}

.form-control:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

.table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.pagination .page-link {
  transition: var(--transition-fast);
}

.pagination .page-link:hover {
  background: var(--bs-primary);
  color: white;
}

.pagination .disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-buttons .btn {
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* New accordion styles */
.accordion-button {
  transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
  background: white;
  color: var(--bs-primary);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(13, 110, 253, 0.1);
}

.accordion-button::after {
  transition: all 0.3s ease;
  background-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3E%3Cpath fill-rule='evenodd' d='M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z'/%3E%3C/svg%3E");
}

.accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3E%3Cpath fill-rule='evenodd' d='M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z'/%3E%3C/svg%3E");
}

.btn-group .btn-sm {
  padding: 0.25rem 1rem;
}

.message-content {
  width: 75%;
  min-width: 0; /* Permite que el contenido se ajuste correctamente */
}

.message-inconsistency-wrapper,
.message-inference-wrapper {
  width: 40%;
  min-width: 250px; /* Asegura un ancho mínimo para la legibilidad */
  max-width: 350px; /* Limita el ancho máximo cuando está abierta */
  transition: all 0.3s ease;
}

/* Estilos para inconsistencias colapsadas */
.message-inconsistency .collapse:not(.show) {
  display: none;
}

/* Hacer que la inconsistencia colapsada sea más compacta */
.message-inconsistency .collapse:not(.show) + .inconsistency-content {
  display: none;
}

/* Reducir el ancho de la inconsistencia colapsada */
.message-inference-wrapper:has(.collapse:not(.show)) {
  width: 40%;
  min-width: 150px;
}

/* Hacer que el header de la inconsistencia colapsada sea más compacto */
.message-inconsistency .collapse:not(.show) ~ .inconsistency-header {
  padding: 0.2rem 0.4rem;
}

.message-inconsistency {
  height: auto;
  margin: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  border: 1px solid transparent;
}

.message-inconsistency .inconsistency-header {
  display: flex;
  align-items: center;
  padding: 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: 500;
  color: inherit;
  justify-content: space-between;
}

.message-inconsistency .inconsistency-header:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.message-inconsistency .inconsistency-title {
  font-weight: 600;
  margin-right: 0.5rem;
}

.message-inconsistency .inconsistency-content {
  padding: 0.5rem;
  border-top: 1px solid currentColor;
  opacity: 0.9;
  max-height: 200px; /* Limitar la altura máxima */
  overflow-y: auto; /* Permitir scroll si el contenido es muy largo */
}

.message-inconsistency .fa-exclamation-triangle {
  opacity: 0.9;
}

.message-inconsistency.high {
  background-color: rgba(var(--bs-danger-rgb), 0.08);
  color: #842029;
  border-color: #dc3545;
}

.message-inconsistency.medium {
  background-color: rgba(var(--bs-warning-rgb), 0.08);
  color: #664d03;
  border-color: #ffc107;
}

.message-inconsistency.low {
  background-color: rgba(var(--bs-info-rgb), 0.08);
  color: #055160;
  border-color: #0dcaf0;
}

.message-content-wrapper {
  gap: 0.75rem !important;
}
/* Navbar styles */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.navbar .nav-link {
  padding: 0rem 1rem;
  transition: all 0.3s ease;
}

.navbar .dropdown-toggle::after {
  margin-left: 0.5rem;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.navbar .dropdown.show .dropdown-toggle::after {
  transform: rotate(180deg);
}

/* Dropdown menu styles */
.dropdown-menu {
  padding: 0.5rem 0;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 200px;
  animation: dropdownFade 0.2s ease;
}

.dropdown-item {
  padding: 0.6rem 1.2rem;
  transition: all 0.2s ease;
  position: relative;
}

.dropdown-item:hover {
  color: var(--bs-primary);
  background-color: var(--bs-primary-bg-subtle);
  padding-left: 1.4rem;
}

.dropdown-item.text-danger:hover {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger) !important;
}

.dropdown-divider {
  margin: 0.5rem 0;
}

.dropdown-header {
  padding: 0.6rem 1.2rem;
  font-weight: 600;
}

/* Profile icon styles */
#profile-dropdown .rounded-circle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#profile-dropdown:hover .rounded-circle {
  background-color: rgba(255, 255, 255, 0.4) !important;
}

/* Dropdown animation */
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para el diálogo de carga modernizado */
.swal-loading-container {
  padding: 0.75rem 0.5rem;
}

.swal-loading-header {
  margin-bottom: 1rem;
}

.swal-loading-header .progress {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.swal-loading-header .progress-bar {
  background-color: var(--bs-primary);
}

.swal-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.swal-loading-step {
  display: flex;
  align-items: center;
  position: relative;
  background-color: #fff;
  border-radius: 0.375rem;
  text-align: left;
  padding: 0.25rem 2rem;
}

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

.swal-loading-step-icon-container {
  flex-shrink: 0;
  margin-right: 1rem;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swal-loading-step-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.swal-loading-step-icon-wrapper i {
  color: var(--bs-primary);
  font-size: 1.25rem;
  z-index: 2;
}

.swal-loading-step-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.swal-loading-step-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #212529;
}

.swal-loading-step-description {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #6c757d;
  line-height: 1.4;
}

.swal-loading-step:not(:has(.swal-loading-step-description:not(:empty))) .swal-loading-step-title {
  margin: 0;
}

.swal-loading-pulse-ring {
  border: 2px solid var(--bs-primary-bg-subtle);
  border-radius: 50%;
  height: 2.5rem;
  width: 2.5rem;
  position: absolute;
  left: 0;
  top: 0;
  animation: pulse 1s ease-out infinite;
  opacity: 0.5;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Personalización adicional para SweetAlert */
.swal2-title {
  color: #212529;
  font-weight: 600;
}

.swal2-html-container {
  margin: 1em 1.6em 0.3em;
}

/* Estilos para la sección de documentos procesados */
.fs-7 {
  font-size: 0.75rem !important;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
}

/* Mejoras específicas para documentos */
#processed-documents .card {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #dee2e6 !important;
}

#processed-documents .card:hover {
  border-color: #adb5bd !important;
}

#processed-documents .card-header {
  border-bottom: 1px solid #dee2e6;
}

#processed-documents .card-footer {
  border-top: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

#processed-documents .row {
  margin-right: -10px;
  margin-left: -10px;
}

#processed-documents .col-md-4 {
  padding-right: 10px;
  padding-left: 10px;
}

.document-text {
  font-size: 0.75rem !important;
  color: #495057;
  line-height: 1.4;
  text-align: justify;
  max-height: 180px;
  overflow: hidden;
}

.document-title {
  font-size: 0.95rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 992px) {
  .document-title {
    font-size: 0.85rem;
  }
}

/* Template Drawer Styles */
.template-drawer {
  position: fixed;
  top: 0;
  right: -50%;
  width: 50%;
  height: 100vh;
  background-color: #fff;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-width: 500px;
  max-width: 90%;
  overflow: hidden;
  transform: translateX(0);
  opacity: 0;
  visibility: hidden;
}

.drawer-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem;
}

.drawer-content form {
  margin-bottom: 2rem;
}

.drawer-footer {
  flex: 0 0 auto;
  padding: 1rem 1.5rem;
  background-color: #fff;
  border-top: 1px solid #dee2e6;
  margin-top: auto;
}

.template-drawer.show {
  right: 0;
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  display: flex !important;
}

.template-drawer:not(.show) {
  transform: translateX(100%);
  right: 0;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Specific z-indexes for template drawer */
#templateDrawer {
  z-index: 1050;
}
#drawerBackdrop {
  z-index: 1049;
}

/* Specific z-indexes for checklist drawer */
#checklistDrawer {
  z-index: 1052;
}
#checklistDrawerBackdrop {
  z-index: 1051;
}

.resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
}

.resize-handle:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Template Card Styles */
.template-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  /* Add a minimum height to ensure cards look consistent */
  min-height: 150px;
  display: flex; /* Use flexbox for better layout control */
  flex-direction: column; /* Stack children vertically */
}

.template-card:hover {
  border-color: var(--bs-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.template-card.non-editable {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.template-card.non-editable:hover {
  border-color: #dee2e6;
  transform: none;
  box-shadow: none;
}

.template-card .template-icon {
  width: 40px;
  height: 40px;
  background: var(--bs-primary);
  opacity: 0.1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.template-card.non-editable .template-icon {
  background: #6c757d;
}

.template-card .template-icon i {
  color: var(--bs-primary);
  opacity: 1;
}

.template-card.non-editable .template-icon i {
  color: #6c757d;
}

.template-card .template-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.template-card .template-status.editable {
  background-color: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.template-card .template-status.non-editable {
  background-color: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.template-card.selected {
  border-color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.02);
}

.template-drawer .form-control:disabled,
.template-drawer .form-control[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

.template-drawer .ql-container.ql-disabled {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

/* Estilos para checkpoints */
.checkpoint-text {
  color: #28a745;
  font-weight: bold;
}

.message-checkpoint {
  height: auto;
  margin: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  border: 1px solid #28a745;
  background-color: rgba(40, 167, 69, 0.08);
  color: #155724;
}

.message-checkpoint .checkpoint-header {
  display: flex;
  align-items: center;
  padding: 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: 500;
  color: inherit;
}

.message-checkpoint .checkpoint-header:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.message-checkpoint .checkpoint-title {
  font-weight: 600;
  margin-right: 0.5rem;
}

.message-checkpoint .checkpoint-content {
  padding: 0.5rem;
  border-top: 1px solid currentColor;
  opacity: 0.9;
}

/* Logo preview styles */
.logo-preview-wrapper {
  width: 100px;
  height: 50px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-preview-image {
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}

.logo-placeholder {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Limit description height */
.checklist-card-description,
.template-card p.text-muted,
.card-text.text-muted {
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.5em; /* Adjust based on line-height and desired lines (e.g., 1.5em line-height * 3 lines) */
  line-height: 1.5em; /* Ensure consistent line height */
  flex-grow: 1; /* Allow description to take available space */
  margin-bottom: 0 !important; /* Override default margin if needed */
}

/* Form floating labels - Improved styling */
.form-floating {
  position: relative;
  margin-bottom: 1rem;
}

/* Sobrescribir específicamente las reglas de Bootstrap con !important */
.form-floating > .form-control,
.form-floating > .form-control-plaintext,
.form-floating > .form-select {
  height: auto !important;
  min-height: 2.6rem !important; /* Menor que el 3.5rem de Bootstrap */
  padding: 0.6rem 0.75rem !important;
  line-height: 1.4 !important;
}

.form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: 0.6rem 0.75rem !important; /* Reduced from 1rem to 0.6rem */
  pointer-events: none;
  transform-origin: 0 0;
  transition: all 0.2s ease;
  color: var(--bs-gray-600);
  font-size: 0.9rem;
  background-color: transparent;
  font-style: italic; /* Default to italic for empty fields */
}

.form-floating input:focus ~ label,
.form-floating textarea:focus ~ label,
.form-floating select:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label,
.form-floating textarea:not(:placeholder-shown) ~ label,
.form-floating select:not([value=""]) ~ label {
  opacity: 1;
  transform: scale(0.85) translateY(-0.65rem);
  background-color: white;
  padding: 0 0.4rem !important;
  margin-left: 0.5rem;
  height: auto;
  color: var(--bs-primary);
  font-weight: 500;
  z-index: 5;
  border-left: none;
  border-radius: 2px;
  box-shadow: none;
  font-style: normal; /* Non-italic for filled fields */
}

.form-floating .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-control:not(:placeholder-shown) {
  border-color: var(--bs-gray-400);
  background-color: white;
}

.form-floating .form-control::placeholder {
  color: transparent;
}

/* Ensure consistent form control styling */
.form-control,
.form-select {
  padding: 0.6rem 0.75rem !important; /* Use !important to override Bootstrap */
  font-size: 0.9rem; /* Slightly reduced font size */
  border-radius: 0.5rem;
  border: 1px solid var(--bs-gray-300);
  transition: all 0.2s ease;
  height: auto;
  line-height: 1.4;
  min-height: 10px;
}

/* Ensure textareas have proper padding and don't get too small */
textarea.form-control {
  min-height: 90px !important; /* Reduced from original height values with important */
  padding-top: 0.8rem !important;
}

/* Improve focus state visibility */
.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.2);
}

/* Modern Tabs */
.modern-tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 1rem;
  height: 2rem;
}

.modern-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0rem 1.5rem;
  border-radius: 2rem;
  background: transparent;
  border: none;
  color: var(--bs-gray-600);
  font-weight: 500;
  transition: all 0.2s ease;
}

.modern-tab-btn:hover {
  background: rgba(var(--bs-primary-rgb), 0.05);
  color: var(--bs-primary);
}

.modern-tab-btn.active {
  background: var(--bs-primary);
  color: white;
}

/* Modern Cards */
.modern-card {
  border-radius: 0.75rem;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  background: white;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  animation: fadeIn 0.4s ease;
}

.modern-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.modern-card-header {
  padding: 5px 10px;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.modern-card-body {
  padding: 5px 10px;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  height: 100%;
}

.stat-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.stat-card-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
  color: var(--bs-gray-800);
}

.stat-card-value-sm {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.25rem;
  color: var(--bs-gray-800);
}

.stat-card-label {
  margin: 0;
  color: var(--bs-gray-600);
  font-size: 0.8rem;
  font-weight: 500;
}

.stat-card-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-gray-100);
  border: none;
  color: var(--bs-gray-700);
  transition: all 0.2s ease;
}

.stat-card-action:hover {
  background: var(--bs-primary);
  color: white;
  transform: scale(1.1);
}

/* Action Cards */
.action-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  height: 100%;
  cursor: pointer;
}

.action-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.action-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.action-card-content {
  flex-grow: 1;
}

.action-card-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bs-gray-800);
}

.action-card-text {
  margin: 0;
  font-size: 0.8rem;
  color: var(--bs-gray-600);
}

/* Section Title */
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-gray-600);
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1rem;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: var(--bs-primary);
  border-radius: 2px;
}

/* Action Pills */
.action-pill-container {
  display: flex;
  gap: 0.5rem;
}

.action-pill {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--bs-gray-700);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-pill:hover {
  background: var(--bs-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(var(--bs-primary-rgb), 0.2);
}

/* Patient Avatar */
.avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: var(--bs-primary-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--bs-primary);
}

/* Filter Pills */
.timeline-filter-pills {
  display: flex;
  gap: 0.5rem;
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--bs-gray-700);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.filter-pill.active {
  background: var(--bs-primary);
  color: white;
  border-color: var(--bs-primary);
}

/* Modern Buttons */
.modern-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  background: var(--bs-primary);
  border: none;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.modern-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.modern-btn-outline {
  background: transparent;
  border: 1px solid var(--bs-primary);
  color: var(--bs-primary);
}

.modern-btn-outline:hover {
  background: var(--bs-primary);
  color: white;
}

.modern-btn-danger {
  background: transparent;
  border: 1px solid var(--bs-danger);
  color: var(--bs-danger);
}

.modern-btn-danger:hover {
  background: var(--bs-danger);
  color: white;
}

/* Tab Container */
.tab-container {
  position: relative;
}

.tab-pane {
  display: none;
  opacity: 0;
  transition: all 0.3s ease;
}

.tab-pane.active {
  display: block;
  opacity: 1;
}

#logoPreviewContainer {
  border: 2px solid var(--bs-primary);
  width: 120px;
  height: 80px;
}
