/* Estilos para tags de médicos en estudios */

.medicos-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 2rem;
}

.medico-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background-color: #EBF8FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.medico-tag:hover {
  background-color: #DBEAFE;
  border-color: #93C5FD;
}

.medico-tag .remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  background-color: #DC2626;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.625rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.medico-tag .remove-btn:hover {
  background-color: #B91C1C;
}

.add-medico-container {
  position: relative;
  display: inline-block;
  z-index: 10;
}

.add-medico-btn,
.medico-add-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1rem !important;
  height: 1rem !important;
  padding: 0 !important;
  background-color: #DBEAFE !important;
  color: #3B82F6 !important;
  border: 1px solid #93C5FD !important;
  border-radius: 50% !important;
  font-size: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-weight: 500 !important;
}

.add-medico-btn .material-symbols-outlined,
.medico-add-button .material-symbols-outlined {
  font-size: 0.75rem !important;
}

.add-medico-btn:hover,
.medico-add-button:hover {
  background-color: #BFDBFE !important;
  border-color: #60A5FA !important;
  color: #2563EB !important;
  transform: scale(1.05) !important;
}

/* Modal para asignar médicos */
.medicos-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.medicos-modal.show {
  display: flex;
}

.medicos-modal-content {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.medicos-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: between;
}

.medicos-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  flex: 1;
}

.medicos-modal-close {
  background: none;
  border: none;
  color: #6B7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.medicos-modal-close:hover {
  background-color: #F3F4F6;
  color: #374151;
}

.medicos-modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.medicos-search-modal {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

.medicos-search-modal:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.medicos-grid {
  display: grid;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.medico-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.medico-item:hover {
  border-color: #3B82F6;
  background-color: #F8FAFC;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.medico-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.medico-info {
  flex: 1;
  min-width: 0;
}

.medico-name {
  font-weight: 500;
  color: #111827;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.medico-specialty {
  color: #6B7280;
  font-size: 0.75rem;
}

.medicos-empty {
  text-align: center;
  padding: 2rem;
  color: #6B7280;
}

.medicos-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 640px) {
  .medicos-modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .medicos-modal-header,
  .medicos-modal-body {
    padding: 1rem;
  }
  
  .medico-item {
    padding: 0.5rem;
  }
  
  .medico-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }
}

.no-medicos-assigned {
  color: #9CA3AF;
  font-size: 0.75rem;
  font-style: italic;
}

.medicos-dropdown-empty {
  padding: 1rem;
  text-align: center;
  color: #6B7280;
  font-size: 0.875rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .medicos-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .medico-tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
  }
  
  .add-medico-btn,
  .medico-add-button {
    width: 0.875rem !important;
    height: 0.875rem !important;
    font-size: 0.5rem !important;
  }
  
  .add-medico-btn .material-symbols-outlined,
  .medico-add-button .material-symbols-outlined {
    font-size: 0.625rem !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  /* Los tags de médicos se mantienen siempre en modo light para mejor legibilidad */
  .medico-tag {
    background-color: #EBF8FF !important;
    color: #1E40AF !important;
    border-color: #BFDBFE !important;
  }
  
  .medico-tag:hover {
    background-color: #DBEAFE !important;
    border-color: #93C5FD !important;
  }
  
  /* El botón de remover también se mantiene visible */
  .medico-tag .remove-btn {
    background-color: #DC2626 !important;
    color: white !important;
  }
  
  .medico-tag .remove-btn:hover {
    background-color: #B91C1C !important;
  }
  
  /* El botón + se mantiene siempre en modo light para mejor visibilidad */
  .add-medico-btn,
  .medico-add-button {
    background-color: #DBEAFE !important;
    color: #3B82F6 !important;
    border-color: #93C5FD !important;
  }
  
  .add-medico-btn:hover,
  .medico-add-button:hover {
    background-color: #BFDBFE !important;
    border-color: #60A5FA !important;
    color: #2563EB !important;
    transform: scale(1.05) !important;
  }
  
  /* El modal se mantiene siempre en modo light para mejor legibilidad */
  .medicos-modal-content,
  .medicos-search-modal,
  .medico-item {
    background: white !important;
    color: #111827 !important;
    border-color: #E5E7EB !important;
  }
  
  .medicos-modal-title,
  .medico-name {
    color: #111827 !important;
  }
  
  .medico-specialty,
  .medicos-empty {
    color: #6B7280 !important;
  }
  
  .no-medicos-assigned {
    color: #6B7280;
  }
}